Classes | |
struct | StateInfo |
Public Member Functions | |
void | Cleanup (PitchFrameInfo *prev_frame) |
This function resizes the arrays for this object and updates the reference counts for the previous object (by decrementing those reference counts when we destroy a StateInfo object). More... | |
void | SetBestState (int32 best_state, std::vector< std::pair< int32, BaseFloat > > &lag_nccf) |
This function may be called for the last (most recent) PitchFrameInfo object with the best state (obtained from the externally held forward-costs). More... | |
int32 | ComputeLatency (int32 max_latency) |
This function may be called on the last (most recent) PitchFrameInfo object; it computes how many frames of latency there is because the traceback has not yet settled on a single value for frames in the past. More... | |
bool | UpdatePreviousBestState (PitchFrameInfo *prev_frame) |
This function updates. More... | |
PitchFrameInfo (int32 num_states) | |
This constructor is used for frame -1; it sets the costs to be all zeros the pov_nccf's to zero and the backpointers to -1. More... | |
PitchFrameInfo (PitchFrameInfo *prev) | |
This constructor is used for subsequent frames (not -1). More... | |
void | SetNccfPov (const VectorBase< BaseFloat > &nccf_pov) |
Record the nccf_pov value. More... | |
void | ComputeBacktraces (const PitchExtractionOptions &opts, const VectorBase< BaseFloat > &nccf_pitch, const VectorBase< BaseFloat > &lags, const VectorBase< BaseFloat > &prev_forward_cost, std::vector< std::pair< int32, int32 > > *index_info, VectorBase< BaseFloat > *this_forward_cost) |
This constructor is used for frames apart from frame -1; the bulk of the Viterbi computation takes place inside this constructor. More... | |
Private Attributes | |
std::vector< StateInfo > | state_info_ |
int32 | state_offset_ |
the state index of the first entry in "state_info"; this will initially be zero, but after cleanup might be nonzero. More... | |
int32 | cur_best_state_ |
The current best state in the backtrace from the end. More... | |
PitchFrameInfo * | prev_info_ |
The structure for the previous frame. More... | |
Definition at line 198 of file pitch-functions.cc.
|
explicit |
This constructor is used for frame -1; it sets the costs to be all zeros the pov_nccf's to zero and the backpointers to -1.
Definition at line 287 of file pitch-functions.cc.
PitchFrameInfo | ( | PitchFrameInfo * | prev | ) |
This constructor is used for subsequent frames (not -1).
Definition at line 295 of file pitch-functions.cc.
void Cleanup | ( | PitchFrameInfo * | prev_frame | ) |
This function resizes the arrays for this object and updates the reference counts for the previous object (by decrementing those reference counts when we destroy a StateInfo object).
A StateInfo object is considered to be destroyed when we delete it, not when its reference counts goes to zero.
Definition at line 546 of file pitch-functions.cc.
References KALDI_ERR.
void ComputeBacktraces | ( | const PitchExtractionOptions & | opts, |
const VectorBase< BaseFloat > & | nccf_pitch, | ||
const VectorBase< BaseFloat > & | lags, | ||
const VectorBase< BaseFloat > & | prev_forward_cost, | ||
std::vector< std::pair< int32, int32 > > * | index_info, | ||
VectorBase< BaseFloat > * | this_forward_cost | ||
) |
This constructor is used for frames apart from frame -1; the bulk of the Viterbi computation takes place inside this constructor.
opts | The options as provided by the user |
nccf_pitch | The nccf as computed for the pitch computation (with ballast). |
nccf_pov | The nccf as computed for the POV computation (without ballast). |
lags | The log-spaced lags at which nccf_pitch and nccf_pov are sampled. |
prev_frame_forward_cost | The forward-cost vector for the previous frame. |
index_info | A pointer to a temporary vector used by this function |
this_forward_cost | The forward-cost vector for this frame (to be computed). |
Definition at line 306 of file pitch-functions.cc.
References VectorBase< Real >::AddVec(), kaldi::ComputeLocalCost(), PitchFrameInfo::cur_best_state_, VectorBase< Real >::Data(), PitchExtractionOptions::delta_pitch, VectorBase< Real >::Dim(), rnnlm::i, rnnlm::j, kaldi::kUndefined, kaldi::Log(), PitchExtractionOptions::penalty_factor, and PitchFrameInfo::state_info_.
This function may be called on the last (most recent) PitchFrameInfo object; it computes how many frames of latency there is because the traceback has not yet settled on a single value for frames in the past.
It actually returns the minimum of max_latency and the actual latency, which is an optimization because we won't care about latency past a user-specified maximum latency.
Definition at line 514 of file pitch-functions.cc.
References KALDI_ASSERT, PitchFrameInfo::prev_info_, PitchFrameInfo::state_info_, and PitchFrameInfo::state_offset_.
This function may be called for the last (most recent) PitchFrameInfo object with the best state (obtained from the externally held forward-costs).
It traces back as far as needed to set the cur_best_state_, and as it's going it sets the lag-index and pov_nccf in pitch_pov_iter, which when it's called is an iterator to where to put the info for the final state; the iterator will be decremented inside this function.
Definition at line 486 of file pitch-functions.cc.
References PitchFrameInfo::cur_best_state_, KALDI_ASSERT, PitchFrameInfo::prev_info_, PitchFrameInfo::state_info_, and PitchFrameInfo::state_offset_.
void SetNccfPov | ( | const VectorBase< BaseFloat > & | nccf_pov | ) |
Record the nccf_pov value.
nccf_pov | The nccf as computed for the POV computation (without ballast). |
Definition at line 299 of file pitch-functions.cc.
References VectorBase< Real >::Dim(), rnnlm::i, KALDI_ASSERT, and PitchFrameInfo::state_info_.
bool UpdatePreviousBestState | ( | PitchFrameInfo * | prev_frame | ) |
This function updates.
|
private |
The current best state in the backtrace from the end.
Definition at line 278 of file pitch-functions.cc.
Referenced by PitchFrameInfo::ComputeBacktraces(), and PitchFrameInfo::SetBestState().
|
private |
The structure for the previous frame.
Definition at line 281 of file pitch-functions.cc.
Referenced by PitchFrameInfo::ComputeLatency(), and PitchFrameInfo::SetBestState().
|
private |
Definition at line 272 of file pitch-functions.cc.
Referenced by PitchFrameInfo::ComputeBacktraces(), PitchFrameInfo::ComputeLatency(), PitchFrameInfo::SetBestState(), and PitchFrameInfo::SetNccfPov().
|
private |
the state index of the first entry in "state_info"; this will initially be zero, but after cleanup might be nonzero.
Definition at line 275 of file pitch-functions.cc.
Referenced by PitchFrameInfo::ComputeLatency(), and PitchFrameInfo::SetBestState().