This templated class is intended for offline feature extraction, i.e. More...
#include <feature-common.h>
Public Types | |
typedef F::Options | Options |
Public Member Functions | |
OfflineFeatureTpl (const Options &opts) | |
void | Compute (const VectorBase< BaseFloat > &wave, BaseFloat vtln_warp, Matrix< BaseFloat > *output) |
void | Compute (const VectorBase< BaseFloat > &wave, BaseFloat vtln_warp, Matrix< BaseFloat > *output) const |
void | ComputeFeatures (const VectorBase< BaseFloat > &wave, BaseFloat sample_freq, BaseFloat vtln_warp, Matrix< BaseFloat > *output) |
Computes the features for one file (one sequence of features). More... | |
void | ComputeFeatures (const VectorBase< BaseFloat > &wave, BaseFloat sample_freq, BaseFloat vtln_warp, Matrix< BaseFloat > *output) const |
This const version of ComputeFeatures() is a wrapper that calls the non-const ComputeFeatures() on a temporary object that is a copy of *this. More... | |
int32 | Dim () const |
OfflineFeatureTpl (const OfflineFeatureTpl< F > &other) | |
Private Member Functions | |
OfflineFeatureTpl< F > & | operator= (const OfflineFeatureTpl< F > &other) |
Private Attributes | |
F | computer_ |
FeatureWindowFunction | feature_window_function_ |
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.
typedef F::Options Options |
Definition at line 113 of file feature-common.h.
|
inline |
Definition at line 117 of file feature-common.h.
|
inline |
Definition at line 169 of file feature-common.h.
void Compute | ( | const VectorBase< BaseFloat > & | wave, |
BaseFloat | vtln_warp, | ||
Matrix< BaseFloat > * | output | ||
) |
Definition at line 75 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().
void Compute | ( | const VectorBase< BaseFloat > & | wave, |
BaseFloat | vtln_warp, | ||
Matrix< BaseFloat > * | output | ||
) | const |
void ComputeFeatures | ( | const VectorBase< BaseFloat > & | wave, |
BaseFloat | sample_freq, | ||
BaseFloat | vtln_warp, | ||
Matrix< BaseFloat > * | output | ||
) |
Computes the features for one file (one sequence of features).
This is the newer interface where you specify the sample frequency of the input waveform.
[in] | wave | The input waveform |
[in] | sample_freq | The sampling frequency with which 'wave' was sampled. if sample_freq is higher than the frequency specified in the config, we will downsample the waveform, but if lower, it's an error. |
[in] | vtln_warp | The VTLN warping factor (will normally be 1.0) |
[out] | output | The matrix of features, where the row-index is the frame index. |
Definition at line 29 of file feature-common-inl.h.
References kaldi::DownsampleWaveForm(), KALDI_ASSERT, and KALDI_ERR.
Referenced by OfflineFeatureTpl< F >::ComputeFeatures(), and main().
void ComputeFeatures | ( | const VectorBase< BaseFloat > & | wave, |
BaseFloat | sample_freq, | ||
BaseFloat | vtln_warp, | ||
Matrix< BaseFloat > * | output | ||
) | const |
This const version of ComputeFeatures() is a wrapper that calls the non-const ComputeFeatures() on a temporary object that is a copy of *this.
It is not as efficient because of the overhead of copying *this.
Definition at line 61 of file feature-common-inl.h.
References OfflineFeatureTpl< F >::ComputeFeatures().
|
inline |
|
private |
|
private |
Definition at line 176 of file feature-common.h.
Referenced by OfflineFeatureTpl< F >::Dim().
|
private |
Definition at line 177 of file feature-common.h.