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.
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.
Is there an easy way to know this other than trial and error?
thanks
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).
sorry, but I'm very curious. Using a resonance filter implies phase shifting right? (instead of using a non resonance linear phase filter) But this means that the tuning of the KS will be affected only near the resonance? i may not understand this fully, but I never thought about using resonance inside KS
Em qua., 27 de abr. de 2022 08:51, Claude Heiland-Allen claude@mathr.co.uk escreveu:
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
Pd-list@lists.iem.at mailing list UNSUBSCRIBE and account-management -> https://lists.puredata.info/listinfo/pd-list
I guess I can get the coefficients and derive an overall gain parameter. I got objects in ELSE that do that [coeff2pz]. But if it also depends on the frequency I should calculate this all of the time which doesn't seem reasonable. Maybe just keeping a safe 0.5 q is fine...
You know, using something like lop~ is pretty stable, I am now wondering if I should just use if for the sake of simplicity and efficiency as well. Do I really need a 6db decay per octave instead of 3db? What do you people think?
will make some tests...
thanks
Em qua., 27 de abr. de 2022 às 09:11, José de Abreu abreubacelar@gmail.com escreveu:
sorry, but I'm very curious. Using a resonance filter implies phase shifting right? (instead of using a non resonance linear phase filter) But this means that the tuning of the KS will be affected only near the resonance? i may not understand this fully, but I never thought about using resonance inside KS
Em qua., 27 de abr. de 2022 08:51, Claude Heiland-Allen < claude@mathr.co.uk> escreveu:
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
Pd-list@lists.iem.at mailing list UNSUBSCRIBE and account-management -> https://lists.puredata.info/listinfo/pd-list
Pd-list@lists.iem.at mailing list UNSUBSCRIBE and account-management -> https://lists.puredata.info/listinfo/pd-list
On Wed, 2022-04-27 at 11:27 -0300, Alexandre Torres Porres wrote:
I guess I can get the coefficients and derive an overall gain parameter. I got objects in ELSE that do that [coeff2pz]. But if it also depends on the frequency I should calculate this all of the time which doesn't seem reasonable. Maybe just keeping a safe 0.5 q is fine...
You know, using something like lop~ is pretty stable, I am now wondering if I should just use if for the sake of simplicity and efficiency as well. Do I really need a 6db decay per octave instead of 3db? What do you people think?
Isn't a low steepness in the filter in the feedback loop desired anyway? Me thinks a low steepness means the change in timbre happens more slowly which - I imagine - would sound nicer than a sudden 'tziewhh'.
Roman
Em qua., 27 de abr. de 2022 às 11:54, Roman Haefeli reduzent@gmail.com escreveu:
Isn't a low steepness in the filter in the feedback loop desired anyway? Me thinks a low steepness means the change in timbre happens more slowly which - I imagine - would sound nicer than a sudden 'tziewhh'.
Interesting discussion. The suddenty depends on the cutoff frequency as well, and also on the decay/feedback parameter. I guess my problem with the lop~ (a single 1-pole) like filter is that it doesn't work well for higher frequencies. Perhaps a 1-pole and 1-zero filter is better as we need a proper zero at nyquist. The original 2 sample average filter in the KP algorithm is actually just that, a single 0 at nyquist, but it's only a quite high cut filter and you can't set a proper cutoff frequency.
I guess I have to test and see how different does it sound and how more efficient it is.
I already just broke my pluck~ object for a better design maybe I'll also change the default filter inside.
cheers
I think the maximum Q factor without ripple (i.e Butterworth) is 0.707.
Le mer. 27 avr. 2022 à 21:07, Alexandre Torres Porres porres@gmail.com a écrit :
Em qua., 27 de abr. de 2022 às 11:54, Roman Haefeli reduzent@gmail.com escreveu:
Isn't a low steepness in the filter in the feedback loop desired anyway? Me thinks a low steepness means the change in timbre happens more slowly which - I imagine - would sound nicer than a sudden 'tziewhh'.
Interesting discussion. The suddenty depends on the cutoff frequency as well, and also on the decay/feedback parameter. I guess my problem with the lop~ (a single 1-pole) like filter is that it doesn't work well for higher frequencies. Perhaps a 1-pole and 1-zero filter is better as we need a proper zero at nyquist. The original 2 sample average filter in the KP algorithm is actually just that, a single 0 at nyquist, but it's only a quite high cut filter and you can't set a proper cutoff frequency.
I guess I have to test and see how different does it sound and how more efficient it is.
I already just broke my pluck~ object for a better design maybe I'll also change the default filter inside.
cheers _______________________________________________ Pd-list@lists.iem.at mailing list UNSUBSCRIBE and account-management -> https://lists.puredata.info/listinfo/pd-list