BiQuad Calculation for all-pass filter when using a micro-controller host processor
I am using the Parametric EQ filter block, controlled from a uC (RP2040).
I am already calculating 2nd order high/low/peaking/hi-shelf/low-shelf.
The https://wiki.analog.com/resources/tools-software/sigmastudio/toolbox/filters/general2ndorder#coefficient_calculations_on_dsp shows that it can be used for an All-Pass filter, but I do not see the calculation listed with the rest.
Is there a comprehensive set of calculations I can import into my C code that would work?
Audio Signal Processors
adau1452
sigma studio
hardware
SigmaDSP Audio Processors
Hello Todd_p,
Below is the formula for 2nd order all pass filter.
All Pass Values from control:
frequency (center frequency)
Q (Q of filter)
gain (gain in dB)
gain1 (linear gain)
fs (sample rate of project)
gain1 = 10(gain / 20)
omega = 2 * PI * frequency / fs
sins = Sin(omega)
coss = Cos(omega)
alpha = sins / (2 * Q)
norm = 1 + alpha
B0 = gain1 * (1 - alpha) / norm
B1 = gain1 * ( - 2 * coss) / norm
B2 = gain1 * (1 + alpha) / norm
A1 = - 2 * coss / norm
A2 = (1 - alpha) / norm
Below is the pic for your reference
This page has the audio cookbook for Biquad filters.
Regards,
Harish
Please log in to reply.

