edu.cmu.sphinx.frontend.util
Class Dither

java.lang.Object
  extended by edu.cmu.sphinx.util.props.ConfigurableAdapter
      extended by edu.cmu.sphinx.frontend.BaseDataProcessor
          extended by edu.cmu.sphinx.frontend.util.Dither
All Implemented Interfaces:
DataProcessor, Configurable

public class Dither
extends BaseDataProcessor

Adds a uniformly distribued dithering to a signal.


Field Summary
static java.lang.String PROP_MAX_DITHER
          The maximal value which could be added/substracted to/from the signal
static java.lang.String PROP_MAX_VAL
          The maximal value of dithered values.
static java.lang.String PROP_MIN_VAL
          The minimal value of dithered values.
static java.lang.String PROP_USE_RANDSEED
          The name of the sphinx property about using random seed or not
 
Constructor Summary
Dither()
           
Dither(double ditherMax, boolean useRandSeed, double maxValue, double minValue)
           
 
Method Summary
 Data getData()
          Returns the next DoubleData object, which is a dithered version of the input
 void initialize()
          Initializes this DataProcessor.
 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, setPredecessor
 
Methods inherited from class edu.cmu.sphinx.util.props.ConfigurableAdapter
getName, toString
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

PROP_MAX_DITHER

@S4Double(defaultValue=0.0)
public static final java.lang.String PROP_MAX_DITHER
The maximal value which could be added/substracted to/from the signal

See Also:
Constant Field Values

PROP_MAX_VAL

@S4Double(defaultValue=1.7976931348623157E308)
public static final java.lang.String PROP_MAX_VAL
The maximal value of dithered values.

See Also:
Constant Field Values

PROP_MIN_VAL

@S4Double(defaultValue=-1.7976931348623157E308)
public static final java.lang.String PROP_MIN_VAL
The minimal value of dithered values.

See Also:
Constant Field Values

PROP_USE_RANDSEED

@S4Boolean(defaultValue=false)
public static final java.lang.String PROP_USE_RANDSEED
The name of the sphinx property about using random seed or not

See Also:
Constant Field Values
Constructor Detail

Dither

public Dither(double ditherMax,
              boolean useRandSeed,
              double maxValue,
              double minValue)

Dither

public Dither()
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 ConfigurableAdapter
Parameters:
ps - a property sheet holding the new data
Throws:
PropertyException - if there is a problem with the properties.

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 a dithered version of the input

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