24 #ifndef KALDI_FEAT_RESAMPLE_H_ 25 #define KALDI_FEAT_RESAMPLE_H_ 156 int32 samp_rate_out_hz,
201 int64 GetNumOutputSamples(int64 input_num_samp,
bool flush)
const;
208 inline void GetIndexes(int64 samp_out,
209 int64 *first_samp_in,
210 int32 *samp_out_wrapped)
const;
214 void SetIndexesAndWeights();
225 int32 output_samples_in_unit_;
247 int64 output_sample_offset_;
287 #endif // KALDI_FEAT_RESAMPLE_H_ This code computes Goodness of Pronunciation (GOP) and extracts phone-level pronunciation feature for...
void ResampleWaveform(BaseFloat orig_freq, const VectorBase< BaseFloat > &wave, BaseFloat new_freq, Vector< BaseFloat > *new_wave)
Downsample or upsample a waveform.
Base class which provides matrix operations not involving resizing or allocation. ...
int32 NumSamplesOut() const
BaseFloat FilterFunc(BaseFloat t) const
Here, t is a time in seconds representing an offset from the center of the windowed filter function...
void DownsampleWaveForm(BaseFloat orig_freq, const VectorBase< BaseFloat > &wave, BaseFloat new_freq, Vector< BaseFloat > *new_wave)
This function is deprecated.
int64 input_sample_offset_
The number of input samples we have already received for this signal (including anything in remainder...
std::vector< int32 > first_index_
The first input-sample index that we sum over, for this output-sample index.
Class ArbitraryResample allows you to resample a signal (assumed zero outside the sample region...
void Resample(const MatrixBase< BaseFloat > &input, MatrixBase< BaseFloat > *output) const
This function does the resampling.
void SetIndexes(const Vector< BaseFloat > &sample_points)
int32 GetOutputSamplingRate()
std::vector< Vector< BaseFloat > > weights_
void SetWeights(const Vector< BaseFloat > &sample_points)
int32 NumSamplesIn() const
A class representing a vector.
LinearResample is a special case of ArbitraryResample, where we want to resample a signal at linearly...
ArbitraryResample(int32 num_samples_in, BaseFloat samp_rate_hz, BaseFloat filter_cutoff_hz, const Vector< BaseFloat > &sample_points_secs, int32 num_zeros)
int32 GetInputSamplingRate()
int32 input_samples_in_unit_
The number of input samples in the smallest repeating unit: num_samp_in_ = samp_rate_in_hz / Gcd(samp...
std::vector< Vector< BaseFloat > > weights_
Weights on the input samples, for this output-sample index.
Provides a vector abstraction class.
std::vector< int32 > first_index_