// file: fbc_detect.C // // Detect feedback in frame of data. // #include "fbc.h" int fbc_detect_C (double* fft_out, float threshold, float bandwidth, float& center_freq, float max, int fft_num, float sample_frequency) { // Declare local variable for the magnitude of the fft // double* fft_mag = (double*)malloc(fft_num/2 * sizeof(double)); // Declare local variable for counting the max number of samples // int max_sample_num = 0; // Compute the magnitude of the fft, // The fft is in real and imaginary parts, 0: real 1: imaginaries, 2: // 3: imaginary, ... 2*k are reals, 2*k+1 are imaginaries. // for (int k = 0; k