33 feature->
Dim() == this->
Dim());
38 signal_raw_log_energy =
Log(std::max<BaseFloat>(
VecVec(*signal_frame, *signal_frame),
39 std::numeric_limits<float>::epsilon()));
49 signal_frame->
Dim() / 2 + 1);
54 mel_energies_.ApplyFloor(std::numeric_limits<float>::epsilon());
67 (*feature)(0) = signal_raw_log_energy;
73 (*feature)(
i) = (*feature)(
i+1);
88 KALDI_ERR <<
"num-ceps cannot be larger than num-mel-bins." 89 <<
" It should be smaller or equal. You provided num-ceps: " 90 << opts.
num_ceps <<
" and num-mel-bins: " 109 if ((padded_window_size & (padded_window_size-1)) == 0)
124 for (std::map<BaseFloat, MelBanks*>::iterator iter =
mel_banks_.begin();
126 iter->second =
new MelBanks(*(iter->second));
134 for (std::map<BaseFloat, MelBanks*>::iterator iter =
mel_banks_.begin();
143 std::map<BaseFloat, MelBanks*>::iterator iter =
mel_banks_.find(vtln_warp);
150 this_mel_banks = iter->second;
152 return this_mel_banks;
This code computes Goodness of Pronunciation (GOP) and extracts phone-level pronunciation feature for...
MfccOptions contains basic options for computing MFCC features.
void ComputeDctMatrix(Matrix< Real > *M)
ComputeDctMatrix computes a matrix corresponding to the DCT, such that M * v equals the DCT of vector...
const MelBanks * GetMelBanks(BaseFloat vtln_warp)
void CopyFromMat(const MatrixBase< OtherReal > &M, MatrixTransposeType trans=kNoTrans)
Copy given matrix. (no resize is done).
MfccComputer(const MfccOptions &opts)
Vector< BaseFloat > mel_energies_
BaseFloat cepstral_lifter
BaseFloat log_energy_floor_
std::map< BaseFloat, MelBanks * > mel_banks_
FrameExtractionOptions frame_opts
void MulElements(const VectorBase< Real > &v)
Multiply element-by-element by another vector.
Matrix< BaseFloat > dct_matrix_
void ComputeLifterCoeffs(BaseFloat Q, VectorBase< BaseFloat > *coeffs)
Real * Data()
Returns a pointer to the start of the vector's data.
MatrixIndexT Dim() const
Returns the dimension of the vector.
void AddMatVec(const Real alpha, const MatrixBase< Real > &M, const MatrixTransposeType trans, const VectorBase< Real > &v, const Real beta)
Add matrix times vector : this <– beta*this + alpha*M*v.
void ComputePowerSpectrum(VectorBase< BaseFloat > *waveform)
#define KALDI_ASSERT(cond)
Vector< BaseFloat > lifter_coeffs_
void Resize(const MatrixIndexT r, const MatrixIndexT c, MatrixResizeType resize_type=kSetZero, MatrixStrideType stride_type=kDefaultStride)
Sets matrix to a specified size (zero is OK as long as both r and c are zero).
Provides a vector abstraction class.
void SetZero()
Set vector to all zeros.
Real VecVec(const VectorBase< Real > &a, const VectorBase< Real > &b)
Returns dot product between v1 and v2.
SplitRadixRealFft< BaseFloat > * srfft_
Sub-matrix representation.
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.
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.