pitch-functions.cc File Reference
#include <algorithm>
#include <limits>
#include "feat/feature-functions.h"
#include "feat/mel-computations.h"
#include "feat/online-feature.h"
#include "feat/pitch-functions.h"
#include "feat/resample.h"
#include "matrix/matrix-functions.h"
Include dependency graph for pitch-functions.cc:

Go to the source code of this file.

Classes

class  PitchFrameInfo
 
struct  PitchFrameInfo::StateInfo
 
struct  NccfInfo
 
class  OnlinePitchFeatureImpl
 

Namespaces

 kaldi
 This code computes Goodness of Pronunciation (GOP) and extracts phone-level pronunciation feature for mispronunciations detection tasks, the reference:
 

Functions

BaseFloat NccfToPovFeature (BaseFloat n)
 This function processes the NCCF n to a POV feature f by applying the formula f = (1.0001 - n)^0.15 - 1.0 This is a nonlinear function designed to make the output reasonably Gaussian distributed. More...
 
BaseFloat NccfToPov (BaseFloat n)
 This function processes the NCCF n to a reasonably accurate probability of voicing p by applying the formula: More...
 
void ComputeCorrelation (const VectorBase< BaseFloat > &wave, int32 first_lag, int32 last_lag, int32 nccf_window_size, VectorBase< BaseFloat > *inner_prod, VectorBase< BaseFloat > *norm_prod)
 This function computes some dot products that are required while computing the NCCF. More...
 
void ComputeNccf (const VectorBase< BaseFloat > &inner_prod, const VectorBase< BaseFloat > &norm_prod, BaseFloat nccf_ballast, VectorBase< BaseFloat > *nccf_vec)
 Computes the NCCF as a fraction of the numerator term (a dot product between two vectors) and a denominator term which equals sqrt(e1*e2 + nccf_ballast) where e1 and e2 are both dot-products of bits of the wave with themselves, and e1*e2 is supplied as "norm_prod". More...
 
void SelectLags (const PitchExtractionOptions &opts, Vector< BaseFloat > *lags)
 This function selects the lags at which we measure the NCCF: we need to select lags from 1/max_f0 to 1/min_f0, in a geometric progression with ratio 1 + d. More...
 
void ComputeLocalCost (const VectorBase< BaseFloat > &nccf_pitch, const VectorBase< BaseFloat > &lags, const PitchExtractionOptions &opts, VectorBase< BaseFloat > *local_cost)
 This function computes the local-cost for the Viterbi computation, see eq. More...
 
void ComputeKaldiPitchFirstPass (const PitchExtractionOptions &opts, const VectorBase< BaseFloat > &wave, Matrix< BaseFloat > *output)
 This function is called from ComputeKaldiPitch when the user specifies opts.simulate_first_pass_online == true. More...
 
void ComputeKaldiPitch (const PitchExtractionOptions &opts, const VectorBase< BaseFloat > &wave, Matrix< BaseFloat > *output)
 This function extracts (pitch, NCCF) per frame, using the pitch extraction method described in "A Pitch Extraction Algorithm Tuned for Automatic Speech Recognition", Pegah Ghahremani, Bagher BabaAli, Daniel Povey, Korbinian Riedhammer, Jan Trmal and Sanjeev Khudanpur, ICASSP 2014. More...
 
template<typename Real >
void AppendVector (const VectorBase< Real > &src, Vector< Real > *dst)
 
void ProcessPitch (const ProcessPitchOptions &opts, const MatrixBase< BaseFloat > &input, Matrix< BaseFloat > *output)
 This function processes the raw (NCCF, pitch) quantities computed by ComputeKaldiPitch, and processes them into features. More...
 
void ComputeAndProcessKaldiPitch (const PitchExtractionOptions &pitch_opts, const ProcessPitchOptions &process_opts, const VectorBase< BaseFloat > &wave, Matrix< BaseFloat > *output)
 This function combines ComputeKaldiPitch and ProcessPitch. More...