|
kaldi-native-fbank C++ API
Kaldi-compatible feature extraction C++ API
|
Options for extracting frames from a waveform. More...
#include <feature-window.h>
Public Member Functions | |
| int32_t | WindowShift () const |
| Return the window shift in samples. | |
| int32_t | WindowSize () const |
| Return the window size in samples. | |
| int32_t | PaddedWindowSize () const |
| Return the window size after zero-padding to a power of two, if round_to_power_of_two is true; otherwise the same as WindowSize(). | |
| std::string | ToString () const |
| Return the options as a string. | |
Public Attributes | |
| float | samp_freq = 16000 |
| Waveform data sample frequency (must match the waveform file, if specified there). | |
| float | frame_shift_ms = 10.0f |
| Frame shift in milliseconds. | |
| float | frame_length_ms = 25.0f |
| Frame length in milliseconds. | |
| float | dither = 0.00003f |
| Amount of dithering, 0.0 means no dither. | |
| float | preemph_coeff = 0.97f |
| Preemphasis coefficient. | |
| bool | remove_dc_offset = true |
| Subtract mean of wave before FFT. | |
| std::string | window_type = "povey" |
| Type of the windowing function; may be "hamming", "rectangular", "povey", "hanning", "hann", "sine", or "blackman". | |
| bool | round_to_power_of_two = true |
| If true, round the window size to a power of two by zero-padding the input to the FFT. | |
| float | blackman_coeff = 0.42f |
| Constant coefficient for the generalized Blackman window. | |
| bool | snip_edges = true |
| If true, end effects are handled by outputting only frames that completely fit in the file, and the number of frames depends on the frame length. | |
Options for extracting frames from a waveform.
This struct is the equivalent of kaldi's FrameExtractionOptions (src/feat/feature-window.h).
|
inline |
Return the window size after zero-padding to a power of two, if round_to_power_of_two is true; otherwise the same as WindowSize().
|
inline |
Return the options as a string.
|
inline |
Return the window shift in samples.
|
inline |
Return the window size in samples.
| float knf::FrameExtractionOptions::blackman_coeff = 0.42f |
Constant coefficient for the generalized Blackman window.
| float knf::FrameExtractionOptions::dither = 0.00003f |
Amount of dithering, 0.0 means no dither.
Note: the default value 0.00003f here is equivalent to 1.0 in kaldi. If you turn this off, you should set the energy floor option, e.g. to 1.0 or 0.1.
| float knf::FrameExtractionOptions::frame_length_ms = 25.0f |
Frame length in milliseconds.
| float knf::FrameExtractionOptions::frame_shift_ms = 10.0f |
Frame shift in milliseconds.
| float knf::FrameExtractionOptions::preemph_coeff = 0.97f |
Preemphasis coefficient.
| bool knf::FrameExtractionOptions::remove_dc_offset = true |
Subtract mean of wave before FFT.
| bool knf::FrameExtractionOptions::round_to_power_of_two = true |
If true, round the window size to a power of two by zero-padding the input to the FFT.
| float knf::FrameExtractionOptions::samp_freq = 16000 |
Waveform data sample frequency (must match the waveform file, if specified there).
| bool knf::FrameExtractionOptions::snip_edges = true |
If true, end effects are handled by outputting only frames that completely fit in the file, and the number of frames depends on the frame length.
If false, the number of frames depends only on the frame shift, and we reflect the data at the ends.
| std::string knf::FrameExtractionOptions::window_type = "povey" |
Type of the windowing function; may be "hamming", "rectangular", "povey", "hanning", "hann", "sine", or "blackman".
"povey" is a window made to be similar to Hamming but to go to zero at the edges: \( w[n] = (0.5 - 0.5 \cos(2\pi n/(N-1)))^{0.85} \).