Zero Delay Feedback Filter

DSP related issues, mathematics, processing and techniques
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 »

martinvicanek wrote:A 2nd order Butteworth filter is simply one with Q=0.71. For higher orders use a cascade with different Qs and same cutoff frequencies. Here is a lowpass example.


Is there a general formula how to calculate the Q parameters for N-th order filter (assuming it's even order)? I can't find anything understandable to me on this topic.
User avatar
martinvicanek
Posts: 1334
Joined: Sat Jun 22, 2013 8:28 pm

Re: Zero Delay Feedback Filter

Post by martinvicanek »

For even order N we have i = 1, 2, ..., N/2 biquads with

Q_i = 0.5/cos(alpha_i)

where the alpha_i are spread uniformly over (0,Pi/2):

alpha_i = (i - 0.5)*Pi/N

Looks more complicated than it really is. ;)
User avatar
digitalwhitebyte
Posts: 106
Joined: Sat Jul 31, 2010 10:20 am

Re: Zero Delay Feedback Filter

Post by digitalwhitebyte »

nice implementation.
looking at the paper Vadim, he says he can also implement a cheap non-linearity,
adding an inverse tanh-1 in one of the integrator HP and BP.
I have not found the solution, any advice on this?
User avatar
martinvicanek
Posts: 1334
Joined: Sat Jun 22, 2013 8:28 pm

Re: Zero Delay Feedback Filter

Post by martinvicanek »

There are various options for introducing nonlinearities to saturate self-oscillation. The simplest would be to make 1/Q increase with |BP|, I think. Haven't actually done it, but tanh or tanh^-1 isn't cheap. Note that you have an implicit equation to solve, it's a bit harder than just calculate tanh for some given argument. Vadim also suggests simpler functions but the expressions are still awkward.
User avatar
digitalwhitebyte
Posts: 106
Joined: Sat Jul 31, 2010 10:20 am

Re: Zero Delay Feedback Filter

Post by digitalwhitebyte »

thanks Martin
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 »

cal also one pole allpass filter (the one used in interpolation) could be implemented as ZDF filter? would that improve how it behaves under modulation?
tester
Posts: 1786
Joined: Wed Jan 18, 2012 10:52 pm
Location: Poland, internet

Re: Zero Delay Feedback Filter

Post by tester »

I thought that I messed something wrong (and maybe I did, but elsewhere), but it appears to be general issue with this design, or I'm missing something. ZDF original side by side with 4ch-mono4-in-progress replacement.

When using Low Shelf and Hi Shelf filters (sel 1 and 2), there seem to be a problem with frequency. Not to mention that they tend to get stuck when on/off, let say that gain is between 0 and 10 dB, Q is below 4 - if you put frequency above some threshold - the whole goes down (sound disappears and audio must be restarted). Can this be fixed somehow?

BTW, my peak filter uses modified Q.
Attachments
zdf-issue.fsm
(26.48 KiB) Downloaded 1596 times
Need to take a break? I have something right for you.
Feel free to donate. Thank you for your contribution.
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 »

tester wrote:I thought that I messed something wrong (and maybe I did, but elsewhere), but it appears to be general issue with this design, or I'm missing something. ZDF original side by side with 4ch-mono4-in-progress replacement.

When using Low Shelf and Hi Shelf filters (sel 1 and 2), there seem to be a problem with frequency. Not to mention that they tend to get stuck when on/off, let say that gain is between 0 and 10 dB, Q is below 4 - if you put frequency above some threshold - the whole goes down (sound disappears and audio must be restarted). Can this be fixed somehow?

BTW, my peak filter uses modified Q.


In the shelving filters you modify the cutoff according to gain. When you enter high cutoff into one of the shelving filters, the cutoff is modified so it is above 1 and filter becomes unstable. You may fix that using oversampling.
tester
Posts: 1786
Joined: Wed Jan 18, 2012 10:52 pm
Location: Poland, internet

Re: Zero Delay Feedback Filter

Post by tester »

And without oversampling? Maybe some sort of min/max somewhere?

I'm starting to vaguely recall, that with RBJ there was similar issue, and it was fixed somehow; it changed the filter envelope a little bit over certain thresholds, but it kept the nature of filters. I guess I need to find it out again.
Need to take a break? I have something right for you.
Feel free to donate. Thank you for your contribution.
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 »

You may put stream min just before the actual ZDF code block with the cutoff connected and value close to 1 in the other (like 0.9999) to prevent the cutoff from exceeding that point.
Post Reply