# PeakEq center frequency does not match frequency response

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.

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.

• Your coefficients looks to be OK (gives right response in Octave) so, maybe it's an issue in your analyzing ... – Juha P Jun 24 '17 at 18:51
• @JuhaP edited the question, but it is not a analyzing issue, i was able to hear the issue. – Victor Aurélio Jun 24 '17 at 21:08
• 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$? – robert bristow-johnson Jun 24 '17 at 21:37
• @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. – Juha P Jun 25 '17 at 6:30
• @robertbristow-johnson added to the question. – Victor Aurélio Jun 25 '17 at 22:08