edu.cmu.sphinx.frontend.filter
Class Preemphasizer

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

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 needs to be reconfigured.
 
Methods inherited from class edu.cmu.sphinx.frontend.BaseDataProcessor
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

@S4Double(defaultValue=0.97)
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

newProperties

public void newProperties(PropertySheet ps)
                   throws PropertyException
Description copied from interface: Configurable
This method is called when this configurable component needs to be reconfigured.

Specified by:
newProperties in interface Configurable
Overrides:
newProperties in class BaseDataProcessor
Parameters:
ps - a property sheet holding the new data
Throws:
PropertyException - if there is a problem with the properties.

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