0
$\begingroup$

Using formula on Audio EQ Cookbook I implemented biquad IIR filters in Excel.

As in my previous question Phase Response Function / Plotting in Excel (IIR Filter), Hilmar helped a lot with the phase formula and Robert Britsow Johnson mentioned about unwrapping the response.

Now I'm able to calculate phase response with parametrics and shelvings.

But when I applied allpass filter, there is something wrong with the phase response.

If I apply -360 to formula at the frequencies about 5kHz, response is more like it should be. But I can not apply this to all frequencies. So I tried to change formula with mod of -360 after I subtrack 360.

My first question is; It looks ok but, is it correct?

Secondly; Should I apply this "MOD(phase,-360) to every other filter? Or just to final sum, total phase?

Third one; How can I change the response with wrapped-unwrapped form?

And lastly; I'm summing all phase responses of all filters with simple summation. Is this a correct calculation of final phase response?

Formula;

=IFERROR(MOD((ATAN2(O$17+O$18*COS(Table4[@[w]:[w]])+O$19*COS(2*Table4[@[w]:[w]]);-O$18*SIN(Table4[@[w]:[w]])-O$19*SIN(2*Table4[@[w]:[w]]))-
ATAN2(O$20+O$21*COS(Table4[@[w]:[w]])+O$22*COS(2*Table4[@[w]:[w]]);-O$21*SIN(Table4[@[w]:[w]])-O$22*SIN(2*Table4[@[w]:[w]])))/(PI())*180-360;-360);0)

fc = 1kHz, Q = 1
Coefs are;

B0  0,983640459
B1  -1,998929175
B2  1,016359541
A0  1,016359541
A1  -1,998929175
A2  0,983640459

Incorrect phase response; Incorrect phase response

$\endgroup$

1 Answer 1

1
$\begingroup$

There are bunch of issues there.

The phase calculation I provided in the original answer can have wrapping problems even for a single biquad. I've updated the answer with an alternative that should work for most biquads.

Unwrapping can certainly be helpful. In order to do this, you should sample the phase response on a "sufficiently dense" grid. Look at the phase differene to the previous frequency. If it's larger than $\pi$ subtract $2\pi$ and if it's less than $-\pi$ add $2\pi$

My first question is; It looks ok but, is it correct?

Generally that's not correct.

Secondly; Should I apply this "MOD(phase,-360) to every other filter? Or just to final sum, total phase?

You can, but it's better if you apply the unwrapping process define above.

Third one; How can I change the response with wrapped-unwrapped form?

See description of unwrapping process

And lastly; I'm summing all phase responses of all filters with simple summation. Is this a correct calculation of final phase response?

Yes. It's best to unwrap all the individual responses before summing them.

$\endgroup$
1

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.