Pleasant distortion without clipping

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

Previous topic - Next topic

WaveshapeIllusions

The title might seem paradoxical, but hear me out. 8)

Distortion is of course any modification to the waveform of the signal; this is caused by a non-linear transfer characteristic. The gain changes depending on the signal level.  In the case of clipping the gain would be zero, as there is nowhere to go. If it drops to zero abrutly, the wave will be flat-topped with lots of higher order harmonics; this is generally considered harsh. Valves tend to clip softly with lower harmonics, and the wave is more rounded. This often seen as the holy grail of distortion: soft-clipping.

However, we don't need to clip the signal. :) As stated, distortion happens because the transfer characteristic is non-linear. Well, every device is non-linear to a degree. Pull up a datasheet and look at the tranfer curves; they're (obviously) not straight. This means that gain varies based on level, and the signal will be distorted.

What does this have to do with soft clipping? Well, it will sound a lot like soft clipping. I know RG has brought this up before with the conduction knee of diodes. Keep it in the non-linear area and there you go, sweet sounding distortion. Of course, you don't need to use diodes. If the gain stage is non-linear (of course it is) you'll get some distortion.

How would we apply it? Well, discrete components are a must. Look through datasheets to see which ones are less linear. Pick the operating conditions that maximize that area. Look at the curviest part of the curve and bias is into that area.  Put a few in series to add to the distortion.

I hope that you found this interesting, and that it will give some of you some ideas. I also hope that you have more suggestions for increasing device nonlinearities too, I don't know too many. :)

Thecomedian

#1
lol, this is exactly where I've been going, especially with the fact that FETs are actually highly non-linear in large signal analysis. Its just that we zoom in so much with small signal changes that it appears more or less to be straight.

For instance, if you could actually push the thing into the scale where it starts taking on a curve function for gain, you could split the signal in half with two push-pull FETs, and then you'd have equal distortion on both sides of the voltage swing, or something like that.

from what I've read of papers on he subject, corners of clipping create more harmonics than non-linear gain.

You can see a few of my tries here.

http://www.diystompboxes.com/smfforum/index.php?topic=102984.0
If I can solve the problem for someone else, I've learned valuable skill and information that pays me back for helping someone else.

amptramp

You should take a look at some of the work being done by audiophiles on single-ended triode amplifiers with no negative feedback.  They sound good, but there is definitely some distortion there and you don't need test equipment to hear it.  The distortion comes from a non-linear transfer function which never gets to the clipping level.  It is largely second and other even harmonics.  But anything heard through these amplifiers does not sound like the original signal as provided by a low-distortion amplifier.

R.G.

Some things come to mind.
Quote from: WaveshapeIllusions on June 11, 2013, 12:37:17 AM
Well, discrete components are a must.
Perhaps. However, waveshapers with opamps and diodes or transistors are a long tradition in the analog community.

QuoteI know RG has brought this up before with the conduction knee of diodes. Keep it in the non-linear area and there you go, sweet sounding distortion. Of course, you don't need to use diodes. If the gain stage is non-linear (of course it is) you'll get some distortion.
The MOS Doubler and JFET Doublers at GEO were an exercise in digging out the distortion products by cancelling the original signal. It is true that every device that isn't truly linear (and none of them are) will cause some distortion. However, the distortion of a bipolar, JFET, or MOSFET within the regions that are not obviously clipped tend to be about 1-4%. You need something curvier than these.

QuoteHow would we apply it? Look through datasheets to see which ones are less linear. Pick the operating conditions that maximize that area. Look at the curviest part of the curve and bias is into that area.  Put a few in series to add to the distortion.
I posted some things a few years ago that will interest you. You're on a similar path.

Imagine a curved transfer function, with a straighter, more linear part and a more tightly curved part. If we magnify a diode characteristic up, it makes an OK thing to serve as an example.

Below the start of the bending in the conduction knee, it's pretty linear - well, linear by not conducting much, anyway. From the start of the conduction knee to where it straightens out again, you get varying degrees of distortion. Above that, conduction is much more linear again, and controlled by the resistances more than the junction. Even then, if you use a small enough signal, say 10-25mV, the diode's curviest parts look linear. This is the basis of diode modulators. For signals that are small enough, everything looks linear. So one way to make a tremolo is to force a varying current through a diode, and have its forward resistance to a tiny signal to change. The slope of the V-I curve at any point is the effective resistance at that point.

Hmmm. For tiny signals, it's linear. For signals about the size of the diode's forward conduction voltage or a bit less, it's soft clipping. For signals that are much larger than the diode's conduction region, the harmonic result is indistinguishable from razor-sharp clipping. It's not just where you bias the device, it's how big the signal is compared to the size of the conduction knee or nonlinear area in terms of voltage. If the signal is quite small, say 10% or less of the conduction knee, you get variable resistance. This was used in the Magnatone amps with their soft-curved varistors, which had a 70V knee (!) to vary volt-sized signals. If the signal is comparable to the size of the curved area, you get soft clipping to one degree or another. If the signal is bigger (5-10 times, up to several million times bigger), you get sharp clipping from the same device.

It's the relative size of the signal to the clipping knee that makes a difference. It's a question of scaling.

There are some practical issues with very small signals (noise!) and very large ones (power supply!) that make this an issue.  I blathered on about that for a while, I believe. You can construct a curved response with opamps and switching devices like diodes and transistors for signals in the volt-to-ten-volt range well enough.

QuoteI also hope that you have more suggestions for increasing device nonlinearities too,
One that leaps immediately to mind is the Vbe multiplier. This is a transistor setup with two resistors that makes the transistor's collector-to-emitter voltage be a multiple of the Vbe. I always intended to work on that some more to see how valid it is in the knee region. This would let you have "diodes" of any reasonable size of 2-10 times perhaps the native V-I characteristic of the base-emitter junction. Looks promising, needs work.

Here's another thought that I posted a ways back: the iterated clipper.

Imagine a clipper that soft clips at 1.0V, with a "knee" range of 0.2V. We feed it a signal of 0.8V, and get not much. Increasing the signal to 0.9V to 1.0V gets more clipped, but still soft. Feeding it 1.5, 2, 3... volts gets increasingly hard-clipped because the portion of the signal's time spent in the clipping knee gets to be such a small percentage of the cycle time. So if we feed it a particular size signal, it seems to be soft clippable.

But real signals are all over the map. How do we ensure it gets just the right size signal?

One possibility is a compressor of some sort, perhaps even companding to put it in the right signal size and then expand it back.

Another is to use another copy of the soft clipper ahead of the soft clipper. The soft clipper clips when the signal is right. Set up the output of the first clipper to produce just the right size signal for the second clipper. But then the first soft clipper doesn't get into the action. OK, put another one ahead of that.

With iterated soft clippers and some care in designing the gains and attenuations between stages you start getting an all-soft clipped signal.

One reasonable way to do this is with CMOS logic gates used linearly, but with low feedback and careful attention to attenuating after gain stages to control the signal size. After all, the output of a CMOS gate has a well-fixed maximum output voltage, so you can get a handle on signal levels that way.

It's a good area to go looking. Hope those help.
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.

tca

#4
Quote from: R.G. on June 11, 2013, 10:18:37 PM
... the iterated clipper. Imagine a clipper that soft clips at 1.0V, with a "knee" range of 0.2V. We feed it a signal of 0.8V, and get not much. Increasing the signal to 0.9V to 1.0V gets more clipped, but still soft. Feeding it 1.5, 2, 3... volts gets increasingly hard-clipped because the portion of the signal's time spent in the clipping knee gets to be such a small percentage of the cycle time. So if we feed it a particular size signal, it seems to be soft clippable.

BTW, that clipper exists (taken from Pritchard's patent "Semiconductor-emulation of vacuum tubes")


Quote from: R.G. on June 11, 2013, 10:18:37 PM
One that leaps immediately to mind is the Vbe multiplier.
ah, that is a very good idea ("rubber diode")!

Quote from: R.G. on June 11, 2013, 10:18:37 PM
One possibility is a compressor of some sort...
I've been playing with the distortion section of the Peavey standard amplifier (turning it to 9V) and it does exactly that, plus the soft clipping and the duty cycle modulation. The compression is not much, typically .25s before it starts to decay. It consists of a discrete op-amp (one NPN and PNP) with a buffer with a peculiar feedback arrangement. This amp is dated from the 70's (?) and we still doing the same thing, amazing!

Quote from: amptramp on June 11, 2013, 05:16:47 PM
You should take a look at some of the work being done by audiophiles on single-ended triode amplifiers with no negative feedback.  They sound good, but there is definitely some distortion there and you don't need test equipment to hear it.
And it *really* sounds good with a guitar.
"The future is here, it's just not evenly distributed yet." -- William Gibson

gjcamann

If you want to dork out on the patent stuff, here's a link.
http://www.google.com/patents/US5434536
At the bottom of the page there's a bunch of references to related patents, but the ones by Prichard are the most useful.
Here's a list of all of Prichard's patents - and many seem relevant to pedals.
https://www.google.com/search?tbo=p&tbm=pts&hl=en&q=ininventor:%22Eric+K.+Pritchard%22

Anyone have more info on this Prichard guy... does he make pedals? I'd like to see some of this patents in action.

Thanks for getting this all started TCA.

Here's a couple other related patent authors.
https://www.google.com/search?tbo=p&tbm=pts&hl=en&q=ininventor:%22W.+Brown+James+Sr.%22
https://www.google.com/search?tbo=p&tbm=pts&hl=en&q=ininventor:%22Jack+C.+Sondermeyer%22
Peavey Corp has a bunch of good ones
https://www.google.com/search?tbo=p&tbm=pts&hl=en&q=inassignee:%22Peavey+Electronics+Corporation%22
From Mr. Peavey
https://www.google.com/search?tbo=p&tbm=pts&hl=en&q=ininventor:%22Hartley+D.+Peavey%22
Sorry, I got a little carried away. Good thing i have to work today... or I would probably spend all day looking at these things --- what a blast. .

oops another
https://www.google.com/search?tbo=p&tbm=pts&hl=en&q=ininventor:%22Randall+C.+Smith%22

back to work...

Oh man, check out some of L. Fender's patents... so cool!!!

OK really, back to work...

jdub

QuoteAnyone have more info on this Prichard guy... does he make pedals? I'd like to see some of this patents in action.

He's the Pritchard in Pritchard amps: http://www.pritchardamps.com/pritchardamps.cfm  ;)
A boy has never wept nor dashed a thousand kim

R.G.

Quote from: tca on June 12, 2013, 04:25:15 AM
BTW, that clipper exists (taken from Pritchard's patent "Semiconductor-emulation of vacuum tubes")
There are many of them in various guises. The limiting section of many radio receiver front ends has an iterated diffamp limiter.

The Pritchard patent is a variant of the waveform shaper with voltage thresholds and diodes setting where the nonlinearities happen. In fact, I wonder that the patent examiner let that one past the "one skilled in the art" test, as most analog EEs would have recognized it immediately.

I was probably not clear about the iterated limiter. This was a a series of identical sections, each of which clips the signal. The trick is that each prepares the signal to fit into the soft clipping threshold of the next without going into the hard clipping area.
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.

tca

#8
Quote from: WaveshapeIllusions on June 11, 2013, 12:37:17 AM
... it will sound a lot like soft clipping.
One of the things that we keep forgetting when discussing this topic is the frequency response, after and  before clipping. In this vid, what do you think is the output (green, light green, red)? http://www.diale.org/ogg/clipp.ogv

P.S.
If you have any problems seeing the file use the VLC player: http://www.videolan.org/vlc/

P.P.S.

Here is an image (steady state):



What is the wave form that is feeding the power amp? That rounded light green, or the dark red one?
"The future is here, it's just not evenly distributed yet." -- William Gibson

artifus

as humans we each have our own subjective ideas about what distortion is and what it sounds like to us, to the extent of creating quite a vocabulary of fuzz - some of the descriptions of pedals on this very forum serve as example with a recent thread asking what is creaminess, fizz, etc or the odd russian translations of sand and lotion, etc., aside from hard or soft clipping, etc

psycho acoustics has always been a fascinating subject for me but i've only recently started thinking a little more beyond frequency response (fletcher munson curves etc) and time domain stuff - sound localisation/spatial awareness. (special awareness?!  :P)

when musing distortion recently i stumbled upon evoked otoacoustic emissions:
Quote from: http://en.wikipedia.org/wiki/Otoacoustic_emissionAn otoacoustic emission (OAE) is a sound which is generated from within the inner ear. Having been predicted by Thomas Gold in 1948, its existence was first demonstrated experimentally by David Kemp in 1978...  ...there are two types of otoacoustic emissions: spontaneous otoacoustic emissions (SOAEs), which can occur without external stimulation, and evoked otoacoustic emissions (EOAEs), which require an evoking stimulus.

which links to:
Quote from: http://en.wikipedia.org/wiki/Maryanne_Amacher"When played at the right sound level, which is quite high and exciting, the tones in this music will cause your ears to act as neurophonic instruments that emit sounds that will seem to be issuing directly from your head ... (my audiences) discover they are producing a tonal dimension of the music which interacts melodically, rhythmically, and spatially with the tones in the room. Tones 'dance' in the immediate space of their body, around them like a sonic wrap, cascade inside ears, and out to space in front of their eyes ... Do not be alarmed! Your ears are not behaving strange or being damaged! ... these virtual tones are a natural and very real physical aspect of auditory perception, similar to the fusing of two images resulting in a third three dimensional image in binocular perception ... I want to release this music which is produced by the listener ..."

apologies for the slight thread derail, wondered if folks had any thoughts or opinions on the subject.

ashcat_lt

Is there some reason that a VCA style compressor without the sidechain filtering couldn't accomplish this type of thing?  I guess maybe you'd need to split the signal, half wave rectify and then compress each (to get both positive and negative swings) and then sum them back.  Seems like this would give a whole lot of control over not only the curve itself, but also the symmetry of the soft-clipping.

Seems like if it was that easy somebody would have done it by now, but I can't see why it wouldn't work.

tca

#11
Quote from: artifus on June 12, 2013, 11:24:49 AM
... wondered if folks had any thoughts or opinions on the subject.

Ron's post is very pertinent. The guys from the DIY hi-fi community, namely Nelson Pass, has an idea that I quite follow. Air is a single ended medium, in the sense that it can be highly compressed but rarefaction is limited to zero pressure. In fact there is a simple relation between volume and pressure: VP^1.4=cte (1.4 is the adiabatic index), which means that sounds waves are slightly "soft clipped" on one side, more clipping means less pressure, and for  a periodic signal that means more energy, louder sound with a lot of 2nd harmonics. So we *perceive* loudness, in a way, by the amount of even harmonics that we ear. This partially explains the common idea that a 1W tube amp "sounds" louder that an 1W SS amp (I'm thinking of a typical class AB amp, of course one can generate as many as we want even harmonics with SS devices) because asymmetric soft clipping can  be obtained with tubes (running in class A).

But I've done some more experiments ... I've build some small wattage class A amps and some typical class AB audio amps. I usually run these amps on the same place where I have the hi-fi speakers. The curious thing is  that I only get complains about listen to music to loud when running the class A amp, it *seems* that the sound waves travel better when generated in a single ended device, and again even harmonics play a role on the propagation also. Note that these comments are very, very, subjective...

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

gjcamann

QuoteThe curious thing is  that I only get complains about listen to music to loud when running the class A amp

If Class AB sounds louder to you (because of the even harmonics). Then maybe you run your Class A louder than your Class AB.  ;D

tca

^ as I said,  very, very, subjective...
"The future is here, it's just not evenly distributed yet." -- William Gibson

R O Tiree

The basic TubeScreamer core is actually a log amplifier. The reason it clips quite hard is due to the fact that the minimum gain is 12 and the maximum is 118. Thus, a semi-decent humbucker pushing out +/-1V will natively try to boost to +/-12V at min gain - It clearly cannot do that, given the +/-4.5V supply to the opamp, but it will try, except that the diodes hold that down to a maximum of about +/-0.7V. After that, it doesn't really matter how much you turn the gain up, the output will still be limited in this way. The difference, of course, is that (a) smaller and smaller input signals will still reach that clipping threshold and (b) large input signals will get more and more "square" corners, as the rate of increase of a large signal trying to be amplified 118 times will reach the clipping voltage a lot more quickly.

So, to achieve "pleasant distortion without clipping" one could (a) reduce the gain and, if required, (b) use more diodes.

It all depends upon what input signal level you have and what output you want... In the stock TS, you have a 4k7 resistor from Vb to -ve input and a 51k in series with a 500k VR from output to -ve input. In parallel with those last two, you have the diode pair that force the logarithmic response. (I've ignored the cap in series with the 4k7, which changes the response with frequency - low freqs get driven less than high ones.) So, if we change things to 4k7 "outside", 4k7 and 100k VR "inside", then we have changed the gain to a minimum of 2 and a max of a shade over 22.  Double up the diodes and we have an absolute max output of about +/-1.4V or so.  That will still give you a bit of "grit" at max gain, especially with larger input sources, but it should be pretty subtle, I think?
...you fritter and waste the hours in an off-hand way...

ashcat_lt

#15
In the TS, gain is about unity for anything where input x gain > the diode drop.  The opamp doesn't clip with reasonable inputs.

Edit - I guess that's difficult wording... If the "diodes open gain" multiplies the input to exceed the diode Vf, the diode closes, shorts the gain resistors, and brings total gain down to 1.  This might be a novel way to control the input - cascade several stages of this, maybe...  I guess people have running screamers into other screamers for a while now...

gritz

#16
I've been playing around with an 808 clone for a few days now and I've also found that high output humbuckers can scare it a bit. Moving the "kinks" caused by diode conduction further away from zero by using higher forward voltage diodes is a possibility, but for me it's also a "flub" issue caused by the low end content from those humbuckers, so thinning out the sound by replacing the 1uF capacitor at the clipping opamp input with something smaller (starting with mebbe 0.1uF) helps too.

Regarding monkeying with non-linear transfer functions - computer-savvy types might want to check out Bidule. it's a modular audio environment that allows you to (amongst other things) apply maths to audio in real time. If you can express it as a "sum" then you can apply it to a signal by plugging together mathematical functions. There's filters, delays, oscillators and whatnot in there too as well as VST hosting. No affiliation, btw!

PRR

> frequency response, after and  before clipping

+1
  • SUPPORTER

R.G.

Quote from: tca on June 12, 2013, 01:12:41 PM
Air is a single ended medium, in the sense that it can be highly compressed but rarefaction is limited to zero pressure. In fact there is a simple relation between volume and pressure: VP^1.4=cte (1.4 is the adiabatic index), which means that sounds waves are slightly "soft clipped" on one side, more clipping means less pressure, and for  a periodic signal that means more energy, louder sound with a lot of 2nd harmonics. So we *perceive* loudness, in a way, by the amount of even harmonics that we ear.
Yes, air is nonlinear.  This is a consideration in the design of horn loudspeakers where the air pressures in the throat are sincerely high.

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.

QuoteThis partially explains the common idea that a 1W tube amp "sounds" louder that an 1W SS amp (I'm thinking of a typical class AB amp, of course one can generate as many as we want even harmonics with SS devices) because asymmetric soft clipping can  be obtained with tubes (running in class A).
I wonder if you could contrast this theory with Russell O. Hamm's paper on vacuum tube circuits sounding louder than solid state.

QuoteBut I've done some more experiments ... I've build some small wattage class A amps and some typical class AB audio amps. I usually run these amps on the same place where I have the hi-fi speakers. The curious thing is  that I only get complains about listen to music to loud when running the class A amp, it *seems* that the sound waves travel better when generated in a single ended device, and again even harmonics play a role on the propagation also. Note that these comments are very, very, subjective...
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?

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

> 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.

1% ~~ 164dB SPL  WTF cares abut 0.001% THD?
  • SUPPORTER