40#ifndef KALDI_NATIVE_FBANK_CSRC_FEATURE_MFCC_H_
41#define KALDI_NATIVE_FBANK_CSRC_FEATURE_MFCC_H_
96 std::ostringstream os;
98 os <<
"frame_opts=" <<
frame_opts.ToString() <<
", ";
99 os <<
"mel_opts=" <<
mel_opts.ToString() <<
", ";
101 os <<
"num_ceps=" <<
num_ceps <<
", ";
102 os <<
"use_energy=" << (
use_energy ?
"True" :
"False") <<
", ";
104 os <<
"raw_energy=" << (
raw_energy ?
"True" :
"False") <<
", ";
106 os <<
"htk_compat=" << (
htk_compat ?
"True" :
"False") <<
")";
138 int32_t
Dim()
const {
return opts_.num_ceps; }
146 return opts_.frame_opts;
173 void Compute(
float signal_raw_log_energy,
float vtln_warp,
174 std::vector<float> *signal_frame,
float *feature);
179 const MelBanks *GetMelBanks(
float vtln_warp);
182 float log_energy_floor_;
183 std::map<float, MelBanks *> mel_banks_;
187 std::vector<float> mel_energies_;
194 std::vector<float> dct_matrix_;
Triangular mel-filterbank bins.
Definition mel-computations.h:133
~MfccComputer()
Destructor; frees the cached MelBanks.
const MfccOptions & GetOptions() const
Return the options this computer was constructed with.
Definition feature-mfcc.h:150
MfccOptions Options
Option type accepted by this computer.
Definition feature-mfcc.h:129
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.
const FrameExtractionOptions & GetFrameOptions() const
Return the frame-extraction options.
Definition feature-mfcc.h:145
int32_t Dim() const
Return the dimension of the output features: num_ceps.
Definition feature-mfcc.h:138
bool NeedRawLogEnergy() const
If true, compute log_energy_pre_window but after dithering and dc removal.
Definition feature-mfcc.h:142
MfccComputer(const MfccOptions &opts)
Construct from the given options.
n-point real discrete Fourier transform, where n is even, n >= 2.
Definition rfft.h:44
Waveform windowing and frame extraction.
Copyright 2009-2011 Phonexia s.r.o.; Microsoft Corporation 2016 Johns Hopkins University (author: Dan...
This file is part of kaldi-native-fbank.
Definition feature-cmvn.h:42
std::ostream & operator<<(std::ostream &os, const FbankOptions &opts)
Write the options to the stream, one option per line.
Copyright (c) 2022 Xiaomi Corporation (authors: Fangjun Kuang).
Options for constructing triangular mel-filterbank bins.
Definition mel-computations.h:58
Options for computing MFCC features.
Definition feature-mfcc.h:60
float energy_floor
Floor on energy (absolute, not relative) in MFCC computation.
Definition feature-mfcc.h:76
MelBanksOptions mel_opts
Options for the mel filter banks; see MelBanksOptions.
Definition feature-mfcc.h:65
bool htk_compat
If true, put energy or C0 last and use a factor of sqrt(2) on C0.
Definition feature-mfcc.h:89
bool raw_energy
If true, compute energy before preemphasis and windowing.
Definition feature-mfcc.h:79
std::string ToString() const
Return the options as a string.
Definition feature-mfcc.h:95
int32_t num_ceps
Number of cepstra in MFCC computation (including C0), e.g. 13.
Definition feature-mfcc.h:68
float cepstral_lifter
Constant that controls scaling of MFCCs (HTK liftering).
Definition feature-mfcc.h:83
FrameExtractionOptions frame_opts
Options for frame extraction; see FrameExtractionOptions.
Definition feature-mfcc.h:62
bool use_energy
Use energy (not C0) in MFCC computation.
Definition feature-mfcc.h:71
MfccOptions()
Construct with the default options: 23 mel bins, 13 cepstra.
Definition feature-mfcc.h:92