28 int main(
int argc,
char *argv[]) {
30 using namespace kaldi;
32 "Post-process Kaldi pitch features, consisting of pitch and NCCF, into\n" 33 "features suitable for input to ASR system. Default setup produces\n" 34 "3-dimensional features consisting of (pov-feature, pitch-feature,\n" 35 "delta-pitch-feature), where pov-feature is warped NCCF, pitch-feature\n" 36 "is log-pitch with POV-weighted mean subtraction over 1.5 second window,\n" 37 "and delta-pitch-feature is delta feature computed on raw log pitch.\n" 38 "In general, you can select from four features: (pov-feature, \n" 39 "pitch-feature, delta-pitch-feature, raw-log-pitch), produced in that \n" 40 "order, by setting the boolean options (--add-pov-feature, \n" 41 "--add-normalized-log-pitch, --add-delta-pitch and --add-raw-log-pitch)\n" 43 "Usage: process-kaldi-pitch-feats [options...] <feat-rspecifier> <feats-wspecifier>\n" 45 "e.g.: compute-kaldi-pitch-feats [args] ark:- | process-kaldi-pitch-feats ark:- ark:feats.ark\n" 47 "See also: compute-kaldi-pitch-feats, compute-and-process-kaldi-pitch-feats\n";
56 po.
Register(
"srand", &srand_seed,
"Seed for random number generator, used to " 57 "add noise to delta-log-pitch features");
68 std::string feat_rspecifier = po.
GetArg(1),
69 feat_wspecifier = po.
GetArg(2);
75 for (; !feat_reader.
Done(); feat_reader.
Next()) {
76 std::string utt = feat_reader.
Key();
82 feat_writer.
Write(utt, processed_feats);
85 KALDI_LOG <<
"Post-processed pitch for " << num_done <<
" utterances.";
86 return (num_done != 0 ? 0 : 1);
87 }
catch(
const std::exception &e) {
88 std::cerr << e.what();
This code computes Goodness of Pronunciation (GOP) and extracts phone-level pronunciation feature for...
int main(int argc, char *argv[])
void PrintUsage(bool print_command_line=false)
Prints the usage documentation [provided in the constructor].
A templated class for writing objects to an archive or script file; see The Table concept...
void Write(const std::string &key, const T &value) const
void Register(const std::string &name, bool *ptr, const std::string &doc)
The class ParseOptions is for parsing command-line options; see Parsing command-line options for more...
A templated class for reading objects sequentially from an archive or script file; see The Table conc...
int Read(int argc, const char *const *argv)
Parses the command line options and fills the ParseOptions-registered variables.
std::string GetArg(int param) const
Returns one of the positional parameters; 1-based indexing for argc/argv compatibility.
int NumArgs() const
Number of positional parameters (c.f. argc-1).
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.
void Register(ParseOptions *opts)