28 : opts_(opts), srfft_(NULL) {
33 if ((padded_window_size & (padded_window_size-1)) == 0)
52 feature->
Dim() == this->
Dim());
57 signal_raw_log_energy =
Log(std::max<BaseFloat>(
VecVec(*signal_frame, *signal_frame),
58 std::numeric_limits<float>::epsilon()));
73 0, signal_frame->
Dim() / 2 + 1);
75 power_spectrum.
ApplyFloor(std::numeric_limits<float>::epsilon());
76 power_spectrum.ApplyLog();
84 (*feature)(0) = signal_raw_log_energy;
This code computes Goodness of Pronunciation (GOP) and extracts phone-level pronunciation feature for...
Class for computing spectrogram features.
void ApplyFloor(Real floor_val, MatrixIndexT *floored_count=nullptr)
Applies floor to all elements.
void CopyFromVec(const VectorBase< Real > &v)
Copy data from another vector (must match own size).
Real * Data()
Returns a pointer to the start of the vector's data.
MatrixIndexT Dim() const
Returns the dimension of the vector.
void ComputePowerSpectrum(VectorBase< BaseFloat > *waveform)
SplitRadixRealFft< BaseFloat > * srfft_
#define KALDI_ASSERT(cond)
void Compute(BaseFloat signal_raw_log_energy, BaseFloat vtln_warp, VectorBase< BaseFloat > *signal_frame, VectorBase< BaseFloat > *feature)
Function that computes one frame of spectrogram features from one frame of signal.
SpectrogramOptions contains basic options for computing spectrogram features.
Provides a vector abstraction class.
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...
FrameExtractionOptions frame_opts
BaseFloat log_energy_floor_
SpectrogramComputer(const SpectrogramOptions &opts)
void RealFft(VectorBase< Real > *v, bool forward)
RealFft is a fourier transform of real inputs.