Support

If you have a problem or need to report a bug please email : support@dsprobotics.com

There are 3 sections to this support area:

DOWNLOADS: access to product manuals, support files and drivers

HELP & INFORMATION: tutorials and example files for learning or finding pre-made modules for your projects

USER FORUMS: meet with other users and exchange ideas, you can also get help and assistance here

NEW REGISTRATIONS - please contact us if you wish to register on the forum

Users are reminded of the forum rules they sign up to which prohibits any activity that violates any laws including posting material covered by copyright

static vs dynamic filters

For general discussion related FlowStone

static vs dynamic filters

Postby tulamide » Sat Mar 05, 2016 2:54 pm

Here I am once again outing me as a dumb idiot when it comes to filters (or generally higher maths dsp):

What exactly is the difference, if the same filter exists in two versions, as 'static' and 'dynamic'? Is it only to emphasize that the dynamic one is better modulatable? So, if I do changes to the cutoff, but only manual, the static version is the better choice, and if I modulate it at, say, 2 Hz, the dynamic version is better suited?

If so, what changes occur between the versions, if I just have a fixed cutoff and use both of them (does one have a better sound output than the other?)
"There lies the dog buried" (German saying translated literally)
tulamide
 
Posts: 2714
Joined: Sat Jun 21, 2014 2:48 pm
Location: Germany

Re: static vs dynamic filters

Postby KG_is_back » Sat Mar 05, 2016 3:50 pm

Generally, static filter refers to filter which has fixed/hard-coded transfer curve, meaning it can't be changed without recompiling the code.
Dynamic filters have actual inputs (like cutoff frequency, Q, etc.) which allow you to modify and modulate the curve.
Sometimes filters can be semi-static, meaning their curve can be set when they are initialized (in flowstone it is implemented via stage(0) code). Or update in regular longer intervals.

If you use dynamic filter in a place where static would suffice, the result should be the same (sound-quality-wise). Only difference is that CPU consumption will be higher, due to dynamic filter constantly updating its coefficients (which naturally takes some CPU - in fact, usually more then the actual filtering part).

Naturally, there is a myriad of optimizations that can be done on dynamic filters, to make them behave more efficiently.
Some contain " hop" in the coefficient calculation, so that they don't update their coefficients constantly. This effectively means you are down-sampling the input parameters, which may cause problems with high-modulation-frequencies. Also, it does not stop the filter from updating coeffs, when parameters aren't changing.
Another way is to make the coefficient update conditional (condition being, the change of input parameters). This saves quite a lot of CPU when parameters aren't changing and causes occasional CPU spikes when they do. It however fails when parameters are constantly modulated - it just updates them constantly saving no CPU at all.

Simply, there is no go-to solution that fits all scenarios. Rule of thumb is, if the filter is not expected to change, use static, because it saves CPU.
KG_is_back
 
Posts: 1196
Joined: Tue Oct 22, 2013 5:43 pm
Location: Slovakia

Re: static vs dynamic filters

Postby tulamide » Sat Mar 05, 2016 11:56 pm

That's exactly the kind of description, I was looking for. I know you don't care much for gratitude, but still I want to thank you :P
"There lies the dog buried" (German saying translated literally)
tulamide
 
Posts: 2714
Joined: Sat Jun 21, 2014 2:48 pm
Location: Germany

Re: static vs dynamic filters

Postby RJHollins » Sun Mar 06, 2016 12:18 am

we 2nd the Thank-you's.

[also ... thanks to 'T' for asking the question ... I didn't know the reasoning]. :mrgreen:
RJHollins
 
Posts: 1571
Joined: Thu Mar 08, 2012 7:58 pm

Re: static vs dynamic filters

Postby martinvicanek » Sun Mar 06, 2016 7:08 am

I use the term static filter in a loose sense for mostly static filter, i.e. a filter with rarely changing parameters, and if they change timing is not so important. This includes truly static filters as well as filters controlled by manual user interaction. My static filters have green inputs for the filter parameters so filter coefficient calculations are triggered only if there is a change to save CPU otherwise.

Obviously (my) static filters are not suited for modulation.

For non-changing filter parameters, stream processing is identical for static vs dynamic fiter variants, there is no difference in sound.

In case of doubt use the dynamic filter (and buy a more powerful computer :mrgreen: ).
User avatar
martinvicanek
 
Posts: 1328
Joined: Sat Jun 22, 2013 8:28 pm

Re: static vs dynamic filters

Postby tulamide » Sun Mar 06, 2016 9:16 am

martinvicanek wrote:My static filters have green inputs for the filter parameters so filter coefficient calculations are triggered only if there is a change to save CPU otherwise.

That's good to know, because it's indeed your optimized LP and HP filters that I'm using :lol:

martinvicanek wrote:In case of doubt use the dynamic filter (and buy a more powerful computer :mrgreen: ).
In my current test configuration (which is an audio effect, not an instrument) I use 2 10-pole-hp and 2 10-pole-lp static filters and the complete audio section -which is more than just that 4 filters- uses about 1.4% according to Flowstone. I haven't looked at the task manager yet, but I'm confident that it will be a low-cpu-effect in the end :D

Since you already posted here, may I ask a question regarding the poles? I understand that the number of poles is associated with the steepness of the curve, where the filter cuts off. The poles have somehow to do with the equation used. So it is not always possible to tell a dB/Oct value for filters. Would it be ok to use a decription of 6 dB/Oct per pole in this special circuit of only LP and HP filters? So that instead of 2-pole, 4-pole, 6-pole, etc., I can present the user with a switch that tells 12 dB, 24 dB, 36 dB, 48 dB and 60 dB?
"There lies the dog buried" (German saying translated literally)
tulamide
 
Posts: 2714
Joined: Sat Jun 21, 2014 2:48 pm
Location: Germany

Re: static vs dynamic filters

Postby martinvicanek » Sun Mar 06, 2016 6:05 pm

Yes, that's correct, stacking filters of one kind as you do amounts to adding slopes (dB per octave), with 6dB/octave per pole or 12 dB/octave per biquad. (This is somewhat simplified, but useful as a rule of thumb, and certainly good enough for rock n roll! :mrgreen: )
User avatar
martinvicanek
 
Posts: 1328
Joined: Sat Jun 22, 2013 8:28 pm

Re: static vs dynamic filters

Postby tulamide » Mon Mar 07, 2016 9:24 pm

Thanks a lot! So let me get rock'n'rolling :lol:
"There lies the dog buried" (German saying translated literally)
tulamide
 
Posts: 2714
Joined: Sat Jun 21, 2014 2:48 pm
Location: Germany


Return to General

Who is online

Users browsing this forum: No registered users and 62 guests