|
kaldi-native-fbank C++ API
Kaldi-compatible feature extraction C++ API
|
Kaldi-compatible feature extraction. Headers live in kaldi-native-fbank/csrc/. All computations match kaldi numerically (kaldi uses float/double matrices; this library uses row-major Eigen typedefs MatrixF / MatrixD / VectorF from feature-matrix.h).
knf::OnlineCmvn is a port of kaldi's OnlineCmvn (kaldi/src/feat/online-feature.h): cepstral mean (and optional variance) normalization computed only from the past, for streaming use. Unlike the offline CMVN of feature-cmvn.h (whole-utterance stats), it accumulates a sliding window of the previous cmn_window frames (default 600) and normalizes the current frame with them; at the start of an utterance the window is backed off with speaker_frames frames of speaker stats (from previous utterances, see knf::OnlineCmvnState) and global_frames frames of global stats.
The class is push-style: AcceptFeature(frame) returns the normalized frame. Freeze() fixes the normalization (stats stop updating), and GetState() carries the speaker adaptation (and any frozen normalization) to the next utterance of the same speaker.
Options, formulas and the correspondence with kaldi are documented on the struct/class pages (knf::OnlineCmvnOptions, knf::OnlineCmvnState, knf::OnlineCmvn) and in docs/source/python-api/online-cmvn.rst. Parity with kaldi's apply-cmvn-online is tested in tests/parity/parity_online_cmvn.py.
See also the Python API documentation.