1st order All Pass Filter formula for phase adjustment
Hello,
Since I want to use 1st order All Pass Filter to build the adjustable phase function,
the old post has the other way to get 0/90/180/270 degree, but what I want is more precisely so I search the forum, the 1st order all pass filter will generate the 90 degree phase change, if I want 180 degree, I only cascade two block to get the answer.
I refer the KJBob calculation excel, but I don't see the all pass filter 1st order formula.
If I want to use IIR block to implement the adjustable phase(frequency by frequency adjust) by the 1st order all pass filter, I need to know how to calculate it.
Anyone can help me? What is the correct formula for the 1st order all pass filter?
Thank you!
Alvis.
Audio Signal Processors
software
microcontroller
1st order all pass filter
SigmaDSP Audio Processors
adau1761
4.6
phase
Show More
Hello Alvis,
It's been a long time since I've been on, since nowadays most all the questions here go over my head. Yet since you kindly mentioned me, I'll try to help.
The attached spreadsheet has the First Order All-Pass Filter coefficients added. I also reworked the order and name of the coefficients to match SigmaStudio's nomenclature as seen in the IIR Coefficient type-in box. As always, flip the signs of the A coefficients when loading them into your DSP. I made the example below by entering 1 KHz as the filter's "cutoff" frequency into the spreadsheet, then typing the resulting coefficients into the General Second-Order IIR Coefficient filter (setting its B2 and A2 coefficients to zero makes it first-order):
The revised spreadsheet is attached.
5811.1st-2nd-Order_IIR_Coefficient_Calculator.zip
Best regards,
Bob
Hello Bob,
Thank you for your kindly reply!!
This spreadsheet really help me a lot!!
I will try and integrate in to mine code!
Thank you again!
Best Regards,
Alvis.
Hello KJBob ,
The all pass filter formula really help me a lot!
I have another question, if I want to use 1st order all pass filter to get other degree phase adjustment, how should I do?
Like 15 or 30 degree with 1st order all pass filter, does it have another formula for the 1st order all pass filter?
Regards,
Alvis.
Hello Alvis,
As you can see from the response graph above, the filter's phase shift varies with frequency. The formula for calculating the phase lag p of a first-order allpass filter of cutoff frequency fo with an input of frequency f is:
p = 2 arctan (f/fo)
To design a filter that gives a desired phase lag p at frequency f, we can work this formula backwards and obtain the needed fo for this filter:
fo = f / tan (p/2) Note: the tangent function needs to match your units (degrees or radians)
For example, to get a filter having a phase lag of 30 degrees at 100 Hz, make this filter:
fo = 100 / tan (30/2) = 373.21 Hz
Once you have fo, use the spreadsheet formulas to get your coefficients.
Best regards,
Bob
Hello Bob,
Thank you!
I have add the formula into the spreadsheet and verify in sigma studio, it works perfectly!!
Thank you again!
Regards,
Alvis.
Hello Bob,
Is your above algorithm also applicable to the second-order All-pass filter?
Can the All-pass filter make the signal phase of the whole sound field lag (0 °~360 °)?
Best regards,
Gavin
Please log in to reply.
