Page 1 of 4

Matched Lowpass Filter

PostPosted: Fri Sep 11, 2015 11:07 pm
by martinvicanek
Biquads are simple filters with 5 coefficients a1, a2, b0, b1, b2. These five coefficients determine the filter's transfer function, which can be a lowpass, bandpass, bandstop etc. Filter design methods exist to determine the coefficients for a specified filter characteristic, the most simple being the so-called bilinear transform (BLT). The famous RBJ Cookbook provides closed form expressions based on the BLT for the coefficients for some standard filter types.

One problem with the BLT is frequency warping towards the Nyquist frequency. For a lowpass filter with a resonant peak the effect is a steeper than nominal (12 dB/octave) fallof for high cutoff frequencies, and a narrowing of the resonant peak. Note that analog filters do not have this problem.
MatchedLowpass.png
MatchedLowpass.png (32.98 KiB) Viewed 56570 times

Oversampling provides remedy but at a high CPU cost. It turns out that that a very good analog-like constant-Q approximation can be obtained by choosing appropriate coefficients. There is some literature on that, however I have come up with my own solution that I am quite happy with.

I took the poles from impulse nvariant mapping of the analog filter prototype, whereas the zeros are fitted by least squares and then approximated by a suitable function. It turned out that it is sufficient to account for one zero only.

Here is the result. Besides the direct form I also implemented a complex resonator topology which is superior at low frequencies and allows fast modulation.

Have fun!

Re: Matched Lowpass Filter

PostPosted: Sat Sep 12, 2015 7:10 pm
by BobF
BobsMV_matchedLP2HP&BP.fsm
(90.85 KiB) Downloaded 2410 times

Hi Martin,

Again, very much appreciated! Wow, I like these filters.
Just playing around, since I can NOT program, I created these from your low pass. A high pass and band pass, what do you think? Are they ok and usable?

Later then, BobF.....

Re: Matched Lowpass Filter

PostPosted: Sun Sep 13, 2015 9:40 pm
by KG_is_back
I was looking for this type of thing for ages... I understand the phylosophy behind it, by my math skills hit wall when I see the "H(z)=sflgjsdfogaspovmfbpnfb"-type of thing... Thanks Martin for sharing this!

Re: Matched Lowpass Filter

PostPosted: Mon Sep 14, 2015 9:21 am
by tulamide
He never disappoints me. Each new post is like a new magician's trick and I mostly look at it like so: :o

Re: Matched Lowpass Filter

PostPosted: Sun Nov 08, 2015 10:43 pm
by tester
Nice!

Matched Biquad Filters

PostPosted: Sun Feb 14, 2016 10:48 am
by martinvicanek
Hi gang, in an effort to elaborate on this subject I have finally found a simpler scheme to calculate the coefficients for a recursive filter matched to its analog counterpart. What's more, it generalizes nicely to other than lowpass filter types. :D Here is a collection of matched lowpass, highpass, bandpass, and peaking EQ filters. I have prepared a little writeup with the details, mainly for myself, and maybe for a few other inclined readers. :mrgreen:

Re: Matched Lowpass Filter

PostPosted: Sun Feb 14, 2016 12:06 pm
by Spogg
Martin, if I were in a position to, I would award you a PhD for that. Or do you have one of those already? Wouldn't surprise me if you did.

I love the fact that here in this forum I kinda rub shoulders with so much talent, expertise, intelligence and, amazingly, such a willingness to share and help.

I look forward to auditioning these filters and dropping them into a so-called state variable (selectable) module.

In the meantime many thanks and much respect!

Cheers

Spogg

Re: Matched Lowpass Filter

PostPosted: Sun Feb 14, 2016 1:26 pm
by stw
Spogg wrote:I look forward to auditioning these filters and dropping them into a so-called state variable (selectable) module.

In the meantime many thanks and much respect!


+1 !

A new masterpiece! Thanks for sharing your knowledge...

Re: Matched Lowpass Filter

PostPosted: Sun Feb 14, 2016 2:34 pm
by Tronic
Super :geek:
this need an Patent Application 8-)

Re: Matched Lowpass Filter

PostPosted: Sun Feb 14, 2016 8:08 pm
by tulamide
Tronic wrote:Super :geek:
this need an Patent Application 8-)

+1

Martin, I think you are not aware of how fantastic your work is. Be it the ultra-optimized standard oscillators, the shared mem osc, the realtime zero-delay convolution engine or these highly-scientific filters. You might think something in the lines of "Oh these all existed before, I just improved them", but the truth is that people may get a nobel prize for discovering DNA, but they also get one for finding a faster way of sequencing DNA. I hope you understand this image ;)