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

Class for computing MFCC features. More...

#include <feature-mfcc.h>

Public Types

using Options = MfccOptions
 Option type accepted by this computer.

Public Member Functions

 MfccComputer (const MfccOptions &opts)
 Construct from the given options.
 ~MfccComputer ()
 Destructor; frees the cached MelBanks.
int32_t Dim () const
 Return the dimension of the output features: num_ceps.
bool NeedRawLogEnergy () const
 If true, compute log_energy_pre_window but after dithering and dc removal.
const FrameExtractionOptions & GetFrameOptions () const
 Return the frame-extraction options.
const MfccOptions & GetOptions () const
 Return the options this computer was constructed with.
void Compute (float signal_raw_log_energy, float vtln_warp, std::vector< float > *signal_frame, float *feature)
 Function that computes one frame of features from one frame of signal.

Detailed Description

Class for computing MFCC features.

It computes one frame of features at a time from one frame of signal; see OnlineMfcc in online-feature.h for the streaming interface that feeds it. For more information, see src/feat/feature-mfcc.h.

Used by:
OnlineMfcc = OnlineGenericBaseFeature<MfccComputer> (see online-feature.h) wraps this class for streaming use.
See also
MfccOptions, MelBanks, ComputeLifterCoeffs, OnlineMfcc, ExtractWindow

Member Typedef Documentation

◆ Options

Option type accepted by this computer.

Constructor & Destructor Documentation

◆ MfccComputer()

knf::MfccComputer::MfccComputer ( const MfccOptions & opts)
explicit

Construct from the given options.

◆ ~MfccComputer()

knf::MfccComputer::~MfccComputer ( )

Destructor; frees the cached MelBanks.

Member Function Documentation

◆ Compute()

void knf::MfccComputer::Compute ( float signal_raw_log_energy,
float vtln_warp,
std::vector< float > * signal_frame,
float * feature )

Function that computes one frame of features from one frame of signal.

Parameters
[in]signal_raw_log_energyThe log-energy of the frame of the signal prior to windowing and pre-emphasis, or log(numeric_limits<float>::min()), whichever is greater. Must be ignored by this function if this class returns false from this->NeedsRawLogEnergy().
[in]vtln_warpThe VTLN warping factor that the user wants to be applied when computing features for this utterance. Will normally be 1.0, meaning no warping is to be done. The value will be ignored for feature types that don't support VLTN, such as spectrogram features.
[in]signal_frameOne frame of the signal, as extracted using the function ExtractWindow() using the options returned by this->GetFrameOptions(). The function will use the vector as a workspace, which is why it's a non-const pointer.
[out]featurePointer to a vector of size this->Dim(), to which the computed feature will be written. It should be pre-allocated.

◆ Dim()

int32_t knf::MfccComputer::Dim ( ) const
inline

Return the dimension of the output features: num_ceps.

◆ GetFrameOptions()

const FrameExtractionOptions & knf::MfccComputer::GetFrameOptions ( ) const
inline

Return the frame-extraction options.

◆ GetOptions()

const MfccOptions & knf::MfccComputer::GetOptions ( ) const
inline

Return the options this computer was constructed with.

◆ NeedRawLogEnergy()

bool knf::MfccComputer::NeedRawLogEnergy ( ) const
inline

If true, compute log_energy_pre_window but after dithering and dc removal.


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