27 opts_(opts), srfft_(NULL),
28 mel_energies_duplicated_(opts_.mel_opts.num_bins + 2,
kUndefined),
29 autocorr_coeffs_(opts_.lpc_order + 1,
kUndefined),
44 if ((padded_window_size & (padded_window_size-1)) == 0)
61 for (std::map<BaseFloat, MelBanks*>::iterator iter =
mel_banks_.begin();
63 iter->second =
new MelBanks(*(iter->second));
73 for (std::map<BaseFloat, MelBanks*>::iterator iter =
mel_banks_.begin();
85 std::map<BaseFloat, MelBanks*>::iterator iter =
mel_banks_.find(vtln_warp);
92 this_mel_banks = iter->second;
94 return this_mel_banks;
100 std::map<BaseFloat, Vector<BaseFloat>*>::iterator iter
117 feature->
Dim() == this->
Dim());
127 signal_raw_log_energy =
Log(std::max<BaseFloat>(
VecVec(*signal_frame, *signal_frame),
128 std::numeric_limits<float>::min()));
139 0, signal_frame->
Dim() / 2 + 1);
145 mel_banks.Compute(power_spectrum, &mel_energies);
162 residual_log_energy = std::max<BaseFloat>(residual_log_energy,
163 std::numeric_limits<float>::min());
168 (*feature)(0) = residual_log_energy;
179 (*feature)(0) = signal_raw_log_energy;
185 (*feature)(
i) = (*feature)(
i+1);
This code computes Goodness of Pronunciation (GOP) and extracts phone-level pronunciation feature for...
BaseFloat compress_factor
BaseFloat log_energy_floor_
void Lpc2Cepstrum(int n, const BaseFloat *pLPC, BaseFloat *pCepst)
Vector< BaseFloat > mel_energies_duplicated_
This is the new-style interface to the PLP computation.
const Vector< BaseFloat > * GetEqualLoudness(BaseFloat vtln_warp)
Vector< BaseFloat > lifter_coeffs_
Vector< BaseFloat > lpc_coeffs_
Vector< BaseFloat > autocorr_coeffs_
Matrix< BaseFloat > idft_bases_
FrameExtractionOptions frame_opts
void MulElements(const VectorBase< Real > &v)
Multiply element-by-element by another vector.
std::map< BaseFloat, Vector< BaseFloat > *> equal_loudness_
void ComputeLifterCoeffs(BaseFloat Q, VectorBase< BaseFloat > *coeffs)
BaseFloat ComputeLpc(const VectorBase< BaseFloat > &autocorr_in, Vector< BaseFloat > *lpc_out)
Real * Data()
Returns a pointer to the start of the vector's data.
MatrixIndexT Dim() const
Returns the dimension of the vector.
void InitIdftBases(int32 n_bases, int32 dimension, Matrix< BaseFloat > *mat_out)
void Scale(Real alpha)
Multiplies all elements by this constant.
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.
void ComputePowerSpectrum(VectorBase< BaseFloat > *waveform)
const MelBanks * GetMelBanks(BaseFloat vtln_warp)
A class representing a vector.
#define KALDI_ASSERT(cond)
void ApplyPow(Real power)
Take all elements of vector to a power.
PlpComputer(const PlpOptions &opts)
Vector< BaseFloat > raw_cepstrum_
void GetEqualLoudnessVector(const MelBanks &mel_banks, Vector< BaseFloat > *ans)
PlpOptions contains basic options for computing PLP features.
Provides a vector abstraction class.
SplitRadixRealFft< BaseFloat > * srfft_
std::map< BaseFloat, MelBanks * > mel_banks_
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...
void RealFft(VectorBase< Real > *v, bool forward)
RealFft is a fourier transform of real inputs.
SubVector< Real > Range(const MatrixIndexT o, const MatrixIndexT l)
Returns a sub-vector of a vector (a range of elements).