Zero Delay Feedback Filter

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

Zero Delay Feedback Filter

Post by martinvicanek »

About 2 years ago people at KVR got excited about so-called zero delay feedback (ZDF or 0df) filters. Meanwhile, it appears that these filters have become a sort of de facto standard in music DSP, while direct form biquads, which we have been using all along, are generally being frowned upon (well, they frown on us Synthmakers anyway ;) ). Apart from marketing hype, ZDF filters do have some desirable properties, the most important one being fast modulation stability. (It took me a while to realize that two different filter implementations may have the same static transfer functions but when modulated they may behave quite differently.)

So maybe it's time to catch up a bit and reconsider using our good old RBJ Direct Form I biquad implementations? In the schematic below is a 2nd order ZDF filter along with some test modules with comparisons to various biquad implementations (Direct Forms I and II, as well as Transposed Direct Form II).

The Transfer Function module basically shows that the static (non-modulated) audio response of the filters is equivalent. The Modulation module (hehe) demonstrates how all biquad forms have problems with fast modulation, while the ZDF filter remains stable even at extreme settings. Please watch your ears/speakers while experimenting! Finally, the Step Response module shows limitations of the various biquad forms wrt numerical precision in the sub-audio range. This may be a concern if you want to lowpass filter noise for a random LFO. For cutoff frequencies of 1 s and less, the biquads simply go blank while the ZDF filter performs much better.

Oh, other good news is that ZDF is no worse in complexity or CPU load than the biquad forms. 8-)
Attachments
2nd_Order_ZDF_Filter.fsm
(93.92 KiB) Downloaded 2429 times
KG_is_back
Posts: 1196
Joined: Tue Oct 22, 2013 5:43 pm
Location: Slovakia

Re: Zero Delay Feedback Filter

Post by KG_is_back »

:o this is so cool... how does it work? black magic? I looked into the module and the A and B coefficients are static and from them some weird formula is derived and used in output adjustment...
User avatar
martinvicanek
Posts: 1334
Joined: Sat Jun 22, 2013 8:28 pm

Re: Zero Delay Feedback Filter

Post by martinvicanek »

KG, thanks for asking, I should have posted some references for credit and explanation. The avalanche was set in motion by Vadim Zavalishin with his paper on virtual analog filters. The above schematic is based on a KVR post by mystran and another by Robin Schmidt.
KG_is_back
Posts: 1196
Joined: Tue Oct 22, 2013 5:43 pm
Location: Slovakia

Re: Zero Delay Feedback Filter

Post by KG_is_back »

Oh now I get it.... those a0...b1 are used in tangent approximation... Still it is above my math skills to completely understand what's going on, but it reminds me a state variable filter a lot. So to gain peaking and shelving filters, I just have to mix the HP BP and LP certain way, right?
Jay
Posts: 276
Joined: Tue Jul 13, 2010 5:42 pm

Re: Zero Delay Feedback Filter

Post by Jay »

very cool! thanks for sharing this Martin!
User avatar
Wishx
Posts: 68
Joined: Wed Apr 24, 2013 10:28 pm
Location: Spain

Re: Zero Delay Feedback Filter

Post by Wishx »

thank you !
User avatar
MegaHurtz
Posts: 105
Joined: Mon Aug 11, 2008 6:29 pm
Location: Eindhoven/Nederland

Re: Zero Delay Feedback Filter

Post by MegaHurtz »

TPT, chinese mathematics western world day today :)

Without peeping, well couldnt if I wanted to.
But Afaik, nothing to do with fancy things. just 2piing these :p
tpt.jpg
tpt.jpg (52.98 KiB) Viewed 56181 times
192k @ 8ms
stw
Posts: 111
Joined: Tue Jul 13, 2010 11:09 am
Contact:

Re: Zero Delay Feedback Filter

Post by stw »

as usual brilliant work Martin! Thanks for sharing!
Really strange that filter designs which are identic in their static transfer function behave so different when modulated.
Another feature i found out while playing with it is that's it's pretty easy to get a notch filter with wide notches combinig HP and LP with low Q settings. Nice... :)
KG_is_back
Posts: 1196
Joined: Tue Oct 22, 2013 5:43 pm
Location: Slovakia

Re: Zero Delay Feedback Filter

Post by KG_is_back »

I have another Idea that might be cool to look into... 90degree phase shifter. I've read somewhere that if you rotate Z-transform of a lowpass filter with cutoff near Nyquist, you can create 90degree phase shift across mayor part of spectrum. These ZDF filters seem to behave quite stable near 0 and nyquist frequency, so if this could be implemented it would be very cool. It would need complex-number math so that might complicate things a lot...
User avatar
MegaHurtz
Posts: 105
Joined: Mon Aug 11, 2008 6:29 pm
Location: Eindhoven/Nederland

Re: Zero Delay Feedback Filter

Post by MegaHurtz »

Rotating Z transform is just a harder way to say sutract the lowpass from input to make highpass.
For not wanting to show how easy it is, reminds me of people explaing what a differential equation is.
Easy thats what :lol: Guess some people deserve credit "couch"

Edit: resonating a filter off key makes for a glassy sound imo, is that good? I dont know?
Personally more in love with that Z-spline Outsim did.
192k @ 8ms
Post Reply