C++ port of Andy Simper's implementation of State Variable Filters

DSP, Plugin and Host development discussion.
RELATED
PRODUCTS

Post

andy-cytomic wrote:I just copy and pasted and didn't delete the A term, it's not needed for a peaking filter. A peaking filter is just a resonant filter much like a low, high or band pass filter, but it doesn't attenuate either high or low frequencies, it leaves them alone and just boosts the resonant peak.
Thanks for the reply, it makes sense.

Post

For the beginners ( only :D ) I've added an example on how to use the class SvfLinearTrapOptimised2. Have a look on https://github.com/FredAntonCorvest/Common-DSP. Next I will update the various filter type missing.

Post

andy-cytomic wrote:I added the "all pass" response to the document, which is LP + HP - k*BP = input - 2*k*BP. I should actually do a version where you solve for HP BP and LP directly, then you can do various sums using m0*HP + m1*BP + M2*LP since these are easier to conceptually work with. The reason I did it like I did was since I was aiming this at EQ and if you have input + gain*something, then when gain is zero you get exactly your input back again - a perfectly transparent EQ.
Ableton EQ8 proof that?!?
rabbit in a hole

Post

Autobot wrote:
andy-cytomic wrote:I added the "all pass" response to the document, which is LP + HP - k*BP = input - 2*k*BP. I should actually do a version where you solve for HP BP and LP directly, then you can do various sums using m0*HP + m1*BP + M2*LP since these are easier to conceptually work with. The reason I did it like I did was since I was aiming this at EQ and if you have input + gain*something, then when gain is zero you get exactly your input back again - a perfectly transparent EQ.
Ableton EQ8 proof that?!?
Yes, with the Ableton EQ8 if you have all the gains at 0 dB you should get a bit for bit transparent output (being identical to the input). I copied this directly from the Urei 545 EQ.
The Glue, The Drop - www.cytomic.com

Post

I've added the missing filter types -> https://github.com/FredAntonCorvest/Common-DSP

Post

FredAnton wrote: Thu Dec 01, 2016 8:59 pm I've added the missing filter types -> https://github.com/FredAntonCorvest/Common-DSP
Thanks for the effort, FredAnton. And of course Andy for the creation of such a filter.
I'd like to use a parameterized filter on my audio app, and Nigel suggest it to me, which sound good.

BTW, a question: I'd like to have a single value for each param; so if I change gain, fc or q, I don't need to recalculate ALL coefficients every timee, but a single variable/value for each.

What should be the concept about parameterized filter, right?
Here I see you change all on every cutoff change, not only the cutoff variable.

Is it possible? Or do I need to switch to another filter? Suggestions?

Thanks for the help!

Post

All these filters are also available inside Autio ToolKit.

Post

Miles1981 wrote: Wed Oct 31, 2018 10:01 am All these filters are also available inside Autio ToolKit.
I see, but its the same: https://github.com/mbrucher/AudioTK/blo ... er.cpp#L80

Once you change cutoff (or q or gain) you update all the coefficients. So on each cutoff variations depends N coefficients, not one single value (i.e. the param being changed). If I have a block of 256 values and cutoff is automated at audio rate (or every 1/8, so 32 values), I can't keep a simple list of 256 (or 32) cutoff's different values, but calculate for each value N coefficients.

In different words: I need a filter where variations of params depends by only them, not related data. Not sure if it exist :) But I think so for what I'm learning :)

Example here: https://web.archive.org/web/20170308095 ... .php?id=23
If I change cutoff or res, I simply need to update the f or q variable (1 to 1).
So on a list of 256 cutoff (normalized) variations (blockSize) I simply keep a list of 256 warp values...

Post

Should be simple to examine the code and see which variables need to be updated for specific parameter changes. Then just add separate code paths for each parameter

Post

Nowhk wrote: Wed Oct 31, 2018 9:33 am Thanks for the effort, FredAnton. And of course Andy for the creation of such a filter.
I'd like to use a parameterized filter on my audio app, and Nigel suggest it to me, which sound good.

BTW, a question: I'd like to have a single value for each param; so if I change gain, fc or q, I don't need to recalculate ALL coefficients every timee, but a single variable/value for each.

What should be the concept about parameterized filter, right?
Here I see you change all on every cutoff change, not only the cutoff variable.

Is it possible? Or do I need to switch to another filter? Suggestions?

Thanks for the help!
You're welcome!

If you want to have de-coupled coefficients you "just" need to oversample the filter a whole lot (say x64) so that all the coefficients are kept in their initial linear section, then you can use trivial forward euler type integration:

bandz = band
lowz = low
high = input - res * bandz - lowz
band = bandz + gain * high
low = lowz + gain * bandz

or the more traditional Chamberlin form:

bandz = band
lowz = low
high = input - res * bandz - lowz
band = bandz + gain * high
low = lowz + gain * band

My guess is that a few coefficient calculations will be much lower cpu than the amount you'll chew with oversampling forward euler filters like this with no corrections. You should give it a go and do some profiling and report back here what you find.
The Glue, The Drop - www.cytomic.com

Post Reply

Return to “DSP and Plugin Development”