|
kaldi-native-fbank C++ API
Kaldi-compatible feature extraction C++ API
|
Stores the windowing coefficients and applies them to a frame. More...
#include <feature-window.h>
Public Member Functions | |
| FeatureWindowFunction ()=default | |
| Construct an empty window function. | |
| FeatureWindowFunction (const FrameExtractionOptions &opts) | |
| Construct the windowing function implied by opts.window_type, with a size of opts.WindowSize(). | |
| FeatureWindowFunction (const std::string &window_type, int32_t window_size, float blackman_coeff=0.42) | |
| Construct the windowing function of the given type and size. | |
| FeatureWindowFunction (const std::vector< float > &window) | |
| Construct from explicit window coefficients. | |
| void | Apply (float *wave) const |
| Apply the window to a frame, in place. | |
| const std::vector< float > & | GetWindow () const |
| Return the window coefficients. | |
Stores the windowing coefficients and applies them to a frame.
The window type is specified either by a FrameExtractionOptions, by a window-type name plus a window size, or directly by the coefficients.
|
default |
Construct an empty window function.
You must assign a real window to it before calling Apply().
|
explicit |
Construct the windowing function implied by opts.window_type, with a size of opts.WindowSize().
| knf::FeatureWindowFunction::FeatureWindowFunction | ( | const std::string & | window_type, |
| int32_t | window_size, | ||
| float | blackman_coeff = 0.42 ) |
Construct the windowing function of the given type and size.
See GetWindow() for the formula of each window type.
| window_type | One of "hamming", "rectangular", "povey", "hanning", "hann", "sine", "blackman". |
| window_size | Number of samples in the window. |
| blackman_coeff | Constant coefficient for generalized Blackman window; only used if window_type is "blackman". |
|
explicit |
Construct from explicit window coefficients.
| void knf::FeatureWindowFunction::Apply | ( | float * | wave | ) | const |
Apply the window to a frame, in place.
| wave | Pointer to a 1-D array of shape [window_size]. It is modified in-place: wave[i] = wave[i] * window_[i]. |
|
inline |
Return the window coefficients.