// file: fbc_coef.C // // Compute the coeffients for the filter for one frame of data. // #include "fbc.h" int fbc_coef_C(float center_freq, float sample_frequency, float bandwidth, float& a1, float& a2, float& b1, float& b2){ // compute normalized values of bandwidth and center frequency // float bw = 2 * 3.14 * bandwidth / sample_frequency; float cf = 2 * 3.14 * center_freq / sample_frequency; // compute coefiecients // a1 = -2.0 * bw * cos(cf); b1 = -2.0 * cos(cf); a2 = bw * bw; b2 = 1.0; /* printf("sample_freq: %f\n",sample_frequency); printf("center: %f\n",center_freq); printf("bandwidth: %f\n",bandwidth); printf("a1: %f\n",a1); printf("a2: %f\n",a2); printf("b1: %f\n",b1); printf("b2: %f\n",b2); */ // exit gracefully // return L_TRUE; }