Is it possible to remap an IIR prototype filter to shelving/Notch/Peaking filters?

DSP, Plugin and Host development discussion.
RELATED
PRODUCTS

Post

Music Engineer wrote: Sun Jan 14, 2024 5:48 pm
mystran wrote: Fri Jan 12, 2024 9:22 pm I'm not sure how to go about with designs that have zeroes.. but for all-pole prototypes (Bessel, LR, Butterworth, Cheb1?) you can basically take the poles, place zeroes at the same locations and then offset the poles and zeroes
The procedure that I describe here:

http://rs-met.com/documents/dsp/LowShel ... otypes.pdf

should work for filters with (finite) zeros, too.
Seems pretty complicated (read: involves solving an equation that perhaps might not be numerically stable) though.

The beauty of the method I outlined (that works with all-poles only though) is that a transform of a product of individual poles is the same as the product of transforms of individual poles.. so you take an array of normalized s-plane series biquads (+lone pole if any; you could do it all as lone complex poles, but biquads is kinda easier), you apply LP->Shelf or LP->Peak transforms to each biquad (+lone pole if any) individually (with gain scaled taking the order into account), then pick a cutoff (eg. prewarp constant in case of BLT) and convert to digital using whatever method (eg. BLT or MZTi or whatever).

Does not care where the prototype poles come from. Does not care how the transform to digital is done. More importantly: input is biquads, output is biquads... and biquads are numerically nice and it's usually not a huge problem to design for series biquads directly. Further, if the biquads are implemented as trapezoidal SVF (which is numerically even nicer) then BLT becomes trivial too and the only "complicated" part of the whole thing is really just the numerical LP->BP transform... which you only need to do for biquads (and well.. lone poles for odd order prototypes, but that's the usual 2nd order BP formula). Easy to write the whole thing as general method that works for order 2 and works for order 42.

These designs are also naturally gain symmetric (assuming shelf cutoff and peak Q is taken as the gain midpoint RBJ style) which due to the nature of how they are designed also makes them kinda shape symmetric; I don't have a proof at hand that both sides of a Butterworth shelf are maximally flat, but they sure look like that visually.

It's basically the beauty and elegance of this whole thing which is why I never bothered thinking too hard about prototypes that would have finite zeroes.. because might just as well bump order if we need more shape flexibility. Once you insist on zeroes.. it all becomes a mess.

Post

Yes - that's right. The one thing that I really do not like about this method is that it has to go through the coefficient representations of the (numerator and denominator) polynomials rather than operating directly on the zeros/poles/gain representation (called "zpk" in Matlab) - implying a back-and-forth conversion between the two forms, i.e. involving a polynomial root-finder.

Edit: although, on the other hand, a Bessel design procedure - as do many others - actually starts out with the coefficient form anyway (unless one uses tabulated poles), so you don't really have to go through a silly zpk -> coeffs -> (LP -> LS) -> zpk -> ... filter design pipepline but just through coeffs -> (LP -> LS) -> zpk -> ... so it may actually not be that bad after all. It's just the one root-finding step that you have to do anyway - you just need to do some additional pre-processing on the polynomial coeffs before invoking the root finder.
Last edited by Music Engineer on Mon Jan 15, 2024 6:34 pm, edited 2 times in total.
My website: rs-met.com, My presences on: YouTube, GitHub, Facebook

Post

Music Engineer wrote: Sun Jan 14, 2024 9:47 pm Yes - that's right. The one thing that I really do not like about this method is that it has to go through the coefficient representations of the (numerator and denominator) polynomials rather than operating directly on the poles and zeros - implying a back-and-forth conversion between the two forms, i.e. involving a polynomial root-finder.
If I understand mystran (and maybe I'm completely off), but you don't need to swap between a (pole/zero/gain) formulation and a polynomial ratio, but just between pole/zero/gain and (biquads + optionally lone pole) formulation, which should be pretty numerically stable. - edit - I see now after reading your paper - you were referring to your method, not mystran's. Yours works with any kind of filter including ones with zeros, but the result needs to checked for stability. Got it.

Is the reason that mystran's method won't work for filter prototypes with zeros is because in the more general case, some zero placement when converted to poles might cause instability?

Post

AnalogGuy1 wrote: Sun Jan 14, 2024 11:05 pm Is the reason that mystran's method won't work for filter prototypes with zeros is because in the more general case, some zero placement when converted to poles might cause instability?
Not really. The reason is much more mundane: it's specifically designed to derive the zeroes from the poles to get symmetry. As long as your zeroes are strictly(!) minimum-phase you could theoretically double the order and pair the original filter with it's inverse, but I'm not really convinced that the resulting filters are "better" in any sense than just restricting yourself to all-poles only.

Post

The polynomial ratio approach (if I understand correctly, what mystran is talking about) not only becomes questionable if there are zeros anywhere but the origin, but fails completely if the zeros are on the imaginary axis (as it is with elliptic designs). Elliptic designs might be particularly desirable, since they allow steeper gains at smaller filter orders, as well as variable slope (trading slope against ripples). Slope variation is also possible with 2nd kind Butterworth approach.

Correction: probably it's not so much about zeros, but rather about ripples in the response. Especially in the stop band ripples create problems upon reciprocation.

Post Reply

Return to “DSP and Plugin Development”