kaldi-native-fbank C++ API
Kaldi-compatible feature extraction C++ API
Loading...
Searching...
No Matches
knf::OnlineCmvnOptions Struct Reference

Options for OnlineCmvn, mirroring kaldi's OnlineCmvnOptions (kaldi/src/feat/online-feature.h). More...

#include <online-cmvn.h>

Public Member Functions

std::string ToString () const
 Return the options as a string.

Public Attributes

int32_t cmn_window = 600
 Number of frames of sliding context for cepstral mean normalization (kaldi: –cmn-window).
int32_t speaker_frames = 600
 Number of frames of previous utterance(s) from this speaker to back off to at the beginning of an utterance (kaldi: –speaker-frames).
int32_t global_frames = 200
 Number of frames of global-average stats to back off to further, when even the speaker stats cannot fill the window (kaldi: –global-frames).
bool normalize_mean = true
 If true (default), subtract the running mean.
bool normalize_variance = false
 If true, also divide by the running standard deviation (kaldi: –norm-vars).
int32_t modulus = 20
 How often kaldi snapshots stats internally (every modulus frames).
int32_t ring_buffer_size = 20
 Size of kaldi's ring buffer for cached stats snapshots.
std::string skip_dims
 Colon-separated list of dimensions to skip normalization of, e.g.

Detailed Description

Options for OnlineCmvn, mirroring kaldi's OnlineCmvnOptions (kaldi/src/feat/online-feature.h).

The defaults match kaldi's.

The options control two things: the sliding window of the running statistics, and how the sparse stats at the start of an utterance are backed off ("smoothed") with speaker and global stats. See OnlineCmvn::SmoothOnlineCmvnStats for the smoothing formulas.

Member Function Documentation

◆ ToString()

std::string knf::OnlineCmvnOptions::ToString ( ) const

Return the options as a string.

Member Data Documentation

◆ cmn_window

int32_t knf::OnlineCmvnOptions::cmn_window = 600

Number of frames of sliding context for cepstral mean normalization (kaldi: –cmn-window).

In the steady state the normalization of frame t uses the stats of frames t-cmn_window+1 .. t.

◆ global_frames

int32_t knf::OnlineCmvnOptions::global_frames = 200

Number of frames of global-average stats to back off to further, when even the speaker stats cannot fill the window (kaldi: –global-frames).

◆ modulus

int32_t knf::OnlineCmvnOptions::modulus = 20

How often kaldi snapshots stats internally (every modulus frames).

Kept for configuration compatibility; this push-style port updates the stats incrementally, so the value does not affect results.

◆ normalize_mean

bool knf::OnlineCmvnOptions::normalize_mean = true

If true (default), subtract the running mean.

Must be true when normalize_variance is true (kaldi: –norm-means).

◆ normalize_variance

bool knf::OnlineCmvnOptions::normalize_variance = false

If true, also divide by the running standard deviation (kaldi: –norm-vars).

Off by default; enable only if the features were trained with variance normalization.

◆ ring_buffer_size

int32_t knf::OnlineCmvnOptions::ring_buffer_size = 20

Size of kaldi's ring buffer for cached stats snapshots.

Kept for configuration compatibility (see modulus); must be >= modulus.

◆ skip_dims

std::string knf::OnlineCmvnOptions::skip_dims

Colon-separated list of dimensions to skip normalization of, e.g.

"13:14:15" (kaldi: –skip-dims). For skipped dims the stats are faked to mean 0 / variance 1, so the frame values pass through unchanged.

◆ speaker_frames

int32_t knf::OnlineCmvnOptions::speaker_frames = 600

Number of frames of previous utterance(s) from this speaker to back off to at the beginning of an utterance (kaldi: –speaker-frames).

Should be <= cmn_window; values above it are clamped at use time.


The documentation for this struct was generated from the following file:
  • /home/runner/work/kaldi-native-fbank/kaldi-native-fbank/kaldi-native-fbank/csrc/online-cmvn.h