26 int main(
int argc,
char *argv[]) {
28 using namespace kaldi;
31 "Add shifted delta cepstra (typically to raw mfcc or plp features\n" 32 "Usage: add-deltas-sdc [options] in-rspecifier out-wspecifier\n";
36 po.
Register(
"truncate", &truncate,
"If nonzero, first truncate features to this dimension.");
46 std::string rspecifier = po.
GetArg(1);
47 std::string wspecifier = po.
GetArg(2);
51 for (; !feat_reader.
Done(); feat_reader.
Next()) {
52 std::string key = feat_reader.
Key();
56 KALDI_WARN <<
"Empty feature matrix for key " << key;
63 <<
" is smaller than truncation dimension.";
68 feat_writer.
Write(key, new_feats);
71 }
catch(
const std::exception &e) {
72 std::cerr << e.what();
This code computes Goodness of Pronunciation (GOP) and extracts phone-level pronunciation feature for...
MatrixIndexT NumCols() const
Returns number of columns (or zero for empty matrix).
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...
int main(int argc, char *argv[])
void Write(const std::string &key, const T &value) const
void Register(const std::string &name, bool *ptr, const std::string &doc)
void Register(OptionsItf *opts)
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.
void ComputeShiftedDeltas(const ShiftedDeltaFeaturesOptions &delta_opts, const MatrixBase< BaseFloat > &input_features, Matrix< BaseFloat > *output_features)
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).
MatrixIndexT NumRows() const
Returns number of rows (or zero for empty matrix).
Sub-matrix representation.