27 opts_(opts), srfft_(NULL) {
32 if ((padded_window_size & (padded_window_size-1)) == 0)
43 for (std::map<BaseFloat, MelBanks*>::iterator iter =
mel_banks_.begin();
46 iter->second =
new MelBanks(*(iter->second));
52 for (std::map<BaseFloat, MelBanks*>::iterator iter =
mel_banks_.begin();
60 std::map<BaseFloat, MelBanks*>::iterator iter =
mel_banks_.find(vtln_warp);
67 this_mel_banks = iter->second;
69 return this_mel_banks;
80 feature->
Dim() == this->
Dim());
85 signal_raw_log_energy =
Log(std::max<BaseFloat>(
VecVec(*signal_frame, *signal_frame),
86 std::numeric_limits<float>::epsilon()));
96 signal_frame->
Dim() / 2 + 1);
108 mel_banks.
Compute(power_spectrum, &mel_energies);
111 mel_energies.
ApplyFloor(std::numeric_limits<float>::epsilon());
121 (*feature)(energy_index) = signal_raw_log_energy;
This code computes Goodness of Pronunciation (GOP) and extracts phone-level pronunciation feature for...
void ApplyLog()
Apply natural log to all elements.
FrameExtractionOptions frame_opts
void ApplyFloor(Real floor_val, MatrixIndexT *floored_count=nullptr)
Applies floor to all elements.
Class for computing mel-filterbank features; see Computing MFCC features for more information...
void Compute(BaseFloat signal_raw_log_energy, BaseFloat vtln_warp, VectorBase< BaseFloat > *signal_frame, VectorBase< BaseFloat > *feature)
Function that computes one frame of features from one frame of signal.
Real * Data()
Returns a pointer to the start of the vector's data.
MatrixIndexT Dim() const
Returns the dimension of the vector.
void Compute(const VectorBase< BaseFloat > &fft_energies, VectorBase< BaseFloat > *mel_energies_out) const
Compute Mel energies (note: not log enerties).
FbankComputer(const FbankOptions &opts)
SplitRadixRealFft< BaseFloat > * srfft_
void ComputePowerSpectrum(VectorBase< BaseFloat > *waveform)
BaseFloat log_energy_floor_
#define KALDI_ASSERT(cond)
void ApplyPow(Real power)
Take all elements of vector to a power.
Provides a vector abstraction class.
FbankOptions contains basic options for computing filterbank features.
Real VecVec(const VectorBase< Real > &a, const VectorBase< Real > &b)
Returns dot product between v1 and v2.
Represents a non-allocating general vector which can be defined as a sub-vector of higher-level vecto...
const MelBanks * GetMelBanks(BaseFloat vtln_warp)
std::map< BaseFloat, MelBanks * > mel_banks_
void RealFft(VectorBase< Real > *v, bool forward)
RealFft is a fourier transform of real inputs.