kfrlib / kfr

Fast, modern C++ DSP framework, FFT, Sample Rate Conversion, FIR/IIR/Biquad Filters (SSE, AVX, AVX-512, ARM NEON)
https://www.kfrlib.com
GNU General Public License v2.0
1.66k stars 253 forks source link

Biquad filter dynamic frequency #173

Open MatthieuMv opened 1 year ago

MatthieuMv commented 1 year ago

Is KFR's biquad / IIR implementation friendly to dynamic frequency ?

I think I can precompute sos parameters but I don't think there is a way to inject new parameters to an existing filter cache. Is it possible to achieve dynamic filtering in KFR or should I implement a custom filter for that purpose ?

Thank you

dancazarin commented 1 year ago

Changing frequency dynamically is not yet supported out-of-the-box. How often does the frequency change in your case? If audio is being processed in blocks and frequency changes only at block boundary (hundreds of samples, as in VST), crossfade may be used. If per-sample accuracy is needed, I think it will have a huge performance impact because IIR filter design is not intended for per-sample invocation.