[PD] filter stability

Claude Heiland-Allen claude at mathr.co.uk
Wed Apr 27 13:42:43 CEST 2022


Hi Alexandre,

On 27/04/2022 06:01, Alexandre Torres Porres wrote:
> hi list, I'm using a 2nd order lowpass resonant filter whose 
> coefficients I'm getting from the famous Eq-cookbook and using it 
> inside a feedback loop to implement karplus-strong.
>
> I also have a coded object for that (pluck~) and the 'q' parameter is 
> 0.5, which is a "safe" setting, i.e. the filter doesn't get unstable 
> and blows up.

The filter in isolation should be stable for any positive 'q', but its 
gain might get bigger than 1 making the larger feedback loop explode.

You can do some additional gain reduction if increasing the q factor 
increases the peak gain of the filter and makes the feedback loop explode.

> I was now trying to find a higher 'q' coefficient but it's hard to 
> know where I can go "exactly" just under it could blow up.

You want the total gain in the feedback loop for all frequencies to be 
less than 1, i.e. peak (over frequencies) gain less than 1.

> Is there an easy way to know this other than trial and error?
The filter gain probably depends on cut-off frequency as well as q, so 
the filter peak gain is a function of 2 parameters.  Maybe gathering 
numerical data and surface-fitting a mathematical function could work, 
if the maths to do it analytically is too hard.

If you modulate the filter parameters, it could still explode (the 
filter theory as per eq cookbook is only valid for fixed parameters, afaik).

If you implement with insufficient accuracy inside the filter feedback 
(e.g. single precision floating point for 'y' in a biquad 
implementation), rounding errors can accumulate and can affect the 
actual gain (vs the theoretical gain you'd get from exact maths).


Claude
-- 
https://mathr.co.uk






More information about the Pd-list mailing list