edu.cmu.sphinx.frontend.frequencywarp
Class LinearPredictor

java.lang.Object
  extended byedu.cmu.sphinx.frontend.frequencywarp.LinearPredictor

public class LinearPredictor
extends java.lang.Object

Computes the linear predictive model using the Levinson-Durbin algorithm. Linear prediction assumes that a signal can be model as a linear combination of previous samples, that is, the current sample x[i] can be modeled as:

 x[i] = a[0] + a[1] * x[i - 1] + a[2] * x[i - 2] + ... 
The summation on the right hand side of the equation involves a finite number of terms. The number of previous samples used is the order of the linear prediction. This class also provides a method to compute LPC cepstra, that is, the cepstra computed from LPC coefficients, as well as a method to compute the bilinear transformation of the LPC


Constructor Summary
LinearPredictor(int order)
          Constructs a LinearPredictor with the given order.
 
Method Summary
 double[] getARFilter(double[] autocor)
          Routine to compute Linear Prediction Coefficients for a frame of speech.
 double[] getBilinearCepstra(double warp, int nbilincepstra)
          Computes a bi-linear frequency warped version of the LPC cepstrum from the LPC cepstrum.
 double[] getData(int ceporder)
          Computes LPC Cepstra from the AR predictor parameters and alpha using a recursion invented by Oppenheim et al.
 double[] reflectionCoeffsToARParameters(double[] RC, int lpcorder)
          Computes AR parameters from a given set of reflection coefficients.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

LinearPredictor

public LinearPredictor(int order)
Constructs a LinearPredictor with the given order.

Parameters:
order - the order of the LinearPredictor
Method Detail

getARFilter

public double[] getARFilter(double[] autocor)
Routine to compute Linear Prediction Coefficients for a frame of speech. Returns the energy of the frame (alpha in the Levinson recursion) Assumes the following sign convention:
prediction(x[t]) = Sum_i {Ar[i] * x[t-i]}

Parameters:
autocor -

reflectionCoeffsToARParameters

public double[] reflectionCoeffsToARParameters(double[] RC,
                                               int lpcorder)
Computes AR parameters from a given set of reflection coefficients.

Parameters:
RC - double array of reflection coefficients. The RC array must begin at 1 (RC[0] is a dummy value)
lpcorder - AR order desired
Returns:
AR parameters

getData

public double[] getData(int ceporder)
Computes LPC Cepstra from the AR predictor parameters and alpha using a recursion invented by Oppenheim et al. The literature shows the optimal value of cepstral order to be:
0.75 * LPCorder <= ceporder <= 1.25 * LPCorder

Parameters:
ceporder - is the order of the LPC cepstral vector to be computed.
Returns:
LPC cepstra

getBilinearCepstra

public double[] getBilinearCepstra(double warp,
                                   int nbilincepstra)
Computes a bi-linear frequency warped version of the LPC cepstrum from the LPC cepstrum. The recursive algorithm used is defined in Oppenheim's paper in Proceedings of IEEE, June 1972 The program has been written using g[x,y] = g_o[x,-y] where g_o is the array used by Oppenheim. To handle the reversed array index the recursion has been done DOWN the array index.

Parameters:
warp - is the warping coefficient. For 16KHz speech 0.6 is good valued.
nbilincepstra - is the number of bilinear cepstral values to be computed from the linear frequency cepstrum.
Returns:
a bi-linear frequency warped version of the LPC cepstrum