// file: csnr_gp_0.cc // // this is the function that parses the command line arguments // // system include file // #include #include // local include file // #include "global_constants.h" #include "calculate_snr_constants.h" #include "calculate_snr.h" // function: get_parameters_cc // // arguments: // char* datafile_a: (output) file that contains the signal // float& frame_size_a: (output) duration of frame // float& window_size_a: (output) duration of window // float& sample_freq_a: (output) sample frequency // int& num_chans_a: (output) number of channels // float& noise_threshold_a: (output) threshold of noise // float& signal_threshold_a: (output) threshold of signal+noise // int& debug_mode_a: (output) debug mode // char** argv_a: (input) list of command line arguments // int argc_a: (input) number of command line arguments // // return: an int to indicate status // // this function parses the command line arguments // // int get_parameters_cc (char* datafile_a, float& frame_size_a, float& window_size_a, float& sample_freq_a, int& num_chans_a, float& noise_threshold_a, float& signal_threshold_a, int& debug_mode_a, char** argv_a, int argc_a) { // if no arguments are given then print out a help message // if (argc_a == 1) { char tmp_string [MAX_STRING_LENGTH]; sprintf((char*)tmp_string, (char*)HELP_FORMAT, (char*)CSNR_HELP_FILE); system((char*)tmp_string); // exit gracefully // exit (NO_ERROR); } for (int i=1; i