# Using the Koren Tube Equations

DSP, Plug-in and Host development discussion.
RELATED
PRODUCTS
Jafo
KVRAF
Topic Starter
2131 posts since 20 Dec, 2002 from The Benighted States of Trumpistan
For those not in the know, they seem to be the stuff of legend, said to give exquisitely accurate results for what happens in real tube circuits. At the heart of many highly-regarded plugs, such as Voxengo's Warmifier and Nick Crow's amplifiers, they simply work, period. They can be found here. For those of us using waveshapers, they promise the world!

Unfortunately, they're rather hostile to the beginner, and he doesn't explain all of the parameters anyway. (Uh-oh, n00b questions to follow...)

How do you code them, anyway? A lot of what we love about tubes is that typical designs have a dynamic dc offset. I assume that's due to some sort of a feedback of the signal to the input ('cause it's a circuit, after all)? I know that I can get a similar result in a waveshaper by taking a portion of the output and adding it to the input, but how do you do it with Koren's equations?

I know that a typical pickup's output is about a quarter to a half volt; and when I record my Strat direct, wave editors show that single notes can get to about a third, maybe a half, of the maximum. Does that mean that I can treat the +/- of the input as +/- 1 V, or should I scale it somehow?

I have more Qs (and I can't be the only one!), but that's enough for now. TIA!
Joy and kindness are acts of resistance -- fight the power!

onqel
KVRist
95 posts since 8 Jan, 2008 from norway
The koren equation for triode is meant to be implemented in an analog circuit simulation, and to derive a tube sound out of it, you have to make a model/simulation of a triode gainstage first.. I would recommend you visiting www.simulanalog.org for a complete model of a triode gain stage

-John

Jafo
KVRAF
Topic Starter
2131 posts since 20 Dec, 2002 from The Benighted States of Trumpistan
onqel wrote:The koren equation for triode is meant to be implemented in an analog circuit simulation, and to derive a tube sound out of it, you have to make a model/simulation of a triode gainstage first..
Oh! Didn't realize that, actually...
I would recommend you visiting www.simulanalog.org for a complete model of a triode gain stage
Indeed! That's where I got the idea for the dc offset as a feedback loop, and inspires many people to make transients extra saturated in their simulations.

But that just pushes the question further back, though -- how do you take Serafini's equations (which still use the x**1.5 law) and turn them into code? Text processing, interactive fiction, and language mungers, I can do. This... it's that z-transformation math stuff, right?

Ah well; at least I have a direction now. ty!
Joy and kindness are acts of resistance -- fight the power!

KVRist
212 posts since 6 Sep, 2007
You'll also need to know how to trace a load line of the triode stage...
I don't know how much you do know about tubes, but I can suggest you to read this great arcticle from Valve Wizard:
http://www.freewebs.com/valvewizard1/Co ... _Stage.pdf

Jafo
KVRAF
Topic Starter
2131 posts since 20 Dec, 2002 from The Benighted States of Trumpistan
Wild Hades wrote:You'll also need to know how to trace a load line of the triode stage...
I don't know how much you do know about tubes, but I can suggest you to read this great arcticle from Valve Wizard:
http://www.freewebs.com/valvewizard1/Co ... _Stage.pdf
Gotta quote my eldest: "Awesome squared!"
Joy and kindness are acts of resistance -- fight the power!

drfrankencopter
KVRer
19 posts since 28 Feb, 2010
I haven't really looked into amp modeling before, but I would suspect that you'd get quicker (and perhaps better) results by really nailing down the anti-aliasing process, internal oversampling, and the inter-stage filtering.

If you're looking at modeling a tube in cut-off, it's pretty extreme clipping, I don't think a SPICE type model is necessary. What you need to 'nail' is the characteristics of the filtering of the surrounding circuitry.

On the other hand, if you're looking to model subtle tube distortion, then maybe a SPICE type model is appropriate.

Then again, I've never tried coding any of this up...so it's all conjecture.

Cheers

Kris

Jafo
KVRAF
Topic Starter
2131 posts since 20 Dec, 2002 from The Benighted States of Trumpistan
drfrankencopter wrote:I haven't really looked into amp modeling before, but I would suspect that you'd get quicker (and perhaps better) results by really nailing down the anti-aliasing process, internal oversampling, and the inter-stage filtering.

If you're looking at modeling a tube in cut-off, it's pretty extreme clipping, I don't think a SPICE type model is necessary. What you need to 'nail' is the characteristics of the filtering of the surrounding circuitry.

On the other hand, if you're looking to model subtle tube distortion, then maybe a SPICE type model is appropriate.

Then again, I've never tried coding any of this up...so it's all conjecture.

Cheers

Kris
True enough to all of the above... Fundamentally, what most of us want is any responsive, magical tone, rather than a perfect emulation of a specific piece of gear. I've been playing with the Pakarinen preamp and Doidic power amp equations, adding a dc offset based on feedback, to rather satisfying effect. If I could get the filtering and anti-aliasing right, it'd be even better, but I'm still learning. Polynomials work extremely well, too. Still, none of this has the same numinous mystique and glorious macho appeal of the fabled Koren approach, ya know?
Joy and kindness are acts of resistance -- fight the power!

duncanparsons
KVRAF
8386 posts since 11 Apr, 2003 from now on the flat
Jafo wrote:Gotta quote my eldest: "Awesome squared!"
hmm.. the trouble with that is the awesome will be rectified.. you need an odd power to keep the true nature of the awesome..

Altho, having said that, the sudden turning points in even powers will be made up from moments of infintie awesome, so maybe not such a bad thing

"Moments of Infintie Awesome".. I gotta make that track..

Aleksey Vaneev
KVRAF
3868 posts since 7 Sep, 2002
Norman Koren's equation is great if you have tube gain stage working - can be used for both "clean path" and guitar overdrive. But this equation is a CPU hog for sure, and can't be opimized well if you need the subtleties to remain.

BTW, Warmifier is not an exact tube gain stage model - it actually uses a variation of Koren's equation to produce a non-linear function. The dynamic behavior is different to tube model.

Jafo
KVRAF
Topic Starter
2131 posts since 20 Dec, 2002 from The Benighted States of Trumpistan
Aleksey Vaneev wrote:Norman Koren's equation is great if you have tube gain stage working - can be used for both "clean path" and guitar overdrive. But this equation is a CPU hog for sure, and can't be opimized well if you need the subtleties to remain.
Yah, I tried the demo for WaveArts' TubeSaturator, and it brought my system to its knees. Sounded great when frozen, but not that much better than certain plugs I could mention -- certainly not enough to be worth the extra cycles!

And yep, the subtleties are exactly what it's all about.
BTW, Warmifier is not an exact tube gain stage model - it actually uses a variation of Koren's equation to produce a non-linear function. The dynamic behavior is different to tube model.
That's both intriguing and reassuring to know!
Joy and kindness are acts of resistance -- fight the power!

Aleksey Vaneev
KVRAF
3868 posts since 7 Sep, 2002
For ultimate results you could digitize tube transfer functions yourself from http://frank.pocnet.net/ and use whatever approximation you like. From my experience, precise tube's transfer function is the vital part of the model, because it not only provides harmonics, but also controls dynamic behavior: its complexity and "fullness" depends on the complexity of the approximation.

For example, I myself was previously wrong thinking tube model can't produce symmetric overdrive (clipping) - I mean a single tube - it can, but this solely depends on how precise the transfer function is.

In this respect, Koren's equation is great-much better than most other equations (e.g. 3/2 power law), but it's not perfect if you are looking for a subjectively great sound - which tubes deliver.

dub3000
KVRist
74 posts since 8 Jan, 2006
slightly off-topic: eureqa does a pretty good job of finding simple approximations of weird functions - http://ccsl.mae.cornell.edu/eureqa

i've used excel to build weird wave shaping lookups and then chucked it into eureqa to find nice functions to represent it. can do a lot of stuff.

Aleksey Vaneev
KVRAF
3868 posts since 7 Sep, 2002
dub3000, at a first glance, it's quite a good tool for building approximations for the tube transfer function.