template<class F>
class kaldi::OfflineFeatureTpl< F >
This templated class is intended for offline feature extraction, i.e.
where you have access to the entire signal at the start. It exists mainly to be drop-in replacement for the old (pre-2016) classes Mfcc, Plp and so on, for use in the offline case. In April 2016 we reorganized the online feature-computation code for greater modularity and to have correct support for the snip-edges=false option.
Definition at line 111 of file feature-common.h.
Definition at line 60 of file feature-common-inl.h.
References VectorBase< Real >::Dim(), kaldi::ExtractWindow(), KALDI_ASSERT, kaldi::NumFrames(), and Matrix< Real >::Resize().
Referenced by OfflineFeatureTpl< F >::Compute(), main(), kaldi::TestOnlineAppendFeature(), kaldi::TestOnlineMfcc(), kaldi::TestOnlinePlp(), UnitTestHTKCompare1(), UnitTestHTKCompare2(), UnitTestHTKCompare3(), UnitTestHTKCompare4(), UnitTestHTKCompare5(), UnitTestHTKCompare6(), and UnitTestSimple().
71 output->
Resize(rows_out, cols_out);
72 Vector<BaseFloat> window;
73 bool use_raw_log_energy =
computer_.NeedRawLogEnergy();
74 for (
int32 r = 0; r < rows_out; r++) {
78 (use_raw_log_energy ? &raw_log_energy : NULL));
80 SubVector<BaseFloat> output_row(*output, r);
81 computer_.Compute(raw_log_energy, vtln_warp, &window, &output_row);
FeatureWindowFunction feature_window_function_
void ExtractWindow(int64 sample_offset, const VectorBase< BaseFloat > &wave, int32 f, const FrameExtractionOptions &opts, const FeatureWindowFunction &window_function, Vector< BaseFloat > *window, BaseFloat *log_energy_pre_window)
int32 NumFrames(int64 num_samples, const FrameExtractionOptions &opts, bool flush)
This function returns the number of frames that we can extract from a wave file with the given number...
#define KALDI_ASSERT(cond)
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).