Diode ladder filter

DSP, Plugin and Host development discussion.
RELATED
PRODUCTS

Post

Hey Karrikuh! This filter is really cool, it's the only (practically applied) trapezoidal intergration example I've seen so far. Great work! Most people talk theory - but never show any practical examples. The only thing that is confusing me is as to what frequency to set the HP filter at??? At my first try - I actually (accidently) let it track the main cutoff frequency - ended up with a whopping +-20dB of gain in the low frequencies (kinda makes a shelf slope)!

Has anybody done this as a 12dB/octave filter?
Non-linearity in feedback path?
Without the HP filter, or more/different HP filters?

Oh, if you ever decide to write a paper on how you derived your formula - can I ask to write it as a technical tutorial and not a technical paper, please. Most papers are written from a mathematical "proof" perspective - instead of a practical DSP perspective.

Inanyway - thanks, this has made my day!

Andrew

Post

Ichad.c wrote:Hey Karrikuh! This filter is really cool, it's the only (practically applied) trapezoidal intergration example I've seen so far. Great work! Most people talk theory - but never show any practical examples.
Thanks!
Ichad.c wrote:The only thing that is confusing me is as to what frequency to set the HP filter at??? At my first try - I actually (accidently) let it track the main cutoff frequency - ended up with a whopping +-20dB of gain in the low frequencies (kinda makes a shelf slope)!
I added a HPF in the feedback path to get a more accurate emulation of the 303 filter according to Anttos analysis. Here, the HPF cutoff is set to some relatively low fixed value like 100 Hz. This will effectively eliminate resonance of the core filter in the low freq range.

However, as I wrote earlier, I'm not sure if the current implementation with HPF is correct (I'm getting strange DC offsets). If you want to bypass the HPF, set the HPF cutoff to 0.
Ichad.c wrote:Has anybody done this as a 12dB/octave filter?
Non-linearity in feedback path?
Without the HP filter, or more/different HP filters?
Surely, I have many variants of filter code here. I can probably post some more, but at some point, your really want to learn and understand the theory in order to be able to create your own filter designs. In my experience, this is far more satisfying on the long term as relying on "black box" code.
Ichad.c wrote:Oh, if you ever decide to write a paper on how you derived your formula - can I ask to write it as a technical tutorial and not a technical paper, please. Most papers are written from a mathematical "proof" perspective - instead of a practical DSP perspective.
Yes, if I do it, it will be very informal style. Until then, a rather well written paper with detailed step by step application of the technique to the standard Moog ladder is "PRESERVING THE STRUCTURE OF THE MOOG VCF IN THE DIGITAL DOMAIN" by F. Fontana.

Post

Thanks for the link - I'll give it a read :)

Ironically enough, just before I found your thread, I added a HP into FB path of a "normal" 1-sample delay ladder topology - the same +-20dB 'lowshelfish' slope appears - tried 1pole, 1pole1zero and a biquad - results are similiar; obviously this is +phase at play. As far as I've read - there is a HP filter preceeding the main filter in the 303, so maybe your test-signal is feeding your filter with DC - which is not present in the original 303 - hence the "strange" results :?:

In the end I settled on a HP in front of the main filter with a slightly lower cutoff - worked okay. Was thinking of maybe doing a 2X parralel HP thing - infront - like a fake Bessel type curve or something - just to ease the phase-warping. Or maybe an Allpass in the FB path - I like new things and experimenting...
Oh - I also tried a rational tanh approximation (Cody and Waite's to be exact) and it worked fine with your filter btw.(never liked that sigmoid that you where/are using).

Inanyway - a couple more examples would be awesome - but probably not necessary, if you're too busy.

Thanks for starting this thread - I've already learnt a lot! And also thanks to neotec and mystran on other threads as well.

Andrew

Post

sure there is a HP filter in the feedback, but i am not sure if it's just one or more

there are a bunch of HP filters all around the audio path on the 303
(from VCO > VCF > VCA > MIXER, in other words till the output)
the nasty thing is - i suspect one or two of these HP filters might be changing it's cutoff frequency depending on the resonance
It doesn't matter how it sounds..
..as long as it has BASS and it's LOUD!

irc.libera.chat >>> #kvr

Post

antto wrote:i suspect one or two of these HP filters might be changing it's cutoff frequency depending on the resonance
I suspect that too. In the end many of those HP-filters are just capacitors. Other elements such as lowpass filters may or may not act as time varying and frequency dependent resistors against ground.

A simple highpass may hold as model for most purpose, but for accurate models you'll need to carefully study the behaviour of the analog circuit.

Post

Urs wrote:
antto wrote:i suspect one or two of these HP filters might be changing it's cutoff frequency depending on the resonance
I suspect that too. In the end many of those HP-filters are just capacitors. Other elements such as lowpass filters may or may not act as time varying and frequency dependent resistors against ground.
Well, the HP filters are mostly preceded/followed by buffers, with the notable exception of the caps in the resonance path. So basically I would imagine that the "input highpass" (eg C17/C23) would stay more or less constant. The DC blockers on the output from the ladder (C25/C27) are not buffered from the last stage (C26) so those might move slightly depending on cutoff (and maybe even depending on the non-linear behavior in the ladder; C29 might theoretically have some effect on those, but probably not much). Then the ones in the output path (C14/C15) are connected to the resonance pot (though it might not be significant for C14). As for C22, no idea if it has any effect on anything.

Even if one ignored any cutoff/resonance dependencies, there's enough caps in there that you would expect to get more low-frequency phase-shift than you can extract from a single pole high-pass and if you got enough phase-shift then in closed-loop you'll get another resonance at low-frequencies (and eg Stinchcombe's observation was that this actually does happen).

Post

I couldn't get version two of your filter to work properly... version 1 worked like a charm once i had replaced your fast_tanh with tanh() and changed HALF_PI to PI (tuning was off). This is on mac by the way. V2 had a DC offset and the resonance didn't seem to be anywhere near as strong as v1.

thanks a lot for posting this.

oli

Post

hibrasil wrote:I couldn't get version two of your filter to work properly... version 1 worked like a charm once i had replaced your fast_tanh with tanh() and changed HALF_PI to PI (tuning was off). This is on mac by the way. V2 had a DC offset and the resonance didn't seem to be anywhere near as strong as v1.

thanks a lot for posting this.

oli
Yes, I noticed it to, I suspect I did something wrong in the derivation or implementation, will fix soon... However, you can still use the latest version (simpler, more efficient than old one) and remove the HPF parts. From a quick glance, what you need to do is: 1) remove line 107 and "-z[4]" in line 87.

[/list]

Post

antto wrote: the nasty thing is - i suspect one or two of these HP filters might be changing it's cutoff frequency depending on the resonance
The OTA filters do not have any highpass filters and do have this issue too. I tried both versions posted in follwing thread:
http://www.kvraudio.com/forum/viewtopic ... c&start=15

I also implemented the OTA by myself and also ended in this resonance / frequency issue. I really have the feeling it has something to do with the non-linear components.
The interesting point is that this problem does not exist in the transistor ladder filter implementation.

EDIT:It looks that you should carfully choose the non-linear components to avoid the resonance / cutoff issue.
Last edited by ToguAudioLine on Mon Jan 07, 2013 7:36 am, edited 1 time in total.
TAL Software GmbH
https://tal-software.com/

Post

hi, i have been working with the old "naive" diode ladder model (based on kunn)
and managed to make it behave better, after i have a way to compare against the real filter in realtime (via oscillator hard sync)

http://www.youtube.com/watch?v=pnBEACajFtg

my conclusion is that there are 2 HP filters in the feedback loop

i'm not familiar with the OTA thing, but if it uses opamps in the feedback - they have capacitors inside them so..
It doesn't matter how it sounds..
..as long as it has BASS and it's LOUD!

irc.libera.chat >>> #kvr

Post

antto wrote:my conclusion is that there are 2 HP filters in the feedback loop

i'm not familiar with the OTA thing, but if it uses opamps in the feedback - they have capacitors inside them so..
Should be at least 4 caps in the feedback loop directly, they may not necessarily act as HP but will have an impact on the frequency response for sure.

Richard
Synapse Audio Software - www.synapse-audio.com

Post

yes, if you count C22 it's 4
but in practice, even with 2 HPFs it becomes dangerous, cuz a low freq oscillation starts to occure, it becomes mad
so i think the other HPFs would be with uber low cutoff freqs
It doesn't matter how it sounds..
..as long as it has BASS and it's LOUD!

irc.libera.chat >>> #kvr

Post Reply

Return to “DSP and Plugin Development”