edu.cmu.sphinx.frontend.transform
Class DiscreteCosineTransform

java.lang.Object
  extended byedu.cmu.sphinx.frontend.BaseDataProcessor
      extended byedu.cmu.sphinx.frontend.transform.DiscreteCosineTransform
All Implemented Interfaces:
Configurable, DataProcessor

public class DiscreteCosineTransform
extends BaseDataProcessor

Applies a logarithm and then a Discrete Cosine Transform (DCT) to the input data. The input data is normally the mel spectrum. It has been proven that, for a sequence of real numbers, the discrete cosine transform is equivalent to the discrete Fourier transform. Therefore, this class corresponds to the last stage of converting a signal to cepstra, defined as the inverse Fourier transform of the logarithm of the Fourier transform of a signal. The property PROP_CEPSTRUM_LENGTHrefers to the dimensionality of the coefficients that are actually returned, defaulting to PROP_CEPSTRUM_LENGTH_DEFAULT. When the input is mel-spectrum, the vector returned is the MFCC (Mel-Frequency Cepstral Coefficient) vector, where the 0-th element is the energy value.


Field Summary
static java.lang.String PROP_CEPSTRUM_LENGTH
          The name of the sphinx property for the size of the ceptrum
static int PROP_CEPSTRUM_LENGTH_DEFAULT
          The default value for PROP_CEPSTRUM_LENGTH
static java.lang.String PROP_NUMBER_FILTERS
          The name of the Sphinx Property for the number of filters in the filterbank.
static int PROP_NUMBER_FILTERS_DEFAULT
          The default value for PROP_NUMBER_FILTERS.
 
Constructor Summary
DiscreteCosineTransform()
           
 
Method Summary
 Data getData()
          Returns the next DoubleData object, which is the mel cepstrum of the input frame.
 void initialize()
          Initializes this DataProcessor.
 void newProperties(PropertySheet ps)
          This method is called when this configurable component has new data.
 void register(java.lang.String name, Registry registry)
          Register my properties.
 
Methods inherited from class edu.cmu.sphinx.frontend.BaseDataProcessor
getName, getPredecessor, getTimer, setPredecessor, toString
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

PROP_NUMBER_FILTERS

public static final java.lang.String PROP_NUMBER_FILTERS
The name of the Sphinx Property for the number of filters in the filterbank.

See Also:
Constant Field Values

PROP_NUMBER_FILTERS_DEFAULT

public static final int PROP_NUMBER_FILTERS_DEFAULT
The default value for PROP_NUMBER_FILTERS.

See Also:
Constant Field Values

PROP_CEPSTRUM_LENGTH

public static final java.lang.String PROP_CEPSTRUM_LENGTH
The name of the sphinx property for the size of the ceptrum

See Also:
Constant Field Values

PROP_CEPSTRUM_LENGTH_DEFAULT

public static final int PROP_CEPSTRUM_LENGTH_DEFAULT
The default value for PROP_CEPSTRUM_LENGTH

See Also:
Constant Field Values
Constructor Detail

DiscreteCosineTransform

public DiscreteCosineTransform()
Method Detail

register

public void register(java.lang.String name,
                     Registry registry)
              throws PropertyException
Description copied from interface: Configurable
Register my properties. This method is called once early in the time of the component, shortly after the component is constructed. This component should register any configuration properties that it needs to register. If this configurable extends another configurable, super.register should also be called

Specified by:
register in interface Configurable
Overrides:
register in class BaseDataProcessor
Throws:
PropertyException

newProperties

public void newProperties(PropertySheet ps)
                   throws PropertyException
Description copied from interface: Configurable
This method is called when this configurable component has new data. The component should first validate the data. If it is bad the component should return false. If the data is good, the component should record the the data internally and return true.

Specified by:
newProperties in interface Configurable
Overrides:
newProperties in class BaseDataProcessor
Throws:
PropertyException

initialize

public void initialize()
Description copied from class: BaseDataProcessor
Initializes this DataProcessor. This is typically called after the DataProcessor has been configured.

Specified by:
initialize in interface DataProcessor
Overrides:
initialize in class BaseDataProcessor

getData

public Data getData()
             throws DataProcessingException
Returns the next DoubleData object, which is the mel cepstrum of the input frame. Signals are returned unmodified.

Specified by:
getData in interface DataProcessor
Specified by:
getData in class BaseDataProcessor
Returns:
the next available DoubleData melcepstrum, or Signal object, or null if no Data is available
Throws:
DataProcessingException - if a data processing error occurred