// file: $SPEECH_HOME/util/calculate_lpc/v1.0/calculate_lpc.cc // // isip include file // #include "calculate_lpc.h" #include "calculate_lpc_constants.h" #include // main program // main(int_4 argc, char_1** argv) { // declare command line arguments // char_1* param_file = (char_1*)NULL; char_1* input_file = (char_1*)NULL; char_1* output_file = (char_1*)NULL; float_4 pre_emph=0; int_4 num_chan=0; float_4 window=0; int_4 sf=0; int_4 lp_order=0; float_4 center=0; int_4 method=0; // declare a debug parameter // int_4 debug_level = ISIP_DEBUG_NONE; // parse the command line // if (get_parameters_cc(argc, argv, param_file, input_file, output_file, debug_level, num_chan, window, pre_emph, lp_order, center, sf, method) == ISIP_FALSE) { fprintf(stdout, "%s: error in command line arguments\n", argv[0]); return ISIP_ERROR; } // check command line arguments before keep going on // if (input_file == (char_1*)NULL) { fprintf (stdout, "no input file given\n"); return ISIP_ERROR; } Signal signal; // load in parameter file // if (param_file != (char_1*)NULL) { if (signal.load_params_cc(param_file) != ISIP_TRUE) { fprintf(stdout, "error in computing LPC\n"); return ISIP_ERROR; } } // set command line values - command line values overwrite param // file values // signal.set_values_cc(num_chan, window, pre_emph, lp_order, center, sf); signal.set_window_method_cc(method); // set debug level // if (debug_level > 0) { signal.set_debug_cc(debug_level); } if (signal.compute_lpc_cc(input_file, output_file) != ISIP_TRUE) { fprintf(stdout, "error in computing LPC\n"); return ISIP_ERROR; } // delete the paramater, attribute, input, and output file // if (param_file != (char_1*)NULL) { delete [] param_file; } if (input_file != (char_1*)NULL) { delete [] input_file; } if (output_file != (char_1*)NULL) { delete [] output_file; } // exit gracefully // return ISIP_NO_ERROR; }