// file: csnr_cal_9.cc // // this function finds the maximum number in an array of numbers // // system include file // // local include file // #include "global_constants.h" #include "calculate_snr_constants.h" #include "calculate_snr.h" // function: calculate_max_cc // // arguments: // float* energy_buffer_a: (input) array of numbers // int num_energy_vals_a: (input) how many numbers in the array // // return: the end time of the file // // this function finds the end sample in the file // // float calculate_max_cc (float* energy_buffer_a, int num_energy_vals_a) { float max = CSNR_MAX_VAL; for (int i = 0; i < num_energy_vals_a; i++) { if (energy_buffer_a[i] > max) { max = energy_buffer_a[i]; } } // return the maximum value // return (max); }