edu.cmu.sphinx.frontend.frequencywarp
Class PLPFilter

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

public class PLPFilter
extends java.lang.Object

Defines a filter used by the PLPFrequencyFilterBank class. The filter is defined by a function in the Constructor. A set of equally spaced frequencies in a linear scale is passed to the constructor, which returns the weights for each of the frequency bins, such that the filter has the shape defined by this piecewise function in the bark scale.

Version:
1.0
Author:
rsingh
See Also:
PLPFrequencyFilterBank

Field Summary
 double centerFreqInBark
          The center frequency of the filter in Bark.
 double centerFreqInHz
          The center frequency of the filter in Hertz.
 
Constructor Summary
PLPFilter(double[] DFTFrequenciesInHz, double centerFreqInHz)
          Constructs a PLP filter around a given center frequency.
 
Method Summary
 double filterOutput(double[] spectrum)
          Compute the PLP spectrum at the center frequency of this filter for a given power spectrum.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

centerFreqInHz

public double centerFreqInHz
The center frequency of the filter in Hertz.


centerFreqInBark

public double centerFreqInBark
The center frequency of the filter in Bark.

Constructor Detail

PLPFilter

public PLPFilter(double[] DFTFrequenciesInHz,
                 double centerFreqInHz)
          throws java.lang.IllegalArgumentException
Constructs a PLP filter around a given center frequency. Defines a filter according to the following equation, defined piecewise (all frequencies in the equation are Bark frequencies):
 Filter(f) = 0 if f < -2.5 
= 10^(-(f+0.5)) if -2.5 <= f <= -0.5
= 1 if -0.5 <= f <= 0.5
= 10^(2.5(f-0.5)) if 0.5 <= f <= 1.3
= 0 if f > 1.3
The current implementation assumes that the calling routine passes in an array of frequencies, one for each of the DFT points in the spectrum of the frame of speech to be filtered. This is used in conjunction with a specified center frequency to determine the filter.

Parameters:
DFTFrequenciesInHz - is a double array containing the frequencies in Hertz corresponding to each of the DFT points in the spectrum of the signal to be filtered.
centerFreqInHz - is the filter's center frequency
Throws:
java.lang.IllegalArgumentException
Method Detail

filterOutput

public double filterOutput(double[] spectrum)
                    throws java.lang.IllegalArgumentException
Compute the PLP spectrum at the center frequency of this filter for a given power spectrum.

Parameters:
spectrum - the input power spectrum to be filtered
Returns:
the PLP spectrum value
Throws:
java.lang.IllegalArgumentException - if the input spectrum is of a different length than the array of filter coefficients