Normalization to 0dB of filter.

DSP, Plug-in and Host development discussion.
rafa1981
KVRian
673 posts since 4 Jan, 2007
Even with my total lack of fundamentals, I might give a go to implementing a crossover based on this:
https://www.vicanek.de/articles/ReverseIIR.pdf

I'm going step by step. As of now I'm trying to implement a Butterworth based on individual complex single pole and single zero filters. Then I might start with a single linear-phase Butterworth, then adding the crossovers, etc.

Copying from here and there (DSPFilters, csound, etc.) It seems that I'm almost there. I now have a Butteworth filter computed via BLT using individual complex 1 pole and 1 zero filters. It works but the magnitude is way off, as I didn't normalize it.

I have seen code that normalizes the gain based on the biquad coefficients, but how to do it in a generalized way? Music Engineer
KVRAF
4016 posts since 8 Mar, 2004 from Berlin, Germany
if your design formulas do not automatically give you the desired unit gain, you can always just evaluate the gain at the frequency where it's supposed to be unity* and then scale all feedforward coeffs by the reciprocal of that (assuming direct form - otherwise, you can just scale input or output). a bit more care has to be taken for filters with passband ripple (cheby or elliptic). for example, in a lowpass, if the ripple is such that you have a dip at DC (iirc, it happens for even order), you have to take that into account, too. in this case, the amount of the dip is known from the design specs - it is the ripple

(*) which is DC for lowpass, nyquist for highpass (assuming BLT) , for bandreject you can use either of the two, for bandpass, it's the (prewarped) center freq (again assuming BLT)

mystran
KVRAF
6758 posts since 12 Feb, 2006 from Helsinki, Finland
rafa1981 wrote:
Wed Dec 08, 2021 12:40 pm
I have seen code that normalizes the gain based on the biquad coefficients, but how to do it in a generalized way?
As Robin already pointed out, you just compute the magnitude response at whatever frequency you want to normalize. Most likely the normalization based on biquad coefficients that you've seen is simply the result of substituting z=1 (=normalize at DC) or z=-1 (=normalize at Nyquist) into the transfer function and applying some algebraic simplification.
Preferred pronouns would be "it/it" because according to this country, I'm a piece of human trash.

rafa1981
KVRian

Topic Starter

673 posts since 4 Jan, 2007
Thanks. It was really trivial high school math. All I needed was to find this formula, then finding K for Z = 1:

H(z) = K * (z - zero1) (z - zero2) ... ( z - zeroN) / (z - pole1) (z - pole2) ... ( z - poleN)