33 <<
"Supported feature types: mfcc, plp, fbank.";
39 KALDI_WARN <<
"--mfcc-config option has no effect " 40 <<
"since feature type is set to " <<
feature_type <<
".";
46 KALDI_WARN <<
"--plp-config option has no effect " 47 <<
"since feature type is set to " <<
feature_type <<
".";
53 KALDI_WARN <<
"--fbank-config option has no effect " 54 <<
"since feature type is set to " <<
feature_type <<
".";
61 KALDI_WARN <<
"--pitch-config option has no effect " 62 <<
"since you did not supply --add-pitch option.";
68 KALDI_WARN <<
"--pitch-process-config option has no effect " 69 <<
"since you did not supply --add-pitch option.";
78 KALDI_ERR <<
"--global-cmvn-stats option is required.";
84 KALDI_WARN <<
"--delta-config option has no effect " 85 <<
"since you did not supply --add-deltas option.";
92 KALDI_WARN <<
"--splice-config option has no effect " 93 <<
"since you did not supply --splice-feats option.";
97 KALDI_ERR <<
"You cannot supply both --add-deltas " 98 <<
"and --splice-feats options";
108 config_(config), lda_mat_(lda_mat), global_cmvn_stats_(global_cmvn_stats) {
176 if (global_dim > dim) {
200 KALDI_ERR <<
"You cannot supply both --add-deltas and " 201 <<
"--splice-feats options.";
230 if (transform.
NumRows() != 0) {
287 if (feature_type ==
"mfcc") {
288 return mfcc_opts.frame_opts.frame_shift_ms / 1000.0f;
289 }
else if (feature_type ==
"plp") {
290 return plp_opts.frame_opts.frame_shift_ms / 1000.0f;
291 }
else if (feature_type ==
"fbank") {
292 return fbank_opts.frame_opts.frame_shift_ms / 1000.0f;
294 KALDI_ERR <<
"Unknown feature type " << feature_type;
OnlinePitchFeature * pitch_
This code computes Goodness of Pronunciation (GOP) and extracts phone-level pronunciation feature for...
virtual int32 NumFramesReady() const
returns the feature dimension.
virtual int32 Dim() const
Member functions from OnlineFeatureInterface:
OnlineFeatureInterface * AdaptedFeature() const
returns adapted feature if fmllr_ exists, else UnadaptedFeature().
void ReadConfigFromFile(const std::string &config_filename, C *c)
This template is provided for convenience in reading config classes from files; this is not the stand...
virtual void GetFrame(int32 frame, VectorBase< BaseFloat > *feat)
Gets the feature vector for this frame.
OnlineGenericBaseFeature< PlpComputer > OnlinePlp
OnlineGenericBaseFeature< MfccComputer > OnlineMfcc
OnlineGenericBaseFeature< FbankComputer > OnlineFbank
Matrix< BaseFloat > global_cmvn_stats_
virtual int32 Dim() const
OnlineFeatureInterface * feature_
MatrixIndexT NumCols() const
Returns number of columns (or zero for empty matrix).
Base class which provides matrix operations not involving resizing or allocation. ...
virtual void InputFinished()
InputFinished() tells the class you won't be providing any more waveform.
This class does an online version of the cepstral mean and [optionally] variance, but note that this ...
virtual void AcceptWaveform(BaseFloat sampling_rate, const VectorBase< BaseFloat > &waveform)
This would be called from the application, when you get more wave data.
This online-feature class implements post processing of pitch features.
OnlineProcessPitch * pitch_feature_
virtual ~OnlineFeaturePipeline()
virtual void GetFrame(int32 frame, VectorBase< BaseFloat > *feat)=0
Gets the feature vector for this frame.
This file contains a class OnlineFeaturePipeline for online feature extraction, which puts together v...
virtual bool IsLastFrame(int32 frame) const
Returns true if this is the last frame.
OnlineFeatureInterface * UnadaptedFeature() const
returns lda_ if it exists, else splice_or_delta_, else cmvn_.
OnlineBaseFeature * base_feature_
DeltaFeaturesOptions delta_opts
This configuration class is to set up OnlineFeaturePipelineConfig, which in turn is the configuration...
std::string pitch_process_config
OnlineFeaturePipeline is a class that's responsible for putting together the various stages of the fe...
OnlineFeatureInterface * fmllr_
void ReadKaldiObject(const std::string &filename, Matrix< float > *m)
void GetState(int32 cur_frame, OnlineCmvnState *cmvn_state)
OnlineFeaturePipeline(const OnlineFeaturePipelineConfig &cfg)
std::string lda_rxfilename
std::string global_cmvn_stats_rxfilename
void GetCmvnState(OnlineCmvnState *cmvn_state)
SubMatrix< Real > ColRange(const MatrixIndexT col_offset, const MatrixIndexT num_cols) const
OnlineFeaturePipelineConfig()
BaseFloat FrameShiftInSeconds() const
void Freeze(int32 cur_frame)
This online-feature class implements combination of two feature streams (such as pitch, plp) into one stream.
virtual void GetFrame(int32 frame, VectorBase< BaseFloat > *feat)
Gets the feature vector for this frame.
Matrix< BaseFloat > lda_mat_
OnlineSpliceOptions splice_opts
void SetState(const OnlineCmvnState &cmvn_state)
OnlineFeatureInterface * lda_
Struct OnlineCmvnState stores the state of CMVN adaptation between utterances (but not the state of t...
virtual bool IsLastFrame(int32 frame) const =0
Returns true if this is the last frame.
ProcessPitchOptions pitch_process_opts
std::string lda_rxfilename
void GetAsMatrix(Matrix< BaseFloat > *feats)
PitchExtractionOptions pitch_opts
void Init()
Init() is to be called from the constructor; it assumes the pointer members are all uninitialized but...
OnlineFeaturePipeline * New() const
returns a newly initialized copy of *this– this does not duplicate all the internal state or the spe...
std::string splice_config
void AcceptWaveform(BaseFloat sampling_rate, const VectorBase< BaseFloat > &waveform)
Accept more data to process (won't actually process it, will just copy it).
OnlineFeatureInterface * splice_or_delta_
#define KALDI_ASSERT(cond)
MatrixIndexT NumRows() const
Returns number of rows (or zero for empty matrix).
void SetTransform(const MatrixBase< BaseFloat > &transform)
This configuration class is responsible for storing the configuration options for OnlineFeaturePipeli...
std::string global_cmvn_stats_rxfilename
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).
OnlineFeatureInterface is an interface for online feature processing (it is also usable in the offlin...
OnlineFeaturePipelineConfig config_
virtual void AcceptWaveform(BaseFloat sampling_rate, const VectorBase< BaseFloat > &waveform)=0
This would be called from the application, when you get more wave data.
OnlineCmvnOptions cmvn_opts
virtual void InputFinished()=0
InputFinished() tells the class you won't be providing any more waveform.
virtual int32 NumFramesReady() const
returns the feature dimension.
void SetCmvnState(const OnlineCmvnState &cmvn_state)
Set the CMVN state to a particular value (will generally be called after Copy().
Provides a vector abstraction class.
virtual int32 NumFramesReady() const =0
returns the feature dimension.
Represents a non-allocating general vector which can be defined as a sub-vector of higher-level vecto...
virtual int32 Dim() const =0