#include <pitch-functions.h>
Public Member Functions | |
OnlinePitchFeature (const PitchExtractionOptions &opts) | |
virtual int32 | Dim () const |
virtual int32 | NumFramesReady () const |
returns the feature dimension. More... | |
virtual BaseFloat | FrameShiftInSeconds () const |
virtual bool | IsLastFrame (int32 frame) const |
Returns true if this is the last frame. More... | |
virtual void | GetFrame (int32 frame, VectorBase< BaseFloat > *feat) |
Outputs the two-dimensional feature consisting of (pitch, NCCF). More... | |
virtual void | AcceptWaveform (BaseFloat sampling_rate, const VectorBase< BaseFloat > &waveform) |
This would be called from the application, when you get more wave data. More... | |
virtual void | InputFinished () |
InputFinished() tells the class you won't be providing any more waveform. More... | |
virtual | ~OnlinePitchFeature () |
Public Member Functions inherited from OnlineFeatureInterface | |
virtual void | GetFrames (const std::vector< int32 > &frames, MatrixBase< BaseFloat > *feats) |
This is like GetFrame() but for a collection of frames. More... | |
virtual | ~OnlineFeatureInterface () |
Virtual destructor. More... | |
Private Attributes | |
OnlinePitchFeatureImpl * | impl_ |
Definition at line 300 of file pitch-functions.h.
|
explicit |
Definition at line 1208 of file pitch-functions.cc.
|
virtual |
|
virtual |
This would be called from the application, when you get more wave data.
Note: the sampling_rate is typically only provided so the code can assert that it matches the sampling rate expected in the options.
Implements OnlineBaseFeature.
Definition at line 1223 of file pitch-functions.cc.
References OnlinePitchFeatureImpl::AcceptWaveform(), and OnlinePitchFeature::impl_.
Referenced by OnlineFeaturePipeline::AcceptWaveform(), OnlineNnet2FeaturePipeline::AcceptWaveform(), kaldi::ComputeAndProcessKaldiPitch(), kaldi::ComputeKaldiPitch(), kaldi::ComputeKaldiPitchFirstPass(), kaldi::UnitTestDelay(), and kaldi::UnitTestPieces().
|
inlinevirtual |
Implements OnlineFeatureInterface.
Definition at line 304 of file pitch-functions.h.
|
virtual |
Implements OnlineFeatureInterface.
Definition at line 1215 of file pitch-functions.cc.
References OnlinePitchFeatureImpl::FrameShiftInSeconds(), and OnlinePitchFeature::impl_.
|
virtual |
Outputs the two-dimensional feature consisting of (pitch, NCCF).
You should probably post-process this using class OnlineProcessPitch.
Implements OnlineFeatureInterface.
Definition at line 1219 of file pitch-functions.cc.
References OnlinePitchFeatureImpl::GetFrame(), and OnlinePitchFeature::impl_.
Referenced by kaldi::ComputeKaldiPitch(), kaldi::ComputeKaldiPitchFirstPass(), and kaldi::UnitTestPieces().
|
virtual |
InputFinished() tells the class you won't be providing any more waveform.
This will help flush out the last few frames of delta or LDA features (it will typically affect the return value of IsLastFrame.
Implements OnlineBaseFeature.
Definition at line 1229 of file pitch-functions.cc.
References OnlinePitchFeature::impl_, and OnlinePitchFeatureImpl::InputFinished().
Referenced by kaldi::ComputeAndProcessKaldiPitch(), kaldi::ComputeKaldiPitch(), kaldi::ComputeKaldiPitchFirstPass(), OnlineFeaturePipeline::InputFinished(), OnlineNnet2FeaturePipeline::InputFinished(), kaldi::UnitTestDelay(), and kaldi::UnitTestPieces().
Returns true if this is the last frame.
Frame indices are zero-based, so the first frame is zero. IsLastFrame(-1) will return false, unless the file is empty (which is a case that I'm not sure all the code will handle, so be careful). This function may return false for some frame if we haven't yet decided to terminate decoding, but later true if we decide to terminate decoding. This function exists mainly to correctly handle end effects in feature extraction, and is not a mechanism to determine how many frames are in the decodable object (as it used to be, and for backward compatibility, still is, in the Decodable interface).
Implements OnlineFeatureInterface.
Definition at line 1211 of file pitch-functions.cc.
References OnlinePitchFeature::impl_, and OnlinePitchFeatureImpl::IsLastFrame().
|
virtual |
returns the feature dimension.
Returns the total number of frames, since the start of the utterance, that are now available. In an online-decoding context, this will likely increase with time as more data becomes available.
Implements OnlineFeatureInterface.
Definition at line 1204 of file pitch-functions.cc.
Referenced by kaldi::ComputeKaldiPitch(), kaldi::ComputeKaldiPitchFirstPass(), and kaldi::UnitTestPieces().
|
private |
Definition at line 324 of file pitch-functions.h.
Referenced by OnlinePitchFeature::AcceptWaveform(), OnlinePitchFeature::FrameShiftInSeconds(), OnlinePitchFeature::GetFrame(), OnlinePitchFeature::InputFinished(), OnlinePitchFeature::IsLastFrame(), and OnlinePitchFeature::~OnlinePitchFeature().