Dissecting a Budget Tube Screamer Clone

Started by cushychicken, December 14, 2015, 12:07:18 AM

Previous topic - Next topic

lethargytartare


ashcat_lt

Quote from: PBE6 on December 14, 2015, 04:17:21 PM
It certainly does result in a hash being added to the original signal, although it's different than crossover distortion which is especially nasty sounding.
It is crossover distortion in that the region near the 0 crossings is distorted.  It's kind of the opposite of the series-diode crossover distortion we see more often, but...

Consider for a moment a push/pull amp stage.  Each tube (or transistor) should be biased in such a way that it cuts off right at 0, one amplifies the bottom peaks and the other amplifies the top.  If the bias is off in one direction, there will be a portion near the zero crossings where both tubes are off, you'll have a "gap", and it'll sound a lot like series-diodes.  If the bias is off the other direction, though, you'll have a portion of the wave where both are conducting, you'll have an "overlap", and it'll sound a lot like a rather tame TS.  In both cases there's distortion in the crossover region. 

RG I think see where you're going - gain is always 1+something*.  My point is that a TS does not behave quite exactly like a Dist+ with a unity clean mix added in.  It's pretty darn close, but not quite right.


* I never actually think about it like that, though.  Gain is always exactly the inverse of the divider ratio, so I just figure the divider and then flip.  Course, the opamp gain equation might be an easier way to figure some divider ratios...

R.G.

Quote from: ashcat_lt on December 15, 2015, 02:06:24 PM
RG I think see where you're going - gain is always 1+something*.  My point is that a TS does not behave quite exactly like a Dist+ with a unity clean mix added in.
Of course not. It's a different circuit. But there is always the unity gain signal at the output of the clipping stage, even if you short the feedback path on the clipping opamp. You can't get rid of it. You can only add to it the feedback path's signal, linear, clipped, or whatever.

You can make a similar setup to get the same signal by doing an inverting clipping amp, UN-inverting it, and adding that to the original signal. The math always comes out original signal * 1 + (feedback generated gain). Any way you generate that signal will sound the same. I can't remember if the D+ inverts.

It was popular at some points back in pedal prehistory (i.e. 1960-1980) to invert either signal or distorted signal and add them, effectively subtracting the dry signal from the output to leave mostly the distortion products. It was an acquired taste, but did give a more distorted output back when very few people knew anything about making distortion.

But in either event:
QuoteIt's pretty darn close, but not quite right.
Can't be wrong or right; those terms only have meaning in this comparison if you define the D+ as "right". Different? Sure.   :icon_wink:

Quote* I never actually think about it like that, though.  Gain is always exactly the inverse of the divider ratio, so I just figure the divider and then flip.  Course, the opamp gain equation might be an easier way to figure some divider ratios...
In a world where gains are always much larger than one, it is simpler to ignore the "1+" part of the gain, but it's always there. The difference between 100 and 101 is arguably forgettable. Mostly, so it the difference between 10 and 11. But Mother Nature insists that the math come out right no matter what approximations we make.


R.G.

In response to the questions in the forum - PCB Layout for Musical Effects is available from The Book Patch. Search "PCB Layout" and it ought to appear.

R.G.

I got all involved in typing and hit send too soon.  :icon_eek:  :icon_biggrin:

On crossover distortion. Yeah, any deviation from perfectly linear right around a zero crossing is "crossover distortion".  Excepting for deliberately contrived situations, crossover distortion is usually an artifact of a stacked output stage that's using a pull-down and a pull-up device and the exact nature of the hand-off.

In Class A stages, neither device ever shuts off, so crossover is not an issue. In Class B, you're trying to get one device to shut off **exactly** at zero and have the other device pick up conduction as though nothing has happened. There's a fair body of knowledge accumulating that real Class B may not exist, as such, in that real devices can't go to zero and have another device simply carry on on the other side of zero. The overlapped biasing of Class AB is an attempt to get the shutting-down nonlinearities and the starting-up nonlinearities of two devices to cancel one another; this has proven to be quite difficult and perhaps impossible to do exactly.

Also, over-compensating for Class B crossover by making the crossover zone where both outputs conduct merely moves the artifacts of crossover distortion away from the zero crossing point by what's called "gm doubling". Of course having the artifacts be away from actual zero crossing may be more sonically pleasing, but the glitches are still there.

In general.

With that as background, it's quite difficult to get large quantities of crossover with pure opamp signal circuits. Monolithic circuits can be (and are) set up to cure most of the issues with crossover and regularly get very small crossover distortion indeed. It's nothing like what I'm hearing about the Tube Screamer circuit here.

There is a kind of can't-get-there-in-time crossover distortion that happens in precision rectifier circuits where diodes changing feedback paths suddenly demand instantly-different output voltages, and the opamp can only slew at a certain speed. That's not what usually happens with back to back clippers in a feedback path. I'd be interested in seeing oscilloscope traces of the crossover that the plural you is referring to.
R.G.

In response to the questions in the forum - PCB Layout for Musical Effects is available from The Book Patch. Search "PCB Layout" and it ought to appear.

PRR

> It is crossover distortion in that the region near the 0 crossings is distorted.

I know what you are saying, but I have to call "semantic error" on this one.

"Crossover" has many audio meanings. A crossover network splits frequency to woofer and tweeter. Punk sings with a twang, he's a crossover artist.

But "crossover distortion" has a widely understood meaning.

Over-simplified plot. Red line is our clipper (without the +1 feature). Green is crossover distortion.



The raucous sound of crossover distortion spoils many audio amplifiers at low level. In the last 30 years it has been made quite-small; Cordell's book explores the limits.

The clipper.... strictly speaking there is NO distortion in the crossover. As the output crosses through zero it is a faithful but larger copy of the source. (If I plot source times -5, it overlays the clipper output up to ~~300mV.) Only away from crossover does distortion happen.

I would say "clean crossover but distorted peaks".

The particular musical flaw of crossover (as commonly understood) is that SMALL signals are weak or missing. As guitar fades from big to silent, the big is near-clean, the smaller is crappy, and then it just quits.
  • SUPPORTER

ashcat_lt

#25
I do understand the common definition of crossover distortion, and I'm not trying to argue, but this...
Quote from: PRR on December 17, 2015, 07:56:04 PM
I would say "clean crossover but distorted peaks".
...is kind of a matter of perspective, and completely dependent on both input level and the nominal gain of the opamp stage (without diodes).  There's at least a couple of volts between the diode drop and as close to the rail as the opamp will go, and by that point, your "clean crossover" starts to look more like the aberrant bit.  There's another recent thread where dude added a whole bunch of gain to a similar circuit and it ended up cleaner than expected, with fizzy tails that sounded a lot like crossover distortion...

So, when I said "Dist +", what I meant was "a non-inverting gain stage similar to the TS followed by diode-to-ground clipping instead of the feedback diodes", but lets just go ahead and use the TS itself, but move the diodes.  Mix that output with the unity clean input and it will sound a whole lot like a normal TS, but it won't be exactly the same, which is what I meant by "right".  I'm sure this wasn't what RG was actually trying to say, but I think it's kind of easy to get there from what he did say, and I've seen it suggest elsewhere that this is an accurate model.  It's close, I use it myself in digital because it's a heck of a lot easier.  I'm actually beating my head against the problem of finding a closer approximation without using too many more CPU ticks or introducing latency.  If you have any ideas...

PBE6

The output of an inverting opamp gain stage with diodes in the feedback loop is described by V(out) = -V(diode). The Tubescreamer output Is described by V(out) = V(in) + V(diode) so if you flip the inverted clipper and add it to the original signal you'll get a Tubescreamer output.

I tried running a few simulations and was able to get arbitrarily close to the TS output (basically perfect overlap) by fiddling with the resistor values. In the TS the ground resistor controls the maximum diode current, in the inverted clipper the input resistor controls it. Just keep those resistors the same and then make sure the Rf/Rg and RF/Rin ratios are the same and you'll be off to the races.

PBE6

The hard clipping setup is a bit different, although its output is also described by V(out) = V(diode). Both the inverter and non-inverter provide gain near the beginning of the waveform having magnitude Rf/R, while the hard clipper becomes a voltage divider that cuts the signal to Rload/(Rin + Rload). Add to that the fact that the current through the diodes in a hard clipper is controlled by the input voltage and the input resistor and it becomes very difficult (if not impossible) to match the TS with that blend.

Having said that, I made a hard clipper with a blend circuit last year and the sound was pretty close to a TS when the original signal was mixed in 1:1. Not exactly the same, but a convincing facsimile. I should really try this inverted clipper instead and see what happens.

ashcat_lt

If you're trying to help me, I do appreciate it, but understand that I'm not actually modeling these circuits.  I do use R and C values to figure gains and attenuations and filter cutoffs, and I use "real voltage" numbers, but I'm not calculating currents and all that.  The nonlinearities are approximated using much simpler functions (tanh or sin) because frankly the voltage across a diode (in a voltage divider situation) is completely dependent on the voltage across the diode, and requires iterative processing or W function or a sort of oversample/delay/fake it thing all of which are more CPU intensive than I want and/or add latency.  So, I fake it.

I'm starting to wonder if maybe I just need to subtract 1 from the gain before slamming it into the hard clipper so that adding unity input back in makes it work out to the right value, but I keep thinking this makes it hit the diode threshold "too late"...

PBE6

Some thoughts on simplification.

In a TS, if you know what the input voltage is then you know what the total current is through the feedback network. Assume that all the current goes through the diode and calculate V(diode), then add this to the input voltage.

The above method will give a good approximation for moderate and larger input voltages with high gain values, but it will be off for small voltages with low gain values. A simple refinement is to calculate V(in)*Rf/Rg and compare it to V(diode) above, then choose the smaller value. This will give a better approximation near the beginning and end of the waveform.

It may be possible to smooth the transition between small and large voltages using an additional low-pass filter, or some sort of simple interpolation algorithm.

Hopefully that sparks some ideas.

ashcat_lt

Quote from: PBE6 on December 18, 2015, 10:07:12 PM
In a TS, if you know what the input voltage is then you know what the total current is through the feedback network.
How?

QuoteAssume that all the current goes through the diode and calculate V(diode), then add this to the input voltage.
The current through the diode is dependent on the voltage across the diode which is dependent on the current through the diode.

QuoteThe above method will give a good approximation for moderate and larger input voltages with high gain values, but it will be off for small voltages with low gain values. A simple refinement is to calculate V(in)*Rf/Rg and compare it to V(diode) above, then choose the smaller value. This will give a better approximation near the beginning and end of the waveform.
This is kind of what I've been shooting for.  A piecewise function isn't my favorite idea because it always means a sharp corner, so I've been trying to "parallelize" the gain dictated by the Rs with the gain dictated by the (approximated) diodes, but thats not...happening...yet...

I'm not super excited about trying to use a filter in place of what should be a waveshaping function.  There are filters around this thing as it is.

PBE6

With regard to the current in the feedback network, the only place it can go is through the ground resistor. Since the opamp keeps the + and - inputs at the same voltage, the current through the ground resistor is V(in)/Rg, and therefore the current through the feedback network is V(in)/Rg. From here you can figure out voltage drop across the diode using your chosen diode modelling function.

Sounds like you have a pretty good handle on the rest.




ashcat_lt

Quote from: PBE6 on December 19, 2015, 01:31:22 AM
With regard to the current in the feedback network, the only place it can go is through the ground resistor. Since the opamp keeps the + and - inputs at the same voltage, the current through the ground resistor is V(in)/Rg, and therefore the current through the feedback network is V(in)/Rg.
Oh!  Duh.

That doesn't actually help, though, and you explained why yourself.   I already have a perfectly half-assed way of doing it, but I'd like to get a little bit closer to the truth and get rid of some sharp corners in the process.

Don't think I don't appreciate your comments.  It got me thinking about it from a couple different angles.  Eventually they'll converge somehow...

R.G.

Oh. You even said "CPU ticks and latency" and I still didn't tumble to it. You're trying to model the TS in software, perhaps DSP, not tinker with analog circuits. That makes the comments make more sense.

All well and good, but this discussion isn't going to help you much.
R.G.

In response to the questions in the forum - PCB Layout for Musical Effects is available from The Book Patch. Search "PCB Layout" and it ought to appear.

ashcat_lt

Well, I'm trying to conceptualize and describe some close approximation of how the thing actually works, so yes this and similar discussions do help.