// file: csnr_cal_7.cc // // this function calculates the cdf of the energy of the signal // // system include file // #include #include // local include file // #include "global_constants.h" #include "calculate_snr_constants.h" #include "calculate_snr.h" // function: calculate_cdf_cc // // arguments: // float**& cdf_a: (output) cdf of the energy of the signal // float** pdf_a: (input) pdf of the energy of the signal // int num_chans_a: (input) number of channels // int debug_mode_a: (input) debug level // // return: an int to indicate status // // this function calculates the cdf of the energy of a signal // // int calculate_cdf_cc (float**& cdf_a, float** pdf_a, int num_chans_a, int debug_mode_a) { for (int j = 0; j < num_chans_a; j++) { cdf_a[j][0] = pdf_a[j][0]; // loop over all bins // for (int i = 1; i < CSNR_NUM_BINS; i++) { cdf_a[j][i] = pdf_a[j][i] + cdf_a[j][i - 1]; } } if (debug_mode_a > DEBUG_BRIEF) { for (int j = 0; j < num_chans_a; j++) { for (int i = 0; i < CSNR_NUM_BINS; i++) { fprintf(stdout, "chan %d :: cdf = %.2f\n", j, cdf_a[j][i]); } } fprintf(stdout, "\n"); } // exit gracefully // return TRUE; }