|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectedu.cmu.sphinx.frontend.BaseDataProcessor
edu.cmu.sphinx.frontend.window.RaisedCosineWindower
Slices up a Data object into a number of overlapping windows (usually refered to as "frames" in the speech world). In order to minimize the signal discontinuities at the boundaries of each frame, we multiply each frame with a raised cosine windowing function. Moreover, the system uses overlapping windows to capture information that may occur at the window boundaries. These events would not be well represented if the windows were juxtaposed.
The number of resulting windows depends on the window size
and the window shift
(commonly known as frame shift
in speech world). Figure 1 shows the relationship between the
original data stream, the window size, the window shift, and the
windows returned.
Figure 1: Relationship
between original data, window size, window shift, and the windows
returned.
The raised cosine windowing function will be applied to each such
window. Since the getData()
method returns a
window, and multiple windows are created for each Data object, this
is a 1-to-many processor. Also note that the returned windows
should have the same number of data points as the windowing
function.
The applied windowing function, W(n), of length N (the window size), is given by the following formula:
W(n) = (1-a) - (a * cos((2 * Math.PI * n)/(N - 1)))where a is commonly known as the "alpha" value. This variable can be set by the user using the property defined by
PROP_ALPHA
, which has a default value of PROP_ALPHA_DEFAULT
. Please follow the links to the see the
constant field values.
Some values of alpha receive special names, since they are used so
often. A value of 0.46 for the alpha results in a window named
Hamming window. A value of 0.5 results in the Hanning window. And a
value of 0 results in the Rectangular window. The default for this
system is the Hamming window, with alpha 0.46 (but check the value
in PROP_ALPHA_DEFAULT
!). Figure 2 below shows the Hamming
window function (a = 0.46), using our default window size of 25.625
ms and assuming a sample rate of 16kHz, thus yielding 410 samples
per window.
Figure 2: The
Hamming window function.
Data
Field Summary | |
static java.lang.String |
PROP_ALPHA
The name of the SphinxProperty for the alpha value of the Window, which has a default value of 0.46 (double), which is the value for the RaisedCosineWindow. |
static double |
PROP_ALPHA_DEFAULT
The default value for PROP_ALPHA. |
static java.lang.String |
PROP_WINDOW_SHIFT_MS
The SphinxProperty name for window shift in milliseconds, which has a default value of 10F. |
static float |
PROP_WINDOW_SHIFT_MS_DEFAULT
The default value for PROP_WINDOW_SHIFT_MS. |
static java.lang.String |
PROP_WINDOW_SIZE_MS
The SphinxProperty name for window size in milliseconds. |
static float |
PROP_WINDOW_SIZE_MS_DEFAULT
The default value for PROP_WINDOW_SIZE_MS. |
Constructor Summary | |
RaisedCosineWindower()
|
Method Summary | |
Data |
getData()
Returns the next Data object, which is usually a window of the input Data, with the windowing function applied to it. |
void |
initialize()
Initializes this DataProcessor. |
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 |
public static final java.lang.String PROP_WINDOW_SIZE_MS
public static final float PROP_WINDOW_SIZE_MS_DEFAULT
public static final java.lang.String PROP_WINDOW_SHIFT_MS
public static final float PROP_WINDOW_SHIFT_MS_DEFAULT
public static final java.lang.String PROP_ALPHA
public static final double PROP_ALPHA_DEFAULT
Constructor Detail |
public RaisedCosineWindower()
Method Detail |
public void register(java.lang.String name, Registry registry) throws PropertyException
Configurable
register
in interface Configurable
register
in class BaseDataProcessor
PropertyException
public void newProperties(PropertySheet ps) throws PropertyException
Configurable
newProperties
in interface Configurable
newProperties
in class BaseDataProcessor
PropertyException
public void initialize()
BaseDataProcessor
initialize
in interface DataProcessor
initialize
in class BaseDataProcessor
public Data getData() throws DataProcessingException
getData
in interface DataProcessor
getData
in class BaseDataProcessor
DataProcessingException
- if a data processing error occurredData
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |