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

Options for computing filter-bank features. More...

#include <feature-fbank.h>

Collaboration diagram for knf::FbankOptions:

Public Member Functions

 FbankOptions ()
 Construct with the default options: 23 mel bins.
std::string ToString () const
 Return the options as a string.

Public Attributes

FrameExtractionOptions frame_opts
 Options for frame extraction; see FrameExtractionOptions.
MelBanksOptions mel_opts
 Options for the mel filter banks; see MelBanksOptions.
bool use_energy = false
 If true, append an extra dimension with energy to the filter banks.
float energy_floor = 0.0f
 Floor on energy (absolute, not relative) in fbank computation.
bool raw_energy = true
 If true, compute log energy before preemphasis and windowing; if false, compute it after preemphasis and windowing.
bool htk_compat = false
 If true, put energy last (if using energy); if false, put energy first.
bool use_log_fbank = true
 If true (default), produce log-filterbank; else linear.
bool use_log_floor = true
 If true (default), use Kaldi's hard floor before the log, i.e.
float eps = std::numeric_limits<float>::epsilon()
 Value used by the log-zero guard selected by use_log_floor.
bool use_power = true
 If true (default), use power in filterbank analysis; else magnitude.

Detailed Description

Options for computing filter-bank features.

This is kaldi's FbankOptions (src/feat/feature-fbank.h). It only includes things that can be done in a "stateless" way, i.e. it does not include energy max-normalization and it does not include delta computation.

See also
FbankComputer, FrameExtractionOptions, MelBanksOptions

Constructor & Destructor Documentation

◆ FbankOptions()

knf::FbankOptions::FbankOptions ( )
inline

Construct with the default options: 23 mel bins.

Member Function Documentation

◆ ToString()

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

Return the options as a string.

Member Data Documentation

◆ energy_floor

float knf::FbankOptions::energy_floor = 0.0f

Floor on energy (absolute, not relative) in fbank computation.

Only makes a difference if use_energy is true; only necessary if frame_opts.dither is 0.0. Suggested values: 0.1 or 1.0.

◆ eps

float knf::FbankOptions::eps = std::numeric_limits<float>::epsilon()

Value used by the log-zero guard selected by use_log_floor.

It defaults to FLT_EPSILON; NeMo models use FLT_EPSILON / 2 (2^-24, 5.9604644775390625e-08).

◆ frame_opts

FrameExtractionOptions knf::FbankOptions::frame_opts

Options for frame extraction; see FrameExtractionOptions.

◆ htk_compat

bool knf::FbankOptions::htk_compat = false

If true, put energy last (if using energy); if false, put energy first.

Warning: not sufficient to get HTK compatible features (need to change other parameters).

◆ mel_opts

MelBanksOptions knf::FbankOptions::mel_opts

Options for the mel filter banks; see MelBanksOptions.

◆ raw_energy

bool knf::FbankOptions::raw_energy = true

If true, compute log energy before preemphasis and windowing; if false, compute it after preemphasis and windowing.

◆ use_energy

bool knf::FbankOptions::use_energy = false

If true, append an extra dimension with energy to the filter banks.

◆ use_log_fbank

bool knf::FbankOptions::use_log_fbank = true

If true (default), produce log-filterbank; else linear.

◆ use_log_floor

bool knf::FbankOptions::use_log_floor = true

If true (default), use Kaldi's hard floor before the log, i.e.

\( \log(\max(e, \epsilon)) \). If false, use the additive guard \( \log(e + \epsilon) \), where \( e \) is the mel energy. NeMo models use the additive guard with eps = FLT_EPSILON / 2 (2^-24).

◆ use_power

bool knf::FbankOptions::use_power = true

If true (default), use power in filterbank analysis; else magnitude.


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