0
$\begingroup$

Following the Cookbook i calculed these coefficients:

b0: 1,001511976106398860153
b1: -1,999957163328258458179
b2: 0,998488023893601139847
a0: 1,000379791226643000357
a1: -1,999957163328258458179
a2: 0,999620208773356999643

For Fs = 48000, Fc = 50, Q = 4.318477, dbGain = 12.

Applying a pink noise and analyzing the frequency response showed me that the real center frequency is approx. 93 Hz

What i want is know why this happened and how to get right center frequency.

This is actually frequency response. Frequency Response

The code used to implement is the following:

double filter(double in)
{

    double y = .0;

    y = (b0 / a0) * in + (b1 / a0) * xb[0] + (b2 / a0) * xb[1]
        - (a1 / a0) * yb[0] - (a2 / a0) * yb[1];

    yb[1] = yb[0];
    yb[0] = y;
    xb[1] = xb[0];
    xb[0] = in;

    return y;
}

xb and yb are two double arrays.

$\endgroup$
  • $\begingroup$ Your coefficients looks to be OK (gives right response in Octave) so, maybe it's an issue in your analyzing ... $\endgroup$ – Juha P Jun 24 '17 at 18:51
  • $\begingroup$ @JuhaP edited the question, but it is not a analyzing issue, i was able to hear the issue. $\endgroup$ – Victor Aurélio Jun 24 '17 at 21:08
  • $\begingroup$ could be an implementation issue. can you show the code that implements $$ y[n] = b_0 x[n]+b_1 x[n-1]+b_2 x[n-2]-a_1 y[n-1]-a_2 y[n-2] $$?? are you dividing the other five coefficients by $a_0$? $\endgroup$ – robert bristow-johnson Jun 24 '17 at 21:37
  • $\begingroup$ @Victor Paste the coefficients to applet here: earlevel.com/main/2016/12/08/filter-frequency-response-grapher and set the fs and plot parameters to see it's not the coefficients behind the issue you're having there. $\endgroup$ – Juha P Jun 25 '17 at 6:30
  • $\begingroup$ @robertbristow-johnson added to the question. $\endgroup$ – Victor Aurélio Jun 25 '17 at 22:08

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.