A pet peeve: soft vs hard clipping

Started by fryingpan, July 19, 2022, 04:15:55 PM

Previous topic - Next topic

fryingpan

Several authors refer to soft vs hard clipping as merely the location of the clipping diodes.

Soft clipping is, according to them, when the clipping diodes are placed in the feedback loop of an amplifier. Hard clipping instead is placing those clipping diodes from the output of an amp to ground.

That is not the real difference. Soft vs hard clipping is merely the hardness of the knee at onset of clipping. Hard clipping is when the clipping is abrupt, soft clipping is when the knee is softer. Full stop. You can achieve both in both ways. Ultimately, the difference lies in the relative difference in resistance between the regular signal path (either in or out of the feedback loop) and for V>V_th.

antonis

"I'm getting older while being taught all the time" Solon the Athenian..
"I don't mind  being taught all the time but I do mind a lot getting old" Antonis the Thessalonian..

fryingpan

Of course, placing them in the feedback loop is more efficient, since you don't force the amplifying device into outputting current into a low impedance (close to a short circuit to ground). But with soft clipping, shunting diodes to ground through a series resistor is no big issue.

Rob Strand

#3
QuoteSoft clipping is, according to them, when the clipping diodes are placed in the feedback loop of an amplifier. Hard clipping instead is placing those clipping diodes from the output of an amp to ground.

That is not the real difference. Soft vs hard clipping is merely the hardness of the knee at onset of clipping. Hard clipping is when the clipping is abrupt, soft clipping is when the knee is softer. Full stop. You can achieve both in both ways. Ultimately, the difference lies in the relative difference in resistance between the regular signal path (either in or out of the feedback loop) and for V>V_th.
It does tend to work out that way but the effect is very subtle. 

As far as the diode characteristics are concerned the true cause isn't the position of the diode but the value of the resistor feeding the diode.  The feedback set-ups have a large resistor (100k to 1M) in parallel with the diode whereas the output clippers have a smaller value (1k to 10k) feeding the diode.

The biggest difference with the output clippers is the opamp can also clip.   That is usually harder clipping than the diode clipping.  You will find people are more fussy about the choice of opamp for the output clippers (eg RAT, MXR distortion+, DOD Overdrive).  In the feedback case the diodes provide the clipping and generally the opamp doesn't clip.

At the end of the day diode clippers tend to have similar characteristics.
Send:     . .- .-. - .... / - --- / --. --- .-. -
According to the water analogy of electricity, transistor leakage is caused by holes.

Mark Hammer

#4
Quote from: Rob Strand on July 19, 2022, 07:45:13 PM
The biggest difference with the output clippers is the opamp can also clip.   That is usually harder clipping than the diode clipping.  You will find people are more fussy about the choice of opamp for the output clippers (eg RAT, MXR distortion+, DOD Overdrive).  In the feedback case the diodes provide the clipping and generally the opamp doesn't clip.
THIS.

The typical gain expected of op-amps used in clipping circuits, coupled with the typical input signal level and supply voltage, typical exceeds the headroom of the chip.

Consider:
1) An op-amp will normally be able to swing within a volt to a volt and a half of "the rails".  So, a 9V-powered chip can swing from the 4.5V floating ground, down to 1.5 and up to 7.5V.  That gives us maximum voltage swing of +/-3V before the chip itself clips.

2) It is rare to find "harmonic enhancement" circuits that aim for anything less than a gain of 80x, and many exceed 200-400x.

3) The average guitar pickup will output something like 250mv or more when you give a full strum to all 6 strings, and some pickups will give even more; especially if heavier gauge strings are in use.

So, how many times can you "fit" +/-250mv into +/-3V?  Not many, and certainly not 100x.  So, it the diodes come after the output of the op-amp, they are likely to be receiving a "pre-clipped" signal.

But how wide is the signal allowed to swing when the diodes are placed in the feedback loop of the op-amp?  Well, anything above the forward voltage of the diodes simply doesn't happen.  A pair of silicon diodes will set that ceiling and floor at roughly +/-600mv.  Many drive pedals that aim for "transparency" may use a 2+2 or even 3+3 complement of diodes in that location, but even those still won't allow for the amplified signal to exceed the allowable voltage swing of the chip.

My own contention is that, as Rob implied, a diode is a diode is a diode, but so-called "hard clippers" are in reality often *double-clippers*.  The first clip arises from exceeding the voltage swing of the chip, and the second from diode-clipping of the output.

One of the corollaries of this is that where one would expect the resulting harmonic content of a "hard" clipper to change with increases to supply voltage, one would NOT expect to hear much, if any difference, in soft clippers, when supply voltage is increased.  If the signal stayed well below the maximum swing with a 9V supply, it will stay safely below with 12, 15, or 18V as well, because of the fixed ceiling the feedback diodes create.

Now, would the "double-clipping" of both op-amp itself, and diodes, create a somewhat "harsher" tone?  Sure.  But that is ultimately a result of design and gain staging.  For instance, imagine we had a series of op-amp stages, each with a pair of diodes to ground on their output, but none of the stages ever challenging the voltage swing and headroom of the op-amp itself.  The harmonic content would accumulate, because staying above the forward voltage of diodes while below the voltage swing of op-amps is easy to do.  But it would not be "hard" clipping.  What we call hard-clipping is generally the result of asking one single op-amp stage to provide all the gain, and lots of it.

amptramp

Op amp feedback stages do not necessarily clip that hard if the clipping stage is non-inverting like a Tube Screamer because there is always a gain of one for the input signal.  The Tube Screamer is run with high gains but once the clipping starts, the gain drops due to the lowered diode resistance and some unclipped signal gets through.  This is equivalent to the behaviour of back-to-back diodes to ground with a series resistance.

teemuk

#6
Quote from: amptramp on July 20, 2022, 09:32:11 AM
Op amp feedback stages do not necessarily clip that hard if the clipping stage is non-inverting like a Tube Screamer because there is always a gain of one for the input signal. 

Yes, one can visualize them "folding" to a lower gain figure at signal levels exceeding the diode forward voltage. In a sense it's semantics whether this instantenous gain compression at signal peaks (given moderate signal swings) is even considered as ("soft") clipping. It definitely "squashes" the waveform similarly though. Also...
- The diode knee provides a gradual shift between different gain levels
- with ample series resistance to diodes you get higher gains than unity.

QuoteThis is equivalent to the behaviour of back-to-back diodes to ground with a series resistance.
This. Clipping is really due to voltage division of source impedance and diode impedance. With ample series resistance the shunt diodes will never "shunt" in a ratio that would result to traditional clipping.

--

I would think there is a difference of driving diodes at low source impedance of opamp output (feedback loop) vs. driving them with moderately high series resistance of the shunt configuration (shunt clipping). With lower source resistances one should get more pronounced effect of the diodes knee while higher resistance makes the resistive division more "abrupt".

Mark Hammer

I have a recollection - vague as it may be - that back when we were all smitten by the magical role that a JRC4558D op-amp played in Tube Screamers (and this goes back at least 15 years), Jack Orman demonstrated that sticking a 1k resistor in series with the feedback-loop diodes allowed pretty much any op-amp to duplicate whatever it is/was that the JRC chip supposedly did.

Those of you with longer memories of this place and that topic, am I remembering correctly?  Jack, if you're lurking out there, is this accurate? Have you changed your stance at all?

Vivek

I learnt from this group that a resistor in series with clipping diodes is called a "compliance resistor"

I did a theoretical study in Spice with different compliance resistors, to check the change in harmonics created versus compliance.

fryingpan

Honestly, my suspicion is that whatever clipping happens "above" the diode clipping threshold (in a RAT for instance) has a marginal effect on the character of the clipping. Yes, no diode has nil resistance when "on" so some of the waveshaping previous to the diode clipping seeps through, but how much of it really? The real influence of the opamp in a RAT is more in the slew rate (which will certainly show in the final signal) than in the opamp clipping itself.

Digital Larry

Quote from: Vivek on July 20, 2022, 02:57:46 PM
I learnt from this group that a resistor in series with clipping diodes is called a "compliance resistor"

I did a theoretical study in Spice with different compliance resistors, to check the change in harmonics created versus compliance.
Well?  Where is it?   ;)

DL
Digital Larry
Want to quickly design your own effects patches for the Spin FV-1 DSP chip?
https://github.com/HolyCityAudio/SpinCAD-Designer

Rob Strand

#11
QuoteI did a theoretical study in Spice with different compliance resistors, to check the change in harmonics created versus compliance.
You are one of the few people who does his own investigations.
Unfortunately a lot of stuff on the web is just paraphrasing other people's stuff.

People should do their own tests.   It's can be difficult to set-up tests which only look at the effect you are looking for.   The differences are hard to hear some times.  The test set-up can stuff things up as well.  It's very easy to come-up with no conclusion.

This type of configuration isn't to bad for low to mid gain:
- Gain opamp with 18V power ; even this isn't great but at least it's consistent.
- Output resistor R to clip diodes (1N4148 diodes, low capacitance)
- Buffer
- Any low pass filters here.
- Buffer

Use a switch to switch between R = 1k and R = 100k or 1M.
When the resistor is set to 1k switch in a divider or pot to match the output levels.

Switch back and forth between the two configs.

Send:     . .- .-. - .... / - --- / --. --- .-. -
According to the water analogy of electricity, transistor leakage is caused by holes.

Rob Strand

#12
QuoteOp amp feedback stages do not necessarily clip that hard if the clipping stage is non-inverting like a Tube Screamer because there is always a gain of one for the input signal.  The Tube Screamer is run with high gains but once the clipping starts, the gain drops due to the lowered diode resistance and some unclipped signal gets through.  This is equivalent to the behaviour of back-to-back diodes to ground with a series resistance.
It's true but normally they don't clip much, more incidental clipping.   Back in the day I set-up tests where I drove strong signals into non-inverting feedback clipper.   I wasn't fond of the sound although it was a sound I was aiming for at the time.

There's a lot of talk of stacking pedals these days.  In that scenario that type of clipping can happen.
While people's mind think of two boxes (drawing goodness energy from the sound of both pedals  ;D).
It's no different than drawing a fence around both pedals and calling it a new single pedal which a different clipping structure.   Plenty of Boss pedals are essentially this.

QuoteHonestly, my suspicion is that whatever clipping happens "above" the diode clipping threshold (in a RAT for instance) has a marginal effect on the character of the clipping. Yes, no diode has nil resistance when "on" so some of the waveshaping previous to the diode clipping seeps through, but how much of it really? The real influence of the opamp in a RAT is more in the slew rate (which will certainly show in the final signal) than in the opamp clipping itself.
[As mentioned]

Don't forget the feedback clipper lets the clean signal through as well regardless of whether the diodes are clipping or not.   This of the gain of a non-inverting amp.  gain = 1 + R2/R1   the "1" part is always there (provided the *opamp* doesn't clip).

The details have been posted a few times on the forum.   From an electronic's point of view it's fairly straight forward but not many people get it.  IMHO it's why some people like clippers two diodes each direction instead of one each direction (like TS-9);  Boss OD-1, SD-1 are like 1.5 diodes.  What you are doing is tuning the clean blend on a small scale.



Something weird happened with my post.  Hopefully all fix.
Send:     . .- .-. - .... / - --- / --. --- .-. -
According to the water analogy of electricity, transistor leakage is caused by holes.

teemuk

QuoteDon't forget the feedback clipper lets the clean signal through as well regardless of whether the diodes are clipping or not.

"Clean" (fundamental) and "distorted" (fundamental PLUS harmonics) are mutually exclusive.

Diodes in NFB loop of NINV amp form a two-fold gain function. The folding to lower gain ratio compresses the signal above diode 5hreshold. The transfer function is essentially compiled of two linear portions but it's not a straight line thus "non-linearity" and resulting distortion.

Rob Strand

#14
Quote"Clean" (fundamental) and "distorted" (fundamental PLUS harmonics) are mutually exclusive.

Diodes in NFB loop of NINV amp form a two-fold gain function. The folding to lower gain ratio compresses the signal above diode 5hreshold. The transfer function is essentially compiled of two linear portions but it's not a straight line thus "non-linearity" and resulting distortion.

When the output is scaled to the same level blending makes the relative amount of distortion lower.

Distorted signal =   V1 sin(w0*t) + sum of harmonics
Clean signal = Vc sin(w0*t)
Blend = Clean signal + Distorted signal  = (Vc+V1) sin(w0*t) + sum of harmonics

Now rescale for fundamental level equal to distorted signal fundamental.

Blend_rescaled = [V1 / (V1 + Vc)]  * Blend
                     = V1 sin(w0) + [V1 / (V1 + Vc)] * sum of harmonics

The fundamental level is the same as the distorted signal
but since  [V1 / (V1 + Vc)] < 1 the relative amount of harmonics is reduced.

(When Vin increases Vc will increase more than V1.  We can keep rescaling but the point is the clean with come through more as V1 is more or less stuck at the clip level.)
Send:     . .- .-. - .... / - --- / --. --- .-. -
According to the water analogy of electricity, transistor leakage is caused by holes.

teemuk

These are actually two of my pet peeves; distortion with "clean blend" and the claim of Tube Screamer (and similar) "blending in the clean signal", so to speak.

As said, you can't have "clean" signal if the signal contains additional harmonics to fundamental. The two are mutually exclusive. If you "blend in" harmonics to fundamental - or vice versa - the end result, in various degrees, is always fundamental plus harmonics, in other words "distortion".

Secondly, the only way to get non-distorted signal output from NINV amp with diodes in feedback loop is to operate it at the region below the diode threshold. Below threshold the diodes are reverse biased and the loop gain is set by the parallel resistor. Above the diodes conduct and the loop gain decreases, typically to "unity".

You can draft the transfer function and it consists of two linear lines "folded". This alone indicates non-linearity as a whole and resulting distortion in output signal.
The signal is not amplified "cleanly", higher amplitude signal portions are just amplified with lower gain than lower amplitude portions and this distorts the signal as surely as 1+1 equals 2. It's not a sake of argument.

amptramp

A lot of people end up with a muddy sound from hard clipping.  Let's suppose you have clipping levels at ±1 volt from the zero signal level.  If the level is referenced to zero volts, this would be an actual +1 and -1 volts.  Suppose you have a low frequency fundamental with a lower amplitude high-frequency signal riding on it.  When the signal goes beyond the clipping threshold, the fundamental is clipped but the high frequency that came with the signal goes missing entirely for the time that the output exceeds the clipping level with some partial clipping of the high frequency signal as the combined waveform nears the clipping level.

In some ways, it pays to get rid of the high frequency input signals because they are not quite integer multiples of the fundamental (some sources refer to them as partials) due to the different damping levels at various frequencies.  The clipping produces harmonics that are exact multiples of the fundamental.  This is one of the things that makes the Fuzz Face popular - the low input impedance interacts with the guitar pickup inductance to roll the response off and get rid of the upper partials so they can be replaced with true harmonics.  Otherwise you get intermodulation products that sound bad and are not harmonic.  There is a place for EQ before clipping and a different EQ after.

Rob Strand

Here's a sim which shows without doubt that the non-inverting clipper is equivalent to clean blending.

Circuits

1) Non-inverting clipper.

2) I've added a not so commonly known form of an inverting clipper with blending.
It's the added 4k7 in the second circuit.
This circuit is quite similar to the Marshall Bluesbreaker circuit;  the Marshall form
isn't quite an exact match without tedious playing with diode models and resistor values.

3) A direct implementation of blending.

I've use inverting forms only so the mixers are inverting.

Conclusion:
The waveforms of all three clipper agree.

The difference waveforms are multiplied by 1000 in order to see the difference, it's tiny.
This isn't related to the lack of equivalence.  It's related to using finite gain and bandwidth
opamps.

Not shown here but the equivalence holds for any input.




Send:     . .- .-. - .... / - --- / --. --- .-. -
According to the water analogy of electricity, transistor leakage is caused by holes.

teemuk

#18
Those all have the "piecewise" transfer curve composed of two folding linear parts. One can also distinctly observe the "expanded" region of small signal inputs that distorts the waveform (it's not sinusoidal).
This is as obvious to ear as to eye: the signal is not "clean", it has a buzzing overtone, result of distortion.

As said, clean and distortion are mutually exclusive and the waveforms just furthermore demonstrate that.

These circuits do not "blend in" clean, they blend from one gain figure to another above a certain threshold and this alone makes the overall transfer curve non-linear despite that each part of the "piecewise" transfer function is linear in it's own right and that the unity gain prevents conventional, abrupt hard clipping.

Try this: triangular input waveform. If the output is "clean" and non-distorted you get triangular output waveform. Guaranteed.
But you will notice the output waveform is distorted by "folding" once the diode threshold is exceeded. Guaranteed.

Now there's a fine difference between nice peak compression distortion from the gain fold, or "crossover" distortion due to very same gain fold expanding the "small signal region" if you feed these circuits too high amplitude input signals. Either way they are ALL distorted.

iainpunk

Quote from: fryingpan on July 20, 2022, 03:01:08 PM
Honestly, my suspicion is that whatever clipping happens "above" the diode clipping threshold (in a RAT for instance) has a marginal effect on the character of the clipping. Yes, no diode has nil resistance when "on" so some of the waveshaping previous to the diode clipping seeps through, but how much of it really? The real influence of the opamp in a RAT is more in the slew rate (which will certainly show in the final signal) than in the opamp clipping itself.

Quote from: iainpunk on July 12, 2022, 05:14:55 PM
Quoteslewrate
at the voltages were working with, the slew rate of the 308 only affects frequency's a guitar amp can't meaningfully reproduce. frequencies above 16kHz if the clipping diodes are discarded, and over 100kHz if they are taken in to consideration. that a wave is slewed doesn't mean we hear a difference. ive been experimenting with slew rate limiters a lot lately, and it starts to be noticeable in the top end around 0,1v/us. asymmetric slew rate also has a really cool sound to it!

what does affect the LM308's sound is the GBP, which limits the gain at higher frequencies, which in turn smooths out the sound.

if the signal put in to a so called soft clipper (non-inverting stage with diodes in the feedback loop) is significantly larger than the diode threshold, it will sound like crossover distortion, as if there's a nasty little buzz added to an otherwise clean sounding signal. i really dislike such configurations for most applications.

i wish there was a tiny 4pin IC with a single CMOS inverter on the market so we could have that as clipping amplifier to add to whatever circuit were designing. also, is CMOS distortion soft or hard clipping? or both? i'd argue hard clipping, just like tubes.

cheers
friendly reminder: all holes are positive and have negative weight, despite not being there.

cheers