How to get magnitude values for a Parametric EQ?

Viewed 139

I was doing pretty well with analog filters, but I can't seem to get similar results with digital filters.

Here's what I tried first. Link to my xlsx data.

%% load stuff
M = readtable('dB Technologies T4 PS1.xlsx','Sheet','TF');

%% create filter
Fs = 96e3;
N1 = 2;
G  = -5; % 5 dB
Wo = 100/(Fs/2);
BW = 4000/(Fs/2); % Need to figure out how to insert BW in octaves.
[b,a] = designParamEQ(N1,G,Wo,BW);

%% calculate magnitude response
w = M.Frequency_Hz;
h = freqz(b,a,w);
magdB = mag2db(abs(h));

That didn't work. Here's the result:

Magnitude of Bessel vs Parametric filter

So I tried to create a biquad filter from the parametric filter.

BQ = dsp.BiquadFilter('SOSMatrix',[b.',[1,a.']]);
h = freqz(BQ);

That didn't work either. Obviously I have a lot to learn on how filters work, but I'm not sure where to look to find the simple result I want of calculating the magnitude based on a given frequency resolution.

I thought maybe it had something to do with my frequency needing to be converted to radians per sample...

wRad = w*((2*pi)/(Fs/2));

But that didn't work either. What am I missing here?

By the way, I was able to visualize the BQ filter with fvtool, so I could see it was working. I just haven't been able to get a magnitude response from it.

0 Answers
Related