// file: csnr_cal_6.cc // // this function calculates the pdf of the energy of the signal // // system include file // #include // local include file // #include "global_constants.h" #include "calculate_snr_constants.h" #include "calculate_snr.h" // function: calculate_pdf_cc // // arguments: // float**& pdf_a: (output) pdf of the energy of the signal // float** bin_freqs_a: (input) count of each bin // int num_energy_vals_a: (input) number of energy points in // the buffer // int num_chans_a: (input) number of channels // int debug_mode_a: (input) debug mode // // return: an int to indicate status // // this function calculates the pdf of the energy of a signal // // int calculate_pdf_cc (float**& pdf_a, int** bin_freqs_a, int num_energy_vals_a, int num_chans_a, int debug_mode_a) { for (int j = 0; j < num_chans_a; j++) { for (int i = 0; i < CSNR_NUM_BINS; i++) { pdf_a[j][i] = (float)bin_freqs_a[j][i] / num_energy_vals_a; } } 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 :: pdf = %.2f\n", j, pdf_a[j][i]); } } fprintf(stdout, "\n"); } // exit gracefully // return TRUE; }