Sallen Key - LP/BP implementation - how to obtain HP?

DSP, Plugin and Host development discussion.
Post Reply New Topic
RELATED
PRODUCTS

Post

Hi folks,

I'm trying Sallen Key topology those days, using this implementation: https://github.com/janne808/kocmoc-rack ... y.cpp#L206

But while it seems to works almost good for LP and BP (I say almost because change oversampling factor or decimator order move the cutoff response, which is not so great), there isn't any output for HP mode (in fact, input_hp and input_hp_t1 are not used in the recursion).

Can in your knowledge this be extended also to HP? Tried somethings like LP+input or LP-input, but the response seems weird and not a "very" HP.

How would you manage this?
Thanks for any tips!!!

Post

The Art of VA Filter Design 2.1.2 p.156 and before.

Post

You can also simply use the relationship "input = HP + 2R*BP + LP" to derive HP from the remaining 3 signals, where 2R=2-k. This should work perfectly as long as the filter is linear (and conforms to the bilinear transform relationship).

Edit: should have been 2-k, corrected now.
Last edited by Z1202 on Sat Feb 10, 2024 8:58 pm, edited 2 times in total.

Post

Z1202 wrote: Sat Feb 10, 2024 5:17 pm You can also simply use the relationship "input = HP + 2R*BP + LP" to derive HP from the remaining 3 signals, where 2R=1-k. This should work perfectly as long as the filter is linear (and conforms to the bilinear transform relationship).
Its not linear: "Classic Sallen-Key filter with dynamic diode anti-saturation and implicit (zero-delay) state integration. Features user selectable oversampling factor and IIR/FIR antialiasing filter."

Post

Derozer wrote: Sat Feb 10, 2024 6:21 pm Its not linear: "Classic Sallen-Key filter with dynamic diode anti-saturation and implicit (zero-delay) state integration. Features user selectable oversampling factor and IIR/FIR antialiasing filter."
Then I'm not aware of any easy solution, except considering to modify the filter structure as referenced above. Whether this can work, can depend on the details of the nonlinearity. Zero-delay integration per se is not a complication, rather on the opposite (assuming it's trapezoidal).

Post

Z1202 wrote: Sat Feb 10, 2024 6:40 pm
Derozer wrote: Sat Feb 10, 2024 6:21 pm Its not linear: "Classic Sallen-Key filter with dynamic diode anti-saturation and implicit (zero-delay) state integration. Features user selectable oversampling factor and IIR/FIR antialiasing filter."
Then I'm not aware of any easy solution, except considering to modify the filter structure as referenced above. Whether this can work, can depend on the details of the nonlinearity. Zero-delay integration per se is not a complication, rather on the opposite (assuming it's trapezoidal).
I see. Unfortunately I'm not so skilled in math ti calculate those values. That filter book for me its hard to follow (I admit my limits).

I believe for such a "basic" filter topology there are out there some implementation with non-linear/diode approch and lp/hp/bp implementation? You know?

Post

Derozer wrote: Sun Feb 11, 2024 11:47 am I believe for such a "basic" filter topology there are out there some implementation with non-linear/diode approch and lp/hp/bp implementation? You know?
The LP/BP/HP modes is a natural feature of an SVF, but not so natural for a ladder filter design (which SKF is one version of). The modes of a ladder filter are usually smth else. One usually builds other signals by means of modal mixture, but, in the presence of noticeable nonlinearities, the math behind this mixture is usually not fully applicable, and you cannot expect your obtained modes to maintain their spectral shapes. They might still sound nice, though. Just difficult to say in advance. Off the top of my head, I think there might be a noticeable LP/BP leakage in the HP signal obtained by modal mixture, if the nonlinearity is driven hard enough. But maybe not so much. That's why I said, no easy answer.

As the modal mixture goes, the equation for it is "input = LP + 2R*BP + HP" which I already mentioned (applicable to 2-pole filters)

Post

If you don't need all 3 modes simultaneously, however, you could make an HP/BP SKF instead of LP/BP (or use the 2-in 2-out structure from the book), although, admittedly you'd probably need to redo the nonlinear ZDF math for that.

Post

Z1202 wrote: Sun Feb 11, 2024 12:19 pm If you don't need all 3 modes simultaneously, however, you could make an HP/BP SKF instead of LP/BP (or use the 2-in 2-out structure from the book), although, admittedly you'd probably need to redo the nonlinear ZDF math for that.
I don't need simultaneously.

Doing some research on the web, didnt find ANY implementation of such a non-linear filter with LP/HP/BP: wow!! Is it such a hard one to get? (maybe I'm underestimating the value of what I'm asking).

Neither some classic DSP filter collection include it (this for example https://github.com/AudioTK/AudioTK/tree/main/ATK/EQ), or a research on this forum's section.

Post Reply

Return to “DSP and Plugin Development”