#include <mel-computations.h>
Public Member Functions | |
MelBanks (const MelBanksOptions &opts, const FrameExtractionOptions &frame_opts, BaseFloat vtln_warp_factor) | |
void | Compute (const VectorBase< BaseFloat > &fft_energies, VectorBase< BaseFloat > *mel_energies_out) const |
Compute Mel energies (note: not log enerties). More... | |
int32 | NumBins () const |
const Vector< BaseFloat > & | GetCenterFreqs () const |
const std::vector< std::pair< int32, Vector< BaseFloat > > > & | GetBins () const |
MelBanks (const MelBanks &other) | |
Static Public Member Functions | |
static BaseFloat | InverseMelScale (BaseFloat mel_freq) |
static BaseFloat | MelScale (BaseFloat freq) |
static BaseFloat | VtlnWarpFreq (BaseFloat vtln_low_cutoff, BaseFloat vtln_high_cutoff, BaseFloat low_freq, BaseFloat high_freq, BaseFloat vtln_warp_factor, BaseFloat freq) |
static BaseFloat | VtlnWarpMelFreq (BaseFloat vtln_low_cutoff, BaseFloat vtln_high_cutoff, BaseFloat low_freq, BaseFloat high_freq, BaseFloat vtln_warp_factor, BaseFloat mel_freq) |
Private Member Functions | |
MelBanks & | operator= (const MelBanks &other) |
Private Attributes | |
Vector< BaseFloat > | center_freqs_ |
std::vector< std::pair< int32, Vector< BaseFloat > > > | bins_ |
bool | debug_ |
bool | htk_mode_ |
Definition at line 78 of file mel-computations.h.
MelBanks | ( | const MelBanksOptions & | opts, |
const FrameExtractionOptions & | frame_opts, | ||
BaseFloat | vtln_warp_factor | ||
) |
Definition at line 33 of file mel-computations.cc.
References MelBanks::bins_, MelBanks::center_freqs_, MelBanks::debug_, MelBanksOptions::debug_mel, MelBanksOptions::high_freq, MelBanksOptions::htk_mode, rnnlm::i, MelBanks::InverseMelScale(), KALDI_ASSERT, KALDI_ERR, KALDI_LOG, MelBanksOptions::low_freq, MelBanks::MelScale(), MelBanksOptions::num_bins, FrameExtractionOptions::PaddedWindowSize(), VectorBase< Real >::Range(), FrameExtractionOptions::samp_freq, MelBanksOptions::vtln_high, MelBanksOptions::vtln_low, and MelBanks::VtlnWarpMelFreq().
Definition at line 144 of file mel-computations.cc.
void Compute | ( | const VectorBase< BaseFloat > & | fft_energies, |
VectorBase< BaseFloat > * | mel_energies_out | ||
) | const |
Compute Mel energies (note: not log enerties).
At input, "fft_energies" contains the FFT energies (not log).
Definition at line 226 of file mel-computations.cc.
References MelBanks::bins_, MelBanks::debug_, VectorBase< Real >::Dim(), MelBanks::htk_mode_, rnnlm::i, KALDI_ASSERT, KALDI_ISNAN, VectorBase< Real >::Range(), and kaldi::VecVec().
Referenced by FbankComputer::Compute().
Definition at line 119 of file mel-computations.h.
Definition at line 81 of file mel-computations.h.
Referenced by MelBanks::MelBanks(), and MelBanks::VtlnWarpMelFreq().
Definition at line 85 of file mel-computations.h.
References MelBanksOptions::high_freq, and MelBanksOptions::low_freq.
Referenced by MelBanks::MelBanks(), and MelBanks::VtlnWarpMelFreq().
|
inline |
Definition at line 114 of file mel-computations.h.
Referenced by kaldi::GetEqualLoudnessVector().
|
static |
This computes a VTLN warping function that is not the same as HTK's one, but has similar inputs (this function has the advantage of never producing empty bins).
This function computes a warp function F(freq), defined between low_freq and high_freq inclusive, with the following properties: F(low_freq) == low_freq F(high_freq) == high_freq The function is continuous and piecewise linear with two inflection points. The lower inflection point (measured in terms of the unwarped frequency) is at frequency l, determined as described below. The higher inflection point is at a frequency h, determined as described below. If l <= f <= h, then F(f) = f/vtln_warp_factor. If the higher inflection point (measured in terms of the unwarped frequency) is at h, then max(h, F(h)) == vtln_high_cutoff. Since (by the last point) F(h) == h/vtln_warp_factor, then max(h, h/vtln_warp_factor) == vtln_high_cutoff, so h = vtln_high_cutoff / max(1, 1/vtln_warp_factor). = vtln_high_cutoff * min(1, vtln_warp_factor). If the lower inflection point (measured in terms of the unwarped frequency) is at l, then min(l, F(l)) == vtln_low_cutoff This implies that l = vtln_low_cutoff / min(1, 1/vtln_warp_factor) = vtln_low_cutoff * max(1, vtln_warp_factor)
Definition at line 150 of file mel-computations.cc.
References KALDI_ASSERT.
Referenced by UnitTestVtln(), and MelBanks::VtlnWarpMelFreq().
|
static |
Definition at line 213 of file mel-computations.cc.
References MelBanks::InverseMelScale(), MelBanks::MelScale(), and MelBanks::VtlnWarpFreq().
Referenced by MelBanks::MelBanks().
Definition at line 135 of file mel-computations.h.
Referenced by MelBanks::Compute(), and MelBanks::MelBanks().
Definition at line 131 of file mel-computations.h.
Referenced by MelBanks::MelBanks().
|
private |
Definition at line 137 of file mel-computations.h.
Referenced by MelBanks::Compute(), and MelBanks::MelBanks().
|
private |
Definition at line 138 of file mel-computations.h.
Referenced by MelBanks::Compute().