bmc0 / dsp

An audio processing program with an interactive mode.
ISC License
222 stars 31 forks source link

peaking filter #71

Open richardpl opened 2 weeks ago

richardpl commented 2 weeks ago

This is somehow related to equalizer IIR filter as implemented in eq effect.

For more info see:

https://cytomic.com/files/dsp/SvfLinearTrapOptimised2.pdf

another implementation, both with SVF coefficients and standard coefficients for Direct I/Direct II/Transposed Direct I/Transposed Direct II kinds:

https://github.com/librempeg/librempeg/blob/master/libavfilter/af_biquads.c#L404

https://github.com/librempeg/librempeg/blob/master/libavfilter/af_biquads.c#L563

It appears that cascading this type of filter have very nice property. (with Q >= 0.5)

bmc0 commented 1 week ago

Perhaps I'm missing something obvious, but I'm not sure I understand the application for the 'peakpass' filter. I'm guessing that the peak gain is intended to be controlled by the output mix as there's no independent gain parameter

It seems that one can get the same response with the 'bell' (RBJ peakingEQ) filter. Examples:

peakpass bell equivalent
Q=1 Q=sqrt(0.5) A=20×log10(2)
Q=2 Q=1 A=20×log10(4)
Q=4 Q=sqrt(2) A=20×log10(8)
Q=1/4 Q=sqrt(1/8) A=20×log10(0.5)
richardpl commented 1 week ago

Yes, you can also do it with bell 'RBJ' filter...

The SVF is mainly useful for changing filter coefficients on the fly, so they have bigger benefit from "RBJ" kind of implementations.

Also another topology like lattice-ladder allow stable high order recursive allpass fractional delay filters. (Unlike Thiran allpass filter direct transfer function coefficients of high order which is quite unstable and unworkable even with double precision)