Analogue Modeling Tutorial

DSP, Plugin and Host development discussion.
RELATED
PRODUCTS

Post

Yep, loved that book! But also Hal Chamberlin's.

Post

This is amazing, timeless contribution here Urs, :hug:

Post

Will Pirke's book 'designing software synth. plugins in c++' is also an interesting one that covers some of the basic concepts. What it does not cover is the kind of stuff that one of the papers that you had linked in your blog did (the one titled 'making digital filters sound analog' by Dave Rossum) - the part about 'small signal behavior' and the effects of limited length mantissa was particularly interesting. I have spent a lot of time trying to make models of guitar amps and it rarely if ever occurred to me that such numerical issues can cause trouble with filters that otherwise should have been fairly well behaving simple calculations, but once you upsample a signal to 256khz or so, I guess it's entirely reasonable.
~stratum~

Post

Yes, one of the main reason I'm on the fence with Direct Form filters is that I've probably spent months trying to debug weird issues reported from customers over the years. These were numerical stability issues creating DC offsets which were significant enough to corrupt audio. I think I still have some extra high pass filters in some of the older stuff, just in case it happens again. However, we're slowly weeding them all out, the reign of biquads has ended for us.

I can't imagine how many otherwise good plug-ins, even companies, went poof just because the filter concept wasn't fit for the task. But these are the standard filters you'd read about in, well, every book. Hence I use every occasion to promote Andy's linear SVFs which give identical results to Direct Form filters, but without the numerical issues and more simple math: http://www.cytomic.com/technical-papers - this isn't necessarily a testament to Analogue Modeling, but it shows how some of the same old same old concepts might need to be questioned every now and then.

I still believe the lack of a division instruction + cost of multiply in earlier CPU architectures may have played a role in the absence of those simpler-yet-IMHO-superior methods in textbooks. Hal Chamberlin's SVF isn't far off from Andy's, it just needed an extra divide maybe and trapezoidal integration - which he must have known to be superior back then. And suddenly the filter (early SVF, not a Direct Form one) would've been stable throughout the full range of cutoff and resonance, and many headaches would've been spared.

Post

In my case the problem is probably that cascaded gain stages amplify errors made in earlier stages, because Dave R.'s formula in that paper indicates that double precision should have been adequate. A single 'tube' gain stage with a gain level of 1000 (unrealistic in an analog circuit) always sounded better than 3 cascaded gain stages each with 10, probably because the last 2 gain stages have an amplification factor of 100 together, magnifying earlier problems 100 times, and D.C. offset removal with one pole H.P. filters didn't help much either (they are there whether you intentionally want to remove D.C. accumulation errors or not because they are a part of the real analog circuit). (Ironically those H.P. filters in real tube amps do have D.C. offset accumulation too (yes that's true in spite of the fact that they are H.P. filters), but this behavior is always avoided in high gain amps by modifying the circuit accordingly.).

Thanks for the tip about SVF filters. I'll read those papers.
~stratum~

Post

Urs wrote: I still believe the lack of a division instruction + cost of multiply in earlier CPU architectures may have played a role in the absence of those simpler-yet-IMHO-superior methods in textbooks.
Well, even on modern systems the division costs you almost as much as the rest of the filter combined, but personally I think it's somewhat silly to count it towards the "process cost" since you don't need that for static filters (you just do it once when you update coefficients) and even for dynamic filters you can do it before interpolation anyway.

In fact, I would argue that for static filters the extra processing cost is negligible at best and for fully dynamic filters the ZDF-SVF design is typically faster when you factor in the cost of updating the coefficients. But all this assumes a modern architecture where the cost of multiplies and adds is negligible.

It's also worth noting that even without introducing a division you can modify the Chamberlin SVF into something that can process arbitrary biquads and the result is probably the best 2-pole design that I know of that isn't based on trapezoidal integration. There's no real reason to actually use it for anything though, since the ZDF-SVF is superior in pretty much every way.

Post

Urs wrote: How about this. I'll just keep things as they are, but replace "OTA" with "VCA". Texas Instruments for example have a VCA-on-a-chip with a positve and an inverting input, so it doesn't seem too far off (but I guess it's a voltage source...). Hmm, or maybe I call it "VCCS", for Voltage Controlled Current Source. That's a less familiar name, but it's actually what it is. Yep, VCCS doesn't seem to just apply to OTAs, it may apply to a lot of circuits.
Well, doing it with is VCA is doable, this works on a similar principle:

http://mutable-instruments.net/static/d ... mixing.pdf

Post Reply

Return to “DSP and Plugin Development”