edu.cmu.sphinx.frontend.endpoint
Class SpeechClassifier

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

public class SpeechClassifier
extends BaseDataProcessor

Implements a level tracking endpointer invented by Bent Schmidt Nielsen.

This endpointer is composed of three main steps.

  1. classification of audio into speech and non-speech
  2. inserting SPEECH_START and SPEECH_END signals around speech
  3. removing non-speech regions

The first step, classification of audio into speech and non-speech, uses Bent Schmidt Nielsen's algorithm. Each time audio comes in, the average signal level and the background noise level are updated, using the signal level of the current audio. If the average signal level is greater than the background noise level by a certain threshold value (configurable), then the current audio is marked as speech. Otherwise, it is marked as non-speech.

The second and third step of this endpointer are documented in the classes SpeechMarker and NonSpeechDataFilter.

See Also:
SpeechMarker

Field Summary
static java.lang.String PROP_ADJUSTMENT
          The SphinxProperty specifying the adjustment.
static double PROP_ADJUSTMENT_DEFAULT
          The default value of PROP_ADJUSTMENT_DEFAULT.
static java.lang.String PROP_DEBUG
          The SphinxProperty specifying whether to print debug messages.
static boolean PROP_DEBUG_DEFAULT
          The default value of PROP_DEBUG.
static java.lang.String PROP_FRAME_LENGTH_MS
          The SphinxProperty specifying the endpointing frame length in milliseconds.
static int PROP_FRAME_LENGTH_MS_DEFAULT
          The default value of PROP_FRAME_LENGTH_MS.
static java.lang.String PROP_MIN_SIGNAL
          The SphinxProperty specifying the minimum signal level used to update the background signal level.
static double PROP_MIN_SIGNAL_DEFAULT
          The default value of PROP_MIN_SIGNAL.
static java.lang.String PROP_THRESHOLD
          The SphinxProperty specifying the threshold.
static double PROP_THRESHOLD_DEFAULT
          The default value of PROP_THRESHOLD.
 
Constructor Summary
SpeechClassifier()
           
 
Method Summary
 Data getData()
          Returns the next Data object.
 void inititalize()
          Initializes this LevelTracker endpointer and DataProcessor predecessor.
 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_FRAME_LENGTH_MS

public static final java.lang.String PROP_FRAME_LENGTH_MS
The SphinxProperty specifying the endpointing frame length in milliseconds.

See Also:
Constant Field Values

PROP_FRAME_LENGTH_MS_DEFAULT

public static final int PROP_FRAME_LENGTH_MS_DEFAULT
The default value of PROP_FRAME_LENGTH_MS.

See Also:
Constant Field Values

PROP_MIN_SIGNAL

public static final java.lang.String PROP_MIN_SIGNAL
The SphinxProperty specifying the minimum signal level used to update the background signal level.

See Also:
Constant Field Values

PROP_MIN_SIGNAL_DEFAULT

public static final double PROP_MIN_SIGNAL_DEFAULT
The default value of PROP_MIN_SIGNAL.

See Also:
Constant Field Values

PROP_THRESHOLD

public static final java.lang.String PROP_THRESHOLD
The SphinxProperty specifying the threshold. If the current signal level is greater than the background level by this threshold, then the current signal is marked as speech. Therefore, a lower threshold will make the endpointer more sensitive, that is, mark more audio as speech. A higher threshold will make the endpointer less sensitive, that is, mark less audio as speech.

See Also:
Constant Field Values

PROP_THRESHOLD_DEFAULT

public static final double PROP_THRESHOLD_DEFAULT
The default value of PROP_THRESHOLD.

See Also:
Constant Field Values

PROP_ADJUSTMENT

public static final java.lang.String PROP_ADJUSTMENT
The SphinxProperty specifying the adjustment.

See Also:
Constant Field Values

PROP_ADJUSTMENT_DEFAULT

public static final double PROP_ADJUSTMENT_DEFAULT
The default value of PROP_ADJUSTMENT_DEFAULT.

See Also:
Constant Field Values

PROP_DEBUG

public static final java.lang.String PROP_DEBUG
The SphinxProperty specifying whether to print debug messages.

See Also:
Constant Field Values

PROP_DEBUG_DEFAULT

public static final boolean PROP_DEBUG_DEFAULT
The default value of PROP_DEBUG.

See Also:
Constant Field Values
Constructor Detail

SpeechClassifier

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

inititalize

public void inititalize()
Initializes this LevelTracker endpointer and DataProcessor predecessor.


getData

public Data getData()
             throws DataProcessingException
Returns the next Data object.

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