Transformed-space sampling

The distribution of the corrupted speech does not have a closed form. This is because of the non-linearity in the mismatch function (which relates the signals of the speech, noise, and corrupted speech). The compensation methods in Parametrised model compensation therefore approximate the corrupted speech distribution. The papers in the Bibliography introduce an alternative approximation that uses sampling. In the limit, it finds the exact likelihood of one observation. The classes and functions below implement this method.

SampleObservationDensity uses sequential importance resampling (see sequentialImportanceResample) to evaluate the integral in the likelihood expression. This integral is most naturally written over the speech, noise and the phase factor, but, as the papers in the Bibliography detail, can be transformed into an integral over the phase factor and a substitute variable. In this domain, the integrand is factorised (see QuasiConditionalFactorGenerator) and a proposal distribution (see proposalForFactor) is defined. It then becomes feasible to apply sequential importance re-sampling.

class noise.sample_observation_density.SampleObservationDensity(speechGaussian, noiseGaussian, factorGenerator, usePhase, sampleNum, uniformUnitSampler)

Quasi-distribution that evaluates the corrupted speech distribution at a point.

Parameters:
  • speechGaussian – the speech Gaussian.
  • noiseGaussian – the noise Gaussian.
  • factorGenerator – function (dimension, observation, speechGaussian, noiseGaussian) that generates the factor for one dimension. This toolkit includes QuasiConditionalFactorGenerator and PostponedFactorGenerator.
  • usePhase – if False, fix the phase factor to 0. If True, use a distribution.
  • sampleNum – the size of the sample cloud to be used for each dimension.
density(observation)
class noise.factor_integrand.QuasiConditionalFactorGenerator(index, observation, speechGaussian, noiseGaussian)

Class that factorises the integrand in the expression for the corrupted speech likelihood for given observation and models for the speech and noise.

Finds a pair of one-dimensional Gaussians that are conditionals. Note that that does not make the total a probability distribution, because the input to one Gaussian is a transformed version of the variable of integration, and two Gaussians are multiplied.

given(currentSample)
Parameters:currentSample – current partial sample. Setting the previous dimensions differently changes the factor for the current dimension.
Returns:factor of the integrand for one dimension.
class noise.factor_integrand.PostponedFactorGenerator(index, observation, speechGaussian, noiseGaussian)

Class that factorises the integrand in the expression for the corrupted speech likelihood for given observation and models for the speech and noise.

Finds a pair of one-dimensional Gaussians by taking into account all terms up to the current factor, but no later ones.

given(currentSample)
Parameters:currentSample – current partial sample. Setting the previous dimensions differently changes the factor for the current dimension.
Returns:factor of the integrand for one dimension.

Target density

class noise.factor_integrand.SubstituteFactor(observationI, channelPhaseI, speechGaussianI, noiseGaussianI, constant=None)

One factor of the target density, as a function of the substitute variable. It takes speech and noise densities that are functions of the speech and the noise, respectively. The densities should be duck-typable to Gaussians:

  • They must have .mean and .covariance attributes, so that proposalForFactor can find a proposal function for this.
  • They must have an density or unnormalisedDensity function, so that the full target factor can be evaluated.

SubstituteFactorOneSource is an example.

Parameters:
  • observationI – observation.
  • channelPhaseI – phase factor.
  • speechGaussianI – speech density.
  • noiseGaussianI – noise density.
  • constant – constant for the density. If None, the speech and noise densities must have density functions, otherwise they must have unnormalisedDensity functions.
unnormalisedDensity(substitute)
Returns:the unnormalised density of this factor evaluated at

substitute.

class noise.factor_integrand.SubstituteFactorOneSource(sourceMean, precision, offset)

The factor of a factor of the integrand that is a function of one dimension of either the speech or the noise. It is an unnormalised Gaussian.

unnormalisedDensity(x)

Proposal distribution

noise.factor_integrand.proposalForFactor(factor)

Approximate a factor from the target distribution that is a function of one dimension of the substitute variable. The target factor consists of two Gaussians, each with a different soft cut-off. As detailed in the technical report (see Bibliography), the factor therefore has one of three distinct shapes. The proposal function therefore has one of three different forms.

Parameters:factor – the factor of the target distribution to approximate.
Returns:the proposal distribution. Either a Gaussian or a Mixture of Gaussians.
class noise.sample_observation_density.PhaseProposer(index)

For the phase factor dimensions, the target and proposal distributions are the same. When called, this class returns a PhaseFactorGaussian that does not depend on the partial sample

Parameters:index – the index of the mel-filter: the dimension in the feature vector.

To be used in conjunction with target factor DummyFactor , which returns and weighter oneWeighter.

class noise.sample_observation_density.AlwaysProposer(value)

Always proposes a fixed value.

class noise.sample_observation_density.DummyFactor
given(previous)
noise.sample_observation_density.oneWeighter(sample, localTarget, localProposal)
Returns:1.

Partial samples

class noise.factor_integrand.PartialSample(channelPhase = numpy.empty ((0, 1)), substitute = numpy.empty ((0, 1)))

Partial sample for approximating the integrand in the corrupted speech likelihood expression.

Parameters:
  • channelPhase – the phase factor dimensions drawn so far.
  • substitute – the dimensions of the substitute variable drawn so far.
noise.factor_integrand.appendChannelPhase(given, newSample)

Append one phase factor dimension to the partial sample.

Parameters:
  • given – current partial sample.
  • newSample – new dimension.
Returns:

a PartialSample with newSample appended.

noise.factor_integrand.appendSubstitute(given, newSample)

Append one substitute variable dimension to the partial sample.

Parameters:
  • given – current partial sample.
  • newSample – new dimension.
Returns:

a PartialSample with newSample appended.

Table Of Contents

Previous topic

Parametrised model compensation

Next topic

Noise environment

This Page