Matched Lowpass Filter

DSP related issues, mathematics, processing and techniques
User avatar
martinvicanek
Posts: 1334
Joined: Sat Jun 22, 2013 8:28 pm

Matched Lowpass Filter

Post 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 65819 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!
Attachments
MatchedLowpass.fsm
(57.56 KiB) Downloaded 2819 times
BobF
Posts: 598
Joined: Mon Apr 20, 2015 9:54 pm

Re: Matched Lowpass Filter

Post by BobF »

BobsMV_matchedLP2HP&BP.fsm
(90.85 KiB) Downloaded 2789 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.....
KG_is_back
Posts: 1196
Joined: Tue Oct 22, 2013 5:43 pm
Location: Slovakia

Re: Matched Lowpass Filter

Post 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!
tulamide
Posts: 2714
Joined: Sat Jun 21, 2014 2:48 pm
Location: Germany

Re: Matched Lowpass Filter

Post 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
"There lies the dog buried" (German saying translated literally)
tester
Posts: 1786
Joined: Wed Jan 18, 2012 10:52 pm
Location: Poland, internet

Re: Matched Lowpass Filter

Post by tester »

Nice!
Need to take a break? I have something right for you.
Feel free to donate. Thank you for your contribution.
User avatar
martinvicanek
Posts: 1334
Joined: Sat Jun 22, 2013 8:28 pm

Matched Biquad Filters

Post 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:
Attachments
MatchedBiquads.fsm
(187.17 KiB) Downloaded 2783 times
User avatar
Spogg
Posts: 3368
Joined: Thu Nov 20, 2014 4:24 pm
Location: Birmingham, England
Contact:

Re: Matched Lowpass Filter

Post 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
stw
Posts: 111
Joined: Tue Jul 13, 2010 11:09 am
Contact:

Re: Matched Lowpass Filter

Post 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...
Tronic
Posts: 539
Joined: Wed Dec 21, 2011 12:59 pm

Re: Matched Lowpass Filter

Post by Tronic »

Super :geek:
this need an Patent Application 8-)
tulamide
Posts: 2714
Joined: Sat Jun 21, 2014 2:48 pm
Location: Germany

Re: Matched Lowpass Filter

Post 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 ;)
"There lies the dog buried" (German saying translated literally)
Post Reply