edu.cmu.sphinx.frontend.feature
Class LiveCMN

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

public class LiveCMN
extends BaseDataProcessor

Subtracts the mean of all the input so far from the Data objects. Unlike the BatchCMN, it does not read in the entire stream of Data objects before it calculates the mean. It estimates the mean from already seen data and subtracts the mean from the Data objects on the fly. Therefore, there is no delay introduced by LiveCMN. The Sphinx properties that affect this processor are defined by the fields PROP_INITIAL_MEAN, PROP_CMN_WINDOW, and PROP_CMN_SHIFT_WINDOW. Please follow the link "Constant Field Values" below to see the actual name of the Sphinx properties.

The mean of all the input cepstrum so far is not reestimated for each cepstrum. This mean is recalculated after every PROP_CMN_SHIFT_WINDOW cepstra. This mean is estimated by dividing the sum of all input cepstrum so far. After obtaining the mean, the sum is exponentially decayed by multiplying it by the ratio:

 cmnWindow/(cmnWindow + number of frames since the last recalculation)
 

This is a 1-to-1 processor.

See Also:
BatchCMN

Field Summary
static java.lang.String PROP_CMN_SHIFT_WINDOW
          The name of the SphinxProperty for the CMN shifting window.
static int PROP_CMN_SHIFT_WINDOW_DEFAULT
          The default value of PROP_CMN_SHIFT_WINDOW.
static java.lang.String PROP_CMN_WINDOW
          The name of the SphinxProperty for the live CMN window size.
static int PROP_CMN_WINDOW_DEFAULT
          The default value for PROP_CMN_WINDOW.
static java.lang.String PROP_INITIAL_MEAN
          The name of the SphinxProperty for the initial cepstral mean.
static float PROP_INITIAL_MEAN_DEFAULT
          The default value for PROP_INITIAL_MEAN.
 
Constructor Summary
LiveCMN()
           
 
Method Summary
 Data getData()
          Returns the next Data object, which is a normalized Data produced by this class.
 void initialize()
          Initializes this LiveCMN.
 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_INITIAL_MEAN

public static final java.lang.String PROP_INITIAL_MEAN
The name of the SphinxProperty for the initial cepstral mean. This is a front-end dependent magic number.

See Also:
Constant Field Values

PROP_INITIAL_MEAN_DEFAULT

public static final float PROP_INITIAL_MEAN_DEFAULT
The default value for PROP_INITIAL_MEAN.

See Also:
Constant Field Values

PROP_CMN_WINDOW

public static final java.lang.String PROP_CMN_WINDOW
The name of the SphinxProperty for the live CMN window size.

See Also:
Constant Field Values

PROP_CMN_WINDOW_DEFAULT

public static final int PROP_CMN_WINDOW_DEFAULT
The default value for PROP_CMN_WINDOW.

See Also:
Constant Field Values

PROP_CMN_SHIFT_WINDOW

public static final java.lang.String PROP_CMN_SHIFT_WINDOW
The name of the SphinxProperty for the CMN shifting window. The shifting window specifies how many cepstrum after which we re-calculate the cepstral mean.

See Also:
Constant Field Values

PROP_CMN_SHIFT_WINDOW_DEFAULT

public static final int PROP_CMN_SHIFT_WINDOW_DEFAULT
The default value of PROP_CMN_SHIFT_WINDOW.

See Also:
Constant Field Values
Constructor Detail

LiveCMN

public LiveCMN()
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()
Initializes this LiveCMN.

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

getData

public Data getData()
             throws DataProcessingException
Returns the next Data object, which is a normalized Data produced by this class. Signals are returned unmodified.

Specified by:
getData in interface DataProcessor
Specified by:
getData in class BaseDataProcessor
Returns:
the next available Data object, returns null if no Data object is available
Throws:
DataProcessingException - if there is a data processing error