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

Options for constructing triangular mel-filterbank bins. More...

#include <mel-computations.h>

Public Member Functions

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

Public Attributes

int32_t num_bins = 25
 Number of triangular mel-frequency bins, e.g. 25.
float low_freq = 20
 Lower frequency cutoff, e.g. 20.
float high_freq = 0
 Upper frequency cutoff; 0 means no cutoff, negative values are added to the Nyquist frequency to get the cutoff.
float vtln_low = 100
 VTLN lower cutoff of the warping function.
float vtln_high = -500
 VTLN upper cutoff of the warping function: if negative, added to the Nyquist frequency to get the cutoff.
bool debug_mel = false
 Print out debugging information for mel bin computation.
bool htk_mode = false
 htk_mode is a "hidden" config.
bool is_librosa = false
 If true, use librosa-style mel filters instead of kaldi-style ones.
std::string norm = "slaney"
 Used only when is_librosa is true.
bool use_slaney_mel_scale = true
 Used only when is_librosa is true: use the Slaney mel scale.
bool floor_to_int_bin = false
 Used only when is_librosa is true: floor the bin edges to integers.

Detailed Description

Options for constructing triangular mel-filterbank bins.

The kaldi-compatible fields correspond to kaldi's MelBanksOptions (src/feat/mel-computations.h); the is_librosa-related fields select librosa-compatible filters instead.

Used by:
The mel_opts member of FbankOptions and MfccOptions, and the constructors of MelBanks.
See also
MelBanks, FbankOptions, MfccOptions

Member Function Documentation

◆ ToString()

std::string knf::MelBanksOptions::ToString ( ) const
inline

Return the options as a string.

Member Data Documentation

◆ debug_mel

bool knf::MelBanksOptions::debug_mel = false

Print out debugging information for mel bin computation.

◆ floor_to_int_bin

bool knf::MelBanksOptions::floor_to_int_bin = false

Used only when is_librosa is true: floor the bin edges to integers.

◆ high_freq

float knf::MelBanksOptions::high_freq = 0

Upper frequency cutoff; 0 means no cutoff, negative values are added to the Nyquist frequency to get the cutoff.

◆ htk_mode

bool knf::MelBanksOptions::htk_mode = false

htk_mode is a "hidden" config.

It enables more exact compatibility with HTK, for testing purposes. Affects mel-energy flooring and reproduces a bug in HTK.

◆ is_librosa

bool knf::MelBanksOptions::is_librosa = false

If true, use librosa-style mel filters instead of kaldi-style ones.

Note that if you set is_librosa, you probably need to set low_freq to 0. See https://librosa.org/doc/main/generated/librosa.filters.mel.html

◆ low_freq

float knf::MelBanksOptions::low_freq = 20

Lower frequency cutoff, e.g. 20.

◆ norm

std::string knf::MelBanksOptions::norm = "slaney"

Used only when is_librosa is true.

Possible values: "", "slaney". We don't support a numeric value here, but it can be added on demand. See https://librosa.org/doc/main/generated/librosa.filters.mel.html

◆ num_bins

int32_t knf::MelBanksOptions::num_bins = 25

Number of triangular mel-frequency bins, e.g. 25.

◆ use_slaney_mel_scale

bool knf::MelBanksOptions::use_slaney_mel_scale = true

Used only when is_librosa is true: use the Slaney mel scale.

◆ vtln_high

float knf::MelBanksOptions::vtln_high = -500

VTLN upper cutoff of the warping function: if negative, added to the Nyquist frequency to get the cutoff.

◆ vtln_low

float knf::MelBanksOptions::vtln_low = 100

VTLN lower cutoff of the warping function.


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