48 for (
int32 t = 0; t < T; t++) {
51 for (
int32 t2 = t - context; t2 <= t + context; t2++) {
52 if (t2 >= 0 && t2 < T) {
54 if (log_energy_data[t2] > energy_threshold)
59 (*output_voiced)(t) = 1.0;
61 (*output_voiced)(t) = 0.0;
This code computes Goodness of Pronunciation (GOP) and extracts phone-level pronunciation feature for...
Base class which provides matrix operations not involving resizing or allocation. ...
void Resize(MatrixIndexT length, MatrixResizeType resize_type=kSetZero)
Set vector to a specified size (can be zero).
BaseFloat vad_energy_mean_scale
BaseFloat vad_proportion_threshold
Real * Data()
Returns a pointer to the start of the vector's data.
Real Sum() const
Returns sum of the elements.
void CopyColFromMat(const MatrixBase< OtherReal > &M, MatrixIndexT col)
Extracts a column of the matrix M.
A class representing a vector.
#define KALDI_ASSERT(cond)
MatrixIndexT NumRows() const
Returns number of rows (or zero for empty matrix).
BaseFloat vad_energy_threshold
void ComputeVadEnergy(const VadEnergyOptions &opts, const MatrixBase< BaseFloat > &feats, Vector< BaseFloat > *output_voiced)
Compute voice-activity vector for a file: 1 if we judge the frame as voiced, 0 otherwise.