|
|||||||||
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
public class 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
. 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 !). 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 is the value for the RaisedCosineWindow. |
static java.lang.String |
PROP_WINDOW_SHIFT_MS
The SphinxProperty name for window shift in milliseconds, which has a default value of 10F. |
static java.lang.String |
PROP_WINDOW_SIZE_MS
The SphinxProperty name for window size in milliseconds. |
static java.lang.String |
WINDOW_SHIFT_SAMPLES
|
static java.lang.String |
WINDOW_SIZE_SAMPLES
|
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. |
int |
getSampleRate()
|
float |
getWindowShiftInMs()
Returns the shift size used to window the incoming speech signal. |
void |
initialize()
Initializes this DataProcessor. |
void |
newProperties(PropertySheet ps)
This method is called when this configurable component needs to be reconfigured. |
long |
roundToFrames(long samples)
Rounds a given sample-number to the number of samples will be processed by this instance including the padding samples at the end.. |
Methods inherited from class edu.cmu.sphinx.frontend.BaseDataProcessor |
---|
getPredecessor, getTimer, setPredecessor, toString |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
@S4Double(defaultValue=25.625) public static final java.lang.String PROP_WINDOW_SIZE_MS
@S4Double(defaultValue=10.0) public static final java.lang.String PROP_WINDOW_SHIFT_MS
@S4Double(defaultValue=0.46) public static final java.lang.String PROP_ALPHA
public static final java.lang.String WINDOW_SHIFT_SAMPLES
public static final java.lang.String WINDOW_SIZE_SAMPLES
Constructor Detail |
---|
public RaisedCosineWindower()
Method Detail |
---|
public void newProperties(PropertySheet ps) throws PropertyException
Configurable
newProperties
in interface Configurable
newProperties
in class BaseDataProcessor
ps
- a property sheet holding the new data
PropertyException
- if there is a problem with the properties.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
public float getWindowShiftInMs()
public int getSampleRate()
public long roundToFrames(long samples)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |