Smoothing HPF/LPF engage

Hello,
I am still at the beginning of my adventure with filters and I would kindly ask for help.
I found out juce::dsp::StateVariableTPTFilter which allows for smooth frequency changes. But I am not sure what is common method to smooth engage/disangage the HPF and LPF?

I can imagine I could have two AudioBuffer’s. One for wet (filtered signal) and another one for dry signal and then mix them together by smoothed mix param. But I have two instances of StateVariableTPTFilter for each channel - one for HPF and another one for LPF (actually I have 4 instances for each channel because by default StateVariableTPTFilter gives 12dB/octave slope while I need 24 dB/octave). So I would need much more AudioBuffers for smooth mixing all of them together. So I feel that my solution is not perfect and I believe there is better one but I have no idea what is it.

By the way I wonder what is the reason to use any other juce filters? If they don’t have option for smooth frequency changes then they can be only used as constant filters. But most of modern graphic equalisers (like Fabfilter-Pro-Q or Logiuc Pro X EQ etc.) have a lot of bands, and all of them can be automated so I believe they need to perform all changes smoothly. Do all of them use TPT filter type? Or do they have their own secret solution?

For any help or advice great thanks in advance.
Best Regards

No. juce::dsp::StateVariableTPTFilter won’t smooth frequency changes. You may want to do some smoothing on the cut-off frequency value (e.g., using juce::SmoothedValue or a low-pass filter). From documentation:

Using this class prevents some loud audio artefacts commonly encountered when changing the cutoff frequency using other filter simulation structures and IIR filter classes. However, this class may still require additional smoothing for cutoff frequency changes.

In general, you should not do dry/wet mixing on filter with slope >= 18dB/oct because of the phase issue (unless you choose linear phase filters).

You can still modulate the frequency. AFAICT Pro-Q using TDF-II or something alike instead of SVF. But if you are making crossover, you’d better choose SVF (and take a look at juce::dsp::LinkwitzRileyFilter).

Great thanks for your answer. It looks like there is a lot to read and learn for me. That’s great.

But at the moment I am not sure what do you mean by first sentence about SmoothedValue. Of course I am already use SmoothedValue to do freq changes on my TPT filter. But SmoothedValue is just smoothed value which means my freq param is changed smoothly, and those smoothed freq values I use to set my TPT filter.
But when I use the same SmoothedValue on regular juce::IIR filter than there are some unpleasent sounds.

And as I understand this is the difference between TPT filter and other filters. That on TPT I can use smoothed values, but on other filters not. Am I wrong?

When I use TDF-II, I can also hear artefacts if I change the frequency fast (my ears are poor at catching artefacts). Although I don’t use smoothed values, I restrict frequency change to about 1000 times per second.

Self-promotion alert! I have an equalizer with both TDF-II and SVF built in. You may try it out and see whether there is a significant difference between these two.

Great thanks for your help. I will definitely check and test your ZLEq

It concerns to my main question but. But I still have no idea how to smoothly engage or disengage such filter?

For SVF I change the original filter to all-pass filter when the filter is bypassed. I don’t know why (probably because it somehow keeps the phase response?) but it sounds smoother.

Here’s one possible (untested) solution.

Organise your signal path so that you have two audio signals: first signal being the normal one, second one being with first one along with the added or removed filter in question.

Interpolate between the two over a number of milliseconds. In theory that should at least mitigate any pops or discontinuities.

If your phase is at zero for an all-pass then the output signal should be indistinguishable from the input signal in both amplitude and phase.