// file: $SPEECH_HOMEWORK4/hw4/class/snr_ratio/v1.0/snr_cal_3.cc // // isip include files // #include "signal_noise_ratio.h" #include "signal_noise_ratio_constants.h" // method: calculate_energy_cc // // arguments: // float_4* buffer (input) the data to find energy // int_4 sample_per_window (input) the number of samples per window // float_4* energy (output) the energy values // // return: a logical_1 indicating status // logical_1 Signal::calculate_energy_cc (float_4* buffer_a, int_4 samples_per_window_a, int_4 energy_count_a, float_4* energy_a) { // loop over all channels // for (int_4 channel=0;channel < num_chans_d; channel++) { energy_a[channel] = 0; // loop over all samples // for (int_4 sample=0;sample 1) { for (int_4 i = 0; i < num_chans_d; i++) { fprintf(stdout, "energy value [%ld] = %.2f\n", energy_count_a, energy_a[i]); } } // exit gracefully // return ISIP_TRUE; }