Diode ladder filter

DSP, Plugin and Host development discussion.
RELATED
PRODUCTS

Post

i spent the last 3 or 4 days tweaking and modifying my filter, it was nasty
if someone wants to hear/compare - the end result is this:
vb303_2012_N0NF2_vs_x0x.rar (8.7MB)(wav inside) and ignore the imperfect sync
It doesn't matter how it sounds..
..as long as it has BASS and it's LOUD!

irc.libera.chat >>> #kvr

Post

Z1202 wrote:Not sure how much detail I can reveal here without breaking my contractual obligations though
Are you with Stephan now? (just curious :) )

Post

Urs wrote:
Z1202 wrote:Not sure how much detail I can reveal here without breaking my contractual obligations though
Are you with Stephan now? (just curious :) )
Nope. Enjoying my new job position at NI (which formally has nothing to do with DSP BTW :)). BTW we missed you at Stephan's party ;)

Post

antto wrote:from what i know, in the 303, the VCO output is biased, BUT there is a HP filter right before the VCF stage, so it effectively kills that
the cutoff frequency to the VCF comes from R69 (the current) it gets mixed with the input signal in there, the input being very tiny, compared to the cutoff freq signal
"cutoff" and "vco" signals don't get added.

VCO (scaled down) drives differential transistor pair at the bottom of the ladder. Filter CV drives exponential voltage to current converter that sets current to differential pair. So, you drive one side of ladder with I1 = Icv/(1+exp(Vin/Vt)) and other side with I2 = Icv/(1+exp(Vin/Vt)) where Icv is current proportional to filter CV, Vin is total differential voltage at input and Vt is 0.026.

Here is cute part: if you overdrive input pair you will get tanh saturation of course, but biggest effect is not from input distortion. Cutoff is set by capacitors in ladder and dynamic (small signal) resistance of diodes. Dynamic resistance of diode is Vt/Id where Id is total (large signal) current trough diode. If you start to drive filter input harder (lets say 5mV or more which is still below noticeable distortion from differential pair at input) you'll get large enough swings of current trough diodes => it's sort of filter frequency self modulation because cutoff point is set by currents trough diodes. IMHO this effect is more important than just input pair saturation. BTW same thing happens in transistor ladder and this is answer to question "can I get by with just input distortion".

If you want to, post nice clear schematic of VCF with component markings and I'll explain (when time permits) any stuff you haven't figured out.

Post

Z1202 wrote:Nope. Enjoying my new job position at NI (which formally has nothing to do with DSP BTW :)). BTW we missed you at Stephan's party ;)
Ahhh... congrats to your new position :)

Yes, I was in Australia at that time. I'll come to the next party, hopefully soon!

Post

Trying to model diode (or transistor for that matter) ladders with a single tanh at input stage is like trying to make cider by mixing apple juice and ethanol: just because you can get drunk by drinking it doesn't mean it's actually good.

Post

urosh wrote:"cutoff" and "vco" signals don't get added.
ok, my mistake..
urosh wrote: Here is cute part: if you overdrive input pair you will get tanh saturation of course, but biggest effect is not from input distortion. Cutoff is set by capacitors in ladder and dynamic (small signal) resistance of diodes. Dynamic resistance of diode is Vt/Id where Id is total (large signal) current trough diode. If you start to drive filter input harder (lets say 5mV or more which is still below noticeable distortion from differential pair at input) you'll get large enough swings of current trough diodes => it's sort of filter frequency self modulation because cutoff point is set by currents trough diodes. IMHO this effect is more important than just input pair saturation. BTW same thing happens in transistor ladder and this is answer to question "can I get by with just input distortion".
"if" ... but does it happen actually in the 303? there is no "overdrive" control on it.. there is also no such trimmer on the pcb, there are only trimmers for tuning the cutoff freq and the vco pitch, and the 5.333 reference voltage
urosh wrote:If you want to, post nice clear schematic of VCF with component markings and I'll explain (when time permits) any stuff you haven't figured out.
there are clear schematics - the x0xb0x schematics (which is the same thing basically, the analog part)

i don't understand these schematics (i can barely tell if a cap is used as LPF or HPF) nor do i understand how to turn an analog filter into it's digital "model"
how you could help me, i guess if you can tell me about the HP filters around the filter and all the way to the output, because this part for me is difficult
http://wiki.openmusiclabs.com/wiki/x0xb ... board2.png <- here's the x0xb0x schematic
It doesn't matter how it sounds..
..as long as it has BASS and it's LOUD!

irc.libera.chat >>> #kvr

Post

So I updated my code (new link, see OP):
Version 0.2: greatly simplified equations; add highpass filter in feedback path
antto wrote:karrikuh, maybe i should try your filter in my synth? i already got 4x oversampling going on for other reasons..
Sure, that's why I published it under MIT license. :)

Regarding the nonlinearities: I might start experimenting again with inserting more of them in my code and check the effect on the overall behavior. I have to say that I'm already quite satisfied with the sound of my simplified version, it can already sound fairly 303ish, but then I don't have a real reference to compare to... Thanks so far for your feedback!

Post

karrikuh: thank you!
i tryied your filter.. i had to change some things a bit (due to GCC)
my first impression is - it behaves good but when i boost the resonance - the resonant frequency tuning "moves" which is nasty
then i replaced your clipper with a hard clipper, as in my filter - that fixed the tuning issues
i also removed the "gain compensation" code

i'll have to move the coefficient calculation out of the tick() function, since in my case, i got 4x oversampling, but cutoff only changes once per 4 samples..

then, to be able to compare against the real thing, i'll have to place all the HPFs around the signal chain again, and figure their frequencies..
It doesn't matter how it sounds..
..as long as it has BASS and it's LOUD!

irc.libera.chat >>> #kvr

Post

antto wrote:karrikuh: thank you!
i tryied your filter.. i had to change some things a bit (due to GCC)
my first impression is - it behaves good but when i boost the resonance - the resonant frequency tuning "moves" which is nasty
then i replaced your clipper with a hard clipper, as in my filter - that fixed the tuning issues
From what I understand, the detuning of the resonant frequency when driving the filter hard is also found in the analog circuits.
antto wrote: i'll have to move the coefficient calculation out of the tick() function, since in my case, i got 4x oversampling, but cutoff only changes once per 4 samples..
I recommend to compare both variants in a benchmark. I learned that with MSVC++ compiler 10/11, my version where coefficient update code is inside tick() is faster than having a separate set_cutoff() method even when cutoff update happens only every nth sample (like when oversampling). The compiler is probably able to figure out itself that the coeffs don't change between multiple calls to tick() and will move the respective precalculations out accordingly. Modern compilers are smarter than one might think and usually produce best results from clean and straight-forward source code.

Post

From what I understand, the detuning of the resonant frequency when driving the filter hard is also found in the analog circuits.
not really, in my x0xb0x, i've replaced R97 (which is 10kOhm) with a 10kOhm potentiometer
when i decrease it's resistance - more feedback goes into the filter, the resonance becomes louder, and the input signal begins to dissapear into the resonance
but the cutoff frequency does not move..
It doesn't matter how it sounds..
..as long as it has BASS and it's LOUD!

irc.libera.chat >>> #kvr

Post

karrikuh: can you add in a second HPF to your last model?
from:
y0 = x0 - HPF(k*y4)
to:
y0 = HPF(x0 - HPF(k*y4))

i don't know how to add it, as this code is all voodoo to me
btw, if you have the time or nerves to explain how do you come up with this filter.. :cry: :help:
It doesn't matter how it sounds..
..as long as it has BASS and it's LOUD!

irc.libera.chat >>> #kvr

Post

(Sorry for not responding earlier, too busy...)
antto wrote:karrikuh: can you add in a second HPF to your last model?
from:
y0 = x0 - HPF(k*y4)
to:
y0 = HPF(x0 - HPF(k*y4))

i don't know how to add it, as this code is all voodoo to me
btw, if you have the time or nerves to explain how do you come up with this filter.. :cry: :help:
Hmm, maybe I will find the time eventually to write up some kind of tutorial about how design these kind of algorithms, including examples.

Regarding the HPF: I found that in the current implementation, a strong DC offset appears in the output y4 with low cutoff frequency wc of the overall filter and strong resonance. The DC offset is not present at the output y5 of the HPF. I spent some time verifying my equations and couldn't find any mistakes so far. But I don't really have a good explanation for this. If someone has an idea, please share!

In other news, I derived some method to analytically (rather than numerically by iteration) solve the feedback loop of a filter with a single nonlinearity for both the case of a hard clipper and the soft clipper y = x / (1 + |x|). So using this, no convergence problems anymore, even at the most extreme settings. Of course, some oversampling is still necessary to combat aliasing and frequency warping.

Post

karrikuh wrote:In other news, I derived some method to analytically (rather than numerically by iteration) solve the feedback loop of a filter with a single nonlinearity for both the case of a hard clipper and the soft clipper y = x / (1 + |x|).
I wonder how your method compares to this:
http://www.native-instruments.com/filea ... xNLZDF.pdf

Regards,
{Z}

Post

Z1202 wrote:
karrikuh wrote:In other news, I derived some method to analytically (rather than numerically by iteration) solve the feedback loop of a filter with a single nonlinearity for both the case of a hard clipper and the soft clipper y = x / (1 + |x|).
I wonder how your method compares to this:
http://www.native-instruments.com/filea ... xNLZDF.pdf

Regards,
{Z}
I am aware of this paper. I did read over it several times, but never felt like really digging into all the theory. From a superficial look I would guess that my solution is just a particular application of the more general framework developed there.

Post Reply

Return to “DSP and Plugin Development”