edu.cmu.sphinx.frontend.filter
Class Preemphasizer

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

public class Preemphasizer
extends BaseDataProcessor

Implements a high-pass filter that compensates for attenuation in the audio data. Speech signals have an attenuation (a decrease in intensity of a signal) of 20 dB/dec. It increases the relative magnitude of the higher frequencies with respect to the lower frequencies. The Preemphasizer takes a Dataobject that usually represents audio data as input, and outputs the same Dataobject, but with preemphasis applied. For each value X[i] in the input Data object X, the following formula is applied to obtain the output Data object Y:

Y[i] = X[i] - (X[i-1] * preemphasisFactor)

where 'i' denotes time.

The preemphasis factor has a value defined by the field PROP_PREEMPHASIS_FACTOR, with default defined by PROP_PREEMPHASIS_FACTOR_DEFAULT. A common value for this factor is something around 0.97.

Other Dataobjects are passed along unchanged through this Preemphasizer.

The Preemphasizer emphasizes the high frequency components, because they usually contain much less energy than lower frequency components, even though they are still important for speech recognition. It is a high-pass filter because it allows the high frequency components to "pass through", while weakening or filtering out the low frequency components.


Field Summary
static java.lang.String PROP_PREEMPHASIS_FACTOR
          The name of the SphinxProperty for preemphasis factor/alpha.
static double PROP_PREEMPHASIS_FACTOR_DEFAULT
          The default value of PROP_PREEMPHASIS_FACTOR.
 
Constructor Summary
Preemphasizer()
           
 
Method Summary
 Data getData()
          Returns the next Data object being processed by this Preemphasizer, or if it is a Signal, it is returned without modification.
 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, initialize, setPredecessor, toString
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

PROP_PREEMPHASIS_FACTOR

public static final java.lang.String PROP_PREEMPHASIS_FACTOR
The name of the SphinxProperty for preemphasis factor/alpha.

See Also:
Constant Field Values

PROP_PREEMPHASIS_FACTOR_DEFAULT

public static final double PROP_PREEMPHASIS_FACTOR_DEFAULT
The default value of PROP_PREEMPHASIS_FACTOR.

See Also:
Constant Field Values
Constructor Detail

Preemphasizer

public Preemphasizer()
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

getData

public Data getData()
             throws DataProcessingException
Returns the next Data object being processed by this Preemphasizer, or if it is a Signal, it is returned without modification.

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 processing error
See Also:
Data