Pleasant distortion without clipping

Started by WaveshapeIllusions, June 11, 2013, 12:37:17 AM

Previous topic - Next topic

R O Tiree

#20
Quote from: ashcat_lt on June 12, 2013, 03:37:43 PM
In the TS, gain is about unity for anything where input x gain > the diode drop.  The opamp doesn't clip with reasonable inputs.

You're right, ashcat... Serves me right for digging out something I half-worked out about 4 years ago and not taking the time to review it. I'll try to get it right(er) this time. Just considering the first opamp, then as I said, at minimum "Drive" the resistors are trying to give you a gain of 12. With a +/- 1V input signal, they would try to give you +/- 12V. They clearly cannot do that with only a +/-4.5V supply and, if you took the diodes out, the rail-to-rail clipping would be horrendous to listen to. But the diodes in parallel with the resistors limit the voltage swing available from the output to the -ve input. As soon as they start to conduct, the resistors begin to be bypassed. I made a mistake earlier... the diodes actually limit the amount by which the output can exceed the input. So, the opamp would, in the absence of the diodes, try to smash from rail to rail. With the diodes, a +/-1V input appears as about a +/-1.5V output and the waveform gets weird in any case.

The other mistake I made 4 years ago was to investigate a similar layout, but wired as an inverting amp, not, as the TS is connected, in a non-inverting configuration. If you wire it as an inverting stage, then you get a "proper" logarithmic amplifier (pretty crude and inaccurate) where the output can never exceed +/- one diode drop (obviously more diodes = bigger output). I think judicious choice of gain resistors and number of diodes might serve the OP's needs?
...you fritter and waste the hours in an off-hand way...

WaveshapeIllusions

Wow, this picked up quick. I think diodes would probably work pretty well after everything that's been said about them. The issue is keeping them at the knee. I play bass, so there are some rather large peaks followed by lower levels, so it would probably overshoot the clipping threshold on the attack. I'll have to try a VCA beforehand to keep the levels even as suggested.

My main focus has been on amplifying devices though. I like the SET idea, those sound nice. I think log amp was mentioned? That would be interesting too. I've mainly been looking at different loads to put at the collector/drain. I've heard a lamp can bend the curve a bit. I've been thinking that using a diode as a load might be interesting, if it can be kept at the knee area. Perhaps an LED?

I agree that frequency response is very important to the sound. Lowpass filtering on both sides smooths things out significantly. I've got a big muff with a cutoff that must be around 1 -2 kHz and it is rather pleasant sounding. I try to cut some bass before clipping to keep it from cutting off the peaks too much, and more lowpass filtering keeps the harmonics generated from going too high.

The TS ideas seem good too. I think some of the log amps use diodes in the FB loop to get that transfer characteristic. I've thought about using resistance in series with the diodes so that gain decreases with each step up in voltage. Haven't tried it yet though.

Changing the signal level to get it to sound right is good as well. I think tca mentioned that in another thread. If the signal is at the right level all the time you can put the curvier sections to good use. Or if the signal occupies a good chunk of the curve, it would probably have higher distortion.

Thecomedian

"keeping them at the knee" is probably the essence of my own diode based single transistor distortion. It makes a beautiful sine wave that, for all intents on purposes in that single frequency (without being able to measure harmonics), appears to mimic the kind of "clipping" that tubes do. With the proper biasing, anything's possible.
If I can solve the problem for someone else, I've learned valuable skill and information that pays me back for helping someone else.

tca

Quote from: R.G. on June 12, 2013, 11:34:47 PM
I wonder if you would compute out for me the sound pressure levels in db corresponding to 0.001, 0.01, 0.1, and 1% distortion of air itself as a result of the nonlinearity of the air itself.
I'll do that, need some more time to think... Actually I've some numerical musings about it.

Quote from: R.G. on June 12, 2013, 11:34:47 PM
II wonder if you could contrast this theory with Russell O. Hamm's paper on vacuum tube circuits sounding louder than solid state.
That is not to hard, do that later on.

Quote from: R.G. on June 12, 2013, 11:34:47 PM
Weather was once very, very subjective. Lighting was the result of angering Zeus - or was it Thor? Or both? Illness was once very subjective - sickness was a result of evil spirits, and warts were cured by black cats and midnight, etc. As men of science, we have a duty to put numbers on things where we can, don't we?
You have to agree that the dark side has it charms, I'm often, as any other mortal, attracted to this medieval side of common existence. ;) But you are right, *I should* put some numbers on to things!
"The future is here, it's just not evenly distributed yet." -- William Gibson

R.G.

General comment; the essence of using diode-connected MOSFETS (gate->drain) as diodes is that this setup gives a very large knee curve that never seems to fully saturate to some very small resistance like bipolars do.

The result for signals of a volt to several volts is that the "information" above the start of diode conduction is never fully lost by being squashed completely flat, and the knee is quite big and round. It's not quite a Vbe multiplier, but has its own charms.
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.

artifus

Quote from: tca on June 13, 2013, 06:18:06 AM
Quote from: R.G. on June 12, 2013, 11:34:47 PM
I wonder if you would compute out for me the sound pressure levels in db corresponding to 0.001, 0.01, 0.1, and 1% distortion of air itself as a result of the nonlinearity of the air itself.
I'll do that, need some more time to think... Actually I've some numerical musings about it.

at what temperature, altitude and humidity? (etc.)  :P

there are many phenomena in this universe we have yet to attach numbers to and quite some doubt about many of the numbers we have decided upon and use by default. most are just handy models that kinda seem to hold true under certain conditions... the map is not the territory. the weather is still somewhat of a mystery.

thinking only in numbers can be quite restrictive creatively as thinking only creatively can sometimes turn out to be too fanciful once the numbers are applied. but most of the more interesting stuff goes on at the edges. i s'pose creativity is the hunt and the numbers the kill? nailing it down once detected?

if the same purely numerical approach were taken in music creation we'd all just be playing the same 12 bar blues riff over and over again for decades... wait, what?  :P

and most musical disection and critique happens post creation.

isn't it all just different languages and thought processes to consider the one same thing? tools i guess.

R.G.

Quote from: artifus on June 13, 2013, 03:31:10 PM
at what temperature, altitude and humidity? (etc.)  :P
You're messing up my next question!!  :icon_lol:

Quotethere are many phenomena in this universe we have yet to attach numbers to and quite some doubt about many of the numbers we have decided upon and use by default. most are just handy models that kinda seem to hold true under certain conditions... the map is not the territory. the weather is still somewhat of a mystery.
On the other hand, if you can keep your head straight that the numbers are a useful approximation, they can be a big help. In the works of Lord Kelvin on three separate quotes:
"To measure is to know."

"If you can not measure it, you can not improve it."

"In physical science the first essential step in the direction of learning any subject is to find principles of numerical reckoning and practicable methods for measuring some quality connected with it. I often say that when you can measure what you are speaking about, and express it in numbers, you know something about it; but when you cannot measure it, when you cannot express it in numbers, your knowledge is of a meagre and unsatisfactory kind; it may be the beginning of knowledge, but you have scarcely in your thoughts advanced to the state of Science, whatever the matter may be." [PLA, vol. 1, "Electrical Units of Measurement", 1883-05-03]

He was not hung up on the numbers being exact, but being a means to knowledge. Smart guy. We named the absolute temperature scale in his honor.

Quotethinking only in numbers can be quite restrictive creatively as thinking only creatively can sometimes turn out to be too fanciful once the numbers are applied. but most of the more interesting stuff goes on at the edges. i s'pose creativity is the hunt and the numbers the kill? nailing it down once detected?
In the words of Robert A. Heinlein:
"A human being should be able to change a diaper, plan an invasion, butcher a hog, conn a ship, design a building, write a sonnet, balance accounts, build a wall, set a bone, comfort the dying, take orders, give orders, cooperate, act alone, solve equations, analyze a new problem, pitch manure, program a computer, cook a tasty meal, fight efficiently, die gallantly. Specialization is for insects."

Quoteif the same purely numerical approach were taken in music creation we'd all just be playing the same 12 bar blues riff over and over again for decades... wait, what?  :P
Interesting that you should bring that up. You'd like to read something about algorithmic music, I think. See https://ccrma.stanford.edu/~blackrse/algorithm.html for a starting point. I understand that some early work on this attempted to approximate the style of historical composers by setting certain parameters to tell the computers how to compose. The story goes that they tried it by setting the parameters to compose rags in the style of Scott Joplin. They had some problems, because the program kept turning out tunes that Joplin had, in fact written. They had to back off a bit on the parameters to get it to do similar but not the same.  :icon_eek:

Quoteisn't it all just different languages and thought processes to consider the one same thing? tools i guess.
It is, but just when we're OK with that, something odd comes along. It turns out that people do not hear the same melody in the same way, and that it seems to be related to cultural groups or ethnic groups. Your comment about "languages" keyed that one up.  :icon_biggrin:
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.

artifus

Quote from: R.G. on June 13, 2013, 04:42:31 PM
You'd like to read something about algorithmic music, I think...

thanks for the link. seen this: http://canonical.org/~kragen/bytebeat/ ?

ashcat_lt

Note that just about any curve that you try to apply, logarithmic or otherwise, is going to have the issues of "staying in the knee" as RG put it.  If you zoom in too far, even the curviest part will be close enough to linear to not make a difference.  If you zoom out far enough, it pretty much has to approach linearity at some point.

A diode's IV curve looks a lot like a log curve to me, and I'd imagine a log amp will give us the same problems.  Without recursion of the process, you end up having to design the thing to work well with a very narrow range of inputs.  The problem of making one "soft clipping" box which will work well with any guitar and player you'd want to plug in still remains.

I would submit that if we try too hard to constrain the input to keep it in the knee, we will necessarily begin to limit the dynamic response of the circuit, such that "touch response" and "cleaning up when you roll back the volume" will start to go out the window pretty quick. 

Jazznoise

I notice in guitar pedals we don't talk about transformer distortion at all. Very small transformers with small cores suffer from very high low frequency distortion - so it generates partials of lower frequencies, but not of upper frequencies. This means less "fizz" and you're not clipping. I've driven a booster from my bass into a passive DI before to exagerate this effect.

Expressway To Yr Null

R O Tiree

There's a circuit for a log amp in Horowitz "The Art Of Electronics" on pages 212 - 218 (2nd Ed) and a better, temp compensated one on page 254 that will happily do 4 decades up to 4V... it sez 'ere.
...you fritter and waste the hours in an off-hand way...

R.G.

Quote from: ashcat_lt on June 13, 2013, 06:55:10 PM
Note that just about any curve that you try to apply, logarithmic or otherwise, is going to have the issues of "staying in the knee" as RG put it.  If you zoom in too far, even the curviest part will be close enough to linear to not make a difference.  If you zoom out far enough, it pretty much has to approach linearity at some point.

A diode's IV curve looks a lot like a log curve to me, and I'd imagine a log amp will give us the same problems.  Without recursion of the process, you end up having to design the thing to work well with a very narrow range of inputs.  The problem of making one "soft clipping" box which will work well with any guitar and player you'd want to plug in still remains.

I would submit that if we try too hard to constrain the input to keep it in the knee, we will necessarily begin to limit the dynamic response of the circuit, such that "touch response" and "cleaning up when you roll back the volume" will start to go out the window pretty quick. 
Now you're on the path.  :icon_biggrin:

And the IV curve *is* a log curve. The current through a diode is an exponential function of the voltage across it, right there in the semiconductor equations. Various imperfections limit diodes; a diode connected transistor follows the diode equation better than an isolated diode.

Quote from: Jazznoise on June 13, 2013, 07:44:56 PM
I notice in guitar pedals we don't talk about transformer distortion at all. Very small transformers with small cores suffer from very high low frequency distortion - so it generates partials of lower frequencies, but not of upper frequencies. This means less "fizz" and you're not clipping. I've driven a booster from my bass into a passive DI before to exagerate this effect.
It's hard to tame.  The problem is that it's linearly related to the volt-time product, and works on linearly increasing frequencies. Much like pot taper, the "curve" of distortion versus frequency is very abrupt sounding.

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

> ...a log amp ...  Without recursion of the process, you end up having to design the thing to work well with a very narrow range of inputs.  The problem of making one "soft clipping" box which will work well with any guitar and player you'd want to plug in still remains.

"Any guitar and player" is compensated by the Drive knob.

A LOG amp makes near the *same* output shape for "any" level (over 30dB to 70dB depending what you pay and how much hiss you accept).

But a single hand+axe still makes a wide range of signal level, from a quiet tease to a wild finish.

To some degree we *need* the overtone structure to change. Hot-signal and Fuzz are ways we "fake" the overtone dynamics that voice (and flute sax trumpet) have and that a naked steel string lacks. When a singer raises her voice, the total power changes little, but the overtones get a lot stronger. For the quite small (because amplified) vibrations of electric guitar, the overtone dynamics are small. Extra "small" because amplified guitar is supposed to be BIG, so we should have "big shout/scream" sound also, to contrast with the mellow sound at lesser levels.

> at what temperature, altitude and humidity?

Say "air you can breathe". It *really* does not matter, 2.0% or 2.1%.... R.G. is asking 2% or 0.02%?

And there is a simple analogy to rough-estimate the magnitude of acoustic distortion from knowledge of electronic distortion. You need a number for SPL of "loud" and a number for air-total-overload.

When done with that (?), find numbers for the distortion of the *ear*. (This is not so easily computed, without destructive disassembly; but it can be tested several ways, numbers are out there, and much higher than air-overload).
  • SUPPORTER

tca

#33
I think that some numerical musing is in order. The next figure shows 4 graphs: the characteristic function of a diode (VD as a function of Vi, btw it is not logarithmic), the condition number of such that function, a typical sin wave clipping and the condition number of that wave as a function of time.



A few introductory comments. "the condition number of a function with respect to an argument measures how much the output value of the function can change for a small change in the input argument" (ref.: http://en.wikipedia.org/wiki/Condition_number), for a power law x^a is simply a. As you can see this shows that the diode characteristic can only give us power law behavior  with exponents between 1 and 0. Secondly I should say that the plots are not numerical, they were obtained by analytically solving the non-linear equation

VD=n*VT*ln[1+Vi/(IS*R)-VD/(IS*R)]

Notice the log contribution of the diode (you can ask how do I managed to solve such an equation :D ).

I think this type of clipping is completely different of what one gets from a vacuum tube although we try hard to make it to sound just like one. These plots just complements all the comments above about scale, amplitude and distortion. Also note the slight hysteresis of the last plot.

Cheers.  

"The future is here, it's just not evenly distributed yet." -- William Gibson

Johan

Funny how this comes up now..I've been thinking a few weeks about how I could slow down the transition from clean to distorted, pretty much exactly the same thing this thread is about....i have come up with an idea I want to try but have no time for another few weeks. Its diode based clipping with dual pairs of diodes where one pair act as a threshold for lower gain....without my breadboard I'm not bright enough to say it works or dismiss it(and probably should just shut up until I know, so I don't look stupid if it doesnt) , but if anyone is interested in doing the legwork, i will scan my notes and someone else can try it...j
DON'T PANIC

DDD

Maybe something opposite to clipping?
For example, a non-linear EXPANDING of a sine-wave?
Too old to rock'n'roll, too young to die

Thecomedian

#36
If we're talking a discreet BJT transistor, what about diode leakage current to apply some current to the base when biased signal would otherwise put the transistor completely into cutoff?

There is a "pocket" of non-linear amplification for BJTs and FETs. Whenever you make a graph for these things, you'll usually see



Fig A is a BJT, Fig B is a FET, Fig C is a pulsed gain for a BJT (just for the sake of interest).

Something to notice about the FET is the non-linear amplification when the FET is receiving  amps nearly equivalent to vacuum tubes.

FETs are naturally non-linear, although what we do is zoom in to a large degree by using smaller current, so that the curve plot takes on a much more linear appearance, with a negligible .01% or less error.

The BJT has a "pocket" of non-linear gain, if you were to keep the voltages and current around that zone.

My own examples of achieving non-linear gain range from exactly this "pocketing" for BJT through what is usually "hard clipping" diode sets, via proper input voltage and current, to "misbiasing" and adding a FET to a BJT.

If I can solve the problem for someone else, I've learned valuable skill and information that pays me back for helping someone else.

tca

#37
^ That pockets that you show are 0.2V (or smaller) in amplitude, it should be difficult to keep the input signal well restraint to get that behavior. In the third case temperature is about 125C! But I do get you point.

I think the distortion in a guitar amp has a big amplitude, i.e., the ratio of the input voltage variation by the voltage power source is almost unity, for certain bigger than 0.707 What I think is missing is a dynamical way of controlling gain, compression or expanding the signal to keep it in that good region for long enough time. One other thing is that when we think of clipping we almost forget what happens to the other part of the signal, it is not only the soft-clipping but the elongation of the other non-clipped part; the crossing zero voltage points are different for the input signal and the output. Don't know if clear enough.
"The future is here, it's just not evenly distributed yet." -- William Gibson

Thecomedian

Yes, although the third graph also has 25C and -40C, which requires greater current to hit a useable small signal pocket, right after line A and Line B cross. Again, it's reminiscent of vacuum tube amps.
If I can solve the problem for someone else, I've learned valuable skill and information that pays me back for helping someone else.

gritz

#39
Well yeah, when the ratio of your loudest to quietest discernable signal amplitudes exceeds 80dB (i.e. 10,000:1) then keeping your signal in a tenuous "sweet spot" is a challenge.  :icon_wink:

I reckon that our tendency to think in terms of imaginary sinewaves on a virtual oscilloscope and all the other circuit simulation stuff makes us forget about the dynamic range of real world signals and the principle that any curve approaches a straight line if you're only acting on a small part of it. No-one ever seems to mention grid conduction ( a power 3/2 phenomenon) when talking about valve stuff either, but that's another can o' worms...

This subject has vexed me for decades, but experimentation suggests to me that it's about far more than simple static curves. Pre and post eq plays a huge role, as does time-variant whatnot. Sooner or later you have to stop looking at wiggly lines in a computer simulation and go build / measure / listen!