Harmonic content created by multiple gain stages

Started by Vivek, September 06, 2021, 05:56:29 AM

Previous topic - Next topic

Vivek

There was an earlier theoretical study regarding harmonic content created by clipping a 1Vp sine wave at different levels, using a single stage clipper.

https://www.diystompboxes.com/smfforum/index.php?topic=127127.0

The results were :

If a 1Vp sine wave is hard clipped at different levels like 900, 800,700 mVp etc by a single gain stage,


The distribution of harmonics created look like this:

Normalised Harmonic content versus clipping point for a symmetrically hard clipped 1Vp sine wave


For extremely chopped waves which approximate square waves, 3rd harmonic is 1/3rd, 5th harmonic is 1/5th, 7th harmonic is 1/7th of the fundamental.


It appears that there is a lot of harmonic motion when a 1Vp sine wave is clipped between 1vp and 0.3Vp

and much lower harmonic motion for harder clipping between the 0Vp and 0.3Vp region.


Now let's look further, at multi-stage clippers:

Many high gain pedals/amps have multiple gain stages. Most times, each stage is clipping aggressively, but at different clipping points.

For example, here is the "AC transfer function" of the GREEN CITRUS pedal with Gain pot at 10% resistance:



This begs the questions :

Question 1: Do multiple gain stages lead to more movement of harmonic content versus amplitude of guitar signal ?
Question 2: Can anyone hazard a guess to the shape of graph of final harmonic content after 2 stage and 3 stage clippers ?
Question 3: At what point do extra gain stages have no extra benefit ?
Question 4: Are the advantages of multiple gain stages only noticed at intermediate gains ? Ie if there are multiple gain stages set for very high gain, chopping a square wave into smaller square wave does not lead to creation of more harmonics ?
Question 5: What part does interstage filtering play ? If we clip a signal into a square wave, pass it through a filter and make it a shark fin wave, and then clip it again, what happens ? Some patents on multistage clippers also emphasis the role of interstage filtering. What role does that play regarding harmonic motion (besides the well known advantages of controlling high energy Bass, controlling fizz created after distortion, controlling intermodulation products, preventing creation of harmonic of a harmonic)

Steben

There definitely is a law of diminishing returns. Having two stages instead of one is a huge step in my experience. All the rest is much smaller effect and at some point there will be a S/N ratio problem.
  • SUPPORTER
Rules apply only for those who are not allowed to break them

Rob Strand

If you think about the harmonics of a square-wave they eventually level off.   Sloped sides on the square wabe will roll-off the highs a bit more (see the previous thread).  IMHO the key difference lies in the intermodulation distortion and not the harmonic distortion.
Send:     . .- .-. - .... / - --- / --. --- .-. -
According to the water analogy of electricity, transistor leakage is caused by holes.

Vivek

Please guide me on how to test this stuff theoretically on SPICE

One test could be:

Set up 2 symmetrical clippers
one after the other in series
set them up such that second clipper clips at half the clipping level of first one
( Example :
900mv and 450mv
800mv and 400mv
etc)

and draw graph of first few harmonics created

and compare that with a single stage clipper

Then change the ratio between the clippers, maybe 75%
like 900mv and 225mv

and plot again.



How to test for intermodulation distortion ?

Vivek

Quote from: Steben on September 06, 2021, 06:22:57 AM
There definitely is a law of diminishing returns. Having two stages instead of one is a huge step in my experience. All the rest is much smaller effect and at some point there will be a S/N ratio problem.

I consider many popular circuits which have hard clipper shunt diodes after soft clipping diodes in Opamp feedback path as effectively 2 stages of clipping.

Is that a correct way of looking at things  ?

teemuk

#5
QuoteWhat part does interstage filtering play ? If we clip a signal into a square wave, pass it through a filter and make it a shark fin wave, and then clip it again, what happens ?

The filter attenuates some frequencies while others are left unattenuated. (Because a square wave consists of multiple frequencies deformation of it is a great indicator of what filters are in play). Frequencies attenuated more by the filter are distorted less, frequencies attenuated less by the filter are distorted more.

Depending on filter - LP, BP, HP - peak clipping compresses the select frequencies. E.g. hi-pass filtered signal limited by peak clipping basically decreases the effect of the hi-pass filter. Naturally it isn't all so straightforward because we also have harmonic and intermodulation distortions at play that may enhance select frequencies.

QuoteSome patents on multistage clippers also emphasis the role of interstage filtering. What role does that play regarding harmonic motion (besides the well known advantages of controlling high energy Bass, controlling fizz created after distortion, controlling intermodulation products, preventing creation of harmonic of a harmonic)

Those already make up a pretty good set of rudimentary effects one may wish to achieve with interstage filtering. Additionally interstage (coupling-type) filtering is employed in controlling time constants of bias shifting that happens when an asymmetric signal is capacitively coupled.

Rob Strand

#6
QuotePlease guide me on how to test this stuff theoretically on SPICE

One test could be:

Set up 2 symmetrical clippers
one after the other in series
set them up such that second clipper clips at half the clipping level of first one
( Example :
900mv and 450mv
800mv and 400mv
etc)

and draw graph of first few harmonics created

and compare that with a single stage clipper

Then change the ratio between the clippers, maybe 75%
like 900mv and 225mv

and plot again.



How to test for intermodulation distortion ?
OK let me set one up.   I don't have my old spice files so I'll have to create a new sim.

Is a four diode clipper (1.2V, 2 diodes in each direction) feeding into a two diode clipper (0.6V, 1 diode in each direction) something along the lines of what you were thinking?

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

Vivek

I'm approaching this from a purely mathematical angle, without using diodes or Opamps:



* Clipping study.asc
B1 Output1 0 V=(abs(V(Out1))< clip)*V(Out1)+(V(Out1)>= clip)*(clip+((V(Out1)-clip)*compl)) +(V(Out1)<=-clip)*(-clip-((-clip-V(Out1))*compl))
V1 Out1 0 SINE(0 1V 1000)
B2 Output2 0 V=(abs(V(Output1))< clip2)*V(Output1)+(V(Output1)>= clip2)*(clip2+((V(Output1)-clip2)*compl2)) +(V(Output1)<=-clip2)*(-clip2-((-clip2-V(Output1))*compl2))
.params clip=0.65
.tran 0 50ms 0 10n
.params compl 0.0
.options numdgt=7
.options plotwinsize=0
.four 1000 10 40 V(output1)
; .four 1000 10 100 V(ic2_out)
.step param clip list 0.95 0.9 0.85 0.8 0.75 0.7 0.65 0.6 0.55 0.5 0.45 0.4 0.35 0.3 0.2 0.1 0.05 0.025 0.01
.params compl2 0.0
.params clip2={clip/2}
.backanno
.end

Rob Strand

QuoteI'm approaching this from a purely mathematical angle, without using diodes or Opamps:
Ah, OK, same idea as the diodes but hard clipping.

I suspect hard clipping which show-up less differences to soft clipping like with diodes.

I have got some stuff like that set-up but not for intermodulation.

The biggest pain setting up an intermodulation "experiment" is making apples to apples comparisons (levels and gains).
The hard clipper should be a little easier than diodes.
Send:     . .- .-. - .... / - --- / --. --- .-. -
According to the water analogy of electricity, transistor leakage is caused by holes.

Rob Strand

#9
I did this analysis and concluded hard clippers aren't always the best platform to show differences:

Two-Stage Hard clipper

If no dynamical coupling the key point is the overall transfer function
is non-dynamical and can be described with a single NL transfer function.

Stage 1:   gain of 1 for small sigs, output hard clip at +/- 1V

Stage 2:   second clipper gain of 1 for small sigs, output hard clip at +/- 0.5V
      that means clip threshold at input of second stage is 0.5V.

|Input|    Output
< 0.5V     linear and gain = 1

0.5V to 1V  stage 1 is linear but clip point of stage 2 overrides and output
           is hard clipped at +/- 0.5V

> 1V         first stage clips however this has no impact on the output as
                 clipping is determined by stage 2.

In other words stage 2 is what shapes the final NL transfer function.

You might think what happens if the signal bobbles around the clip-point of stage 1.
Basically riding of the clip point of stage 1 is erased because stage 2 is already
hard clipping.



QuoteIf no dynamical coupling the key point is the overall transfer function
is non-dynamical and can be described with a single NL transfer function.
For this reason the NL transfer function is either the same or clips harder than any of the two stages (assuming the stages have a clipping characteristic and not an "expansion" characteristic.)
Send:     . .- .-. - .... / - --- / --. --- .-. -
According to the water analogy of electricity, transistor leakage is caused by holes.

Vivek

Another way to look at the question


What is the difference in harmonics between

1vp sine wave clipped at 0.4vp

And

1vp sine wave that was first clipped at 0.8vp and then at 0.4vp

Will the earlier, gentler clip lead to

More harmonics ?
Different harmonics ?
More movement of harmonics as amplitude changes ?

PS: the compliance parameter on my idealised clippers allow setting of any degree of softness of clip

Rob Strand

QuoteAnother way to look at the question

What is the difference in harmonics between

1vp sine wave clipped at 0.4vp

And

1vp sine wave that was first clipped at 0.8vp and then at 0.4vp
The first stage will have no effect - based on the previous argument.
And that's because of the hard limit of the second stage.

If you plot Vin vs Vout you would only see one kink in the NL transfer function.
Putting a high or high-pass filter between the stages will certainly complicate matters, and that because the cascade stages are no longer have non-dynamical non-linearity.


QuotePS: the compliance parameter on my idealised clippers allow setting of any degree of softness of clip
Yes, I realized that.  So if you didn't have a hard limit on stage 2 you would see an extra kink/knee/break-point in the non-linear transfer function.    That means the first stage kink/knee/break-point is now visible at the output of stage 2.

If you have non-linear transfer function with a sequences of kinks/knees/break-points it doesn't matter if you do that on multiple cascade stages or in one stage with multiple break-points.     As soon as you add filtering between the stages it completely changes things theoretically.  Although if the filtering is weak (low hi-pass cut-offs and high low-pass cut-offs) the filtering would  be largely benign in practice.
Send:     . .- .-. - .... / - --- / --. --- .-. -
According to the water analogy of electricity, transistor leakage is caused by holes.

Vivek

Quote from: Rob Strand on September 08, 2021, 01:00:20 AM

The first stage will have no effect - based on the previous argument.


I feel there could be a difference

because in one case, we feed the 0.4V clipper a pure sine wave

and in other case, we feel the 0.4V clipper with a clipped wave that already has some more harmonics than a pure sine wave.


I will soon have a result from the spice simulations. Just have to copy about 200 numbers from the Spice Error log into the right cells in Excel

Rob Strand

Quote
I feel there could be a difference

because in one case, we feed the 0.4V clipper a pure sine wave

and in other case, we feel the 0.4V clipper with a clipped wave that already has some more harmonics than a pure sine wave.

If you sim both cases in parallel and subtract the waveforms in spice it should come out as zero error - and for any input waveform.

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

Vivek

#14
Great idea !

Instead of finding out what is the difference, we can first find out if there is a difference

Doing this cancellation test is very easy, I should be able to do simulation runs this evening.

Should I do this test :

On one limb, clip a 1Vp sine wave at 0.5Vp

on other limb, clip a 1V sine wave at 0.8vp and then pass it to a 0.5vp clipper

and do the cancellation test on these two signals ?

once hard clipped, once with some compliance.

Once with symmetrical clipping and once with Asymmetrical clipping

This should be very interesting indeed !!!!



Guys, what are your bets ?
A) The two limbs will be exactly the same ?
B) There will be a difference ? If so, what difference do you expect ?


Basically : does symmetrical hard clipping of a wave remove all even harmonic content that was created in a previous asymmetrical clipping stage ?


Steben

#15
The modded bluesbreaker and mark's wattbreaker have two soft clipping stages. This is much more complex since there will be no tlat curve zone, it stays dynamic. It sounds delicious and must say lower in IM annoyance. But that is intuitive.

One of the things I dwell upon is the order of combining symmetrical and asymmetrical stages. Is ending with asymmetrical better sounding or starting?
  • SUPPORTER
Rules apply only for those who are not allowed to break them

Vivek

Quote from: Steben on September 08, 2021, 07:03:47 AM
One of the things I dwell upon is the order of combining symmetrical and asymmetrical stages. Is ending with asymmetrical better sounding or starting?

Hi Steven,
I can try this out easily in my theoretical setup

Or you can do it easily too :

Here is the updated LTSPICE file that can easily simulate effect of multiple stages of symmetrical clipping. I will modify it soon to handle multiple Asymmetric clipping stages.

* Clipping study.asc
B1 Output1 0 V=(abs(V(Out1))< clip1)*V(Out1)+(V(Out1)>= clip1)*(clip1+((V(Out1)-clip1)*compl1)) +(V(Out1)<=-clip1)*(-clip1-((-clip1-V(Out1))*compl1))
V1 N001 0 SINE(0 1V 1000)
B2 Output2 0 V=(abs(V(Output1))< clip2)*V(Output1)+(V(Output1)>= clip2)*(clip2+((V(Output1)-clip2)*compl2)) +(V(Output1)<=-clip2)*(-clip2-((-clip2-V(Output1))*compl2))
B3 Output0 0 V=(abs(V(Out1))< clip0)*V(Out1)+(V(Out1)>= clip0)*(clip0+((V(Out1)-clip0)*compl0)) +(V(Out1)<=-clip0)*(-clip0-((-clip0-V(Out1))*compl0))
V2 Out1 N001 SINE(0 0.57333 3141.5926 0 0 28.435435)
.params clip1=0.5
.tran 0 45ms 0 10n
.params compl1 0.0
.options numdgt=7
.options plotwinsize=0
.four 1000 10 40 V(output2)
; .four 1000 10 40 V(ic2_out)
; .step param clip list 0.95 0.9 0.85 0.8 0.75 0.7 0.65 0.6 0.55 0.5 0.45 0.4 0.35 0.3 0.2 0.1 0.05 0.025 0.01
.params compl2 0.0
; .params clip2={clip/2}
.params clip0=0.2
.params compl0 0.0
.params clip2=0.2
.backanno
.end



Steben

#17
Don't let this fool you to stop whatever you want to search for.
Yet ... We all know addition of even and odd harmonics come from this and that.
But it does not tell us whether we like it until we hear it.
Bias shift and sag is exactly the same, you try to theorise them. But because you like it. You play the numbers after you know the trick.
At least that is what I do too. I played with the double soft clipper not knowing whether I'ld like it. I keep comign back to it because it is my first tweak / mod whatever that actually gives a great added value. All the others were gain and freq stuff.

Are push pull amps really only odd hermonics? Do we think the pair of tubes on great sounding amps are perfectly matched? If not, they .... produce even order harmonics you see.
The amount of harmonics on a classic triode input stage is low. Very low. The effective signal swing is rather small compared to the max output swing. It is quite even order based, but in low totals. No simple discrete amplifier stage design can produce so little "distortion / gain" factor as a handful components triode one. Let that sink in: one of the greatest things about a triode input stage is the fact it actually comes close to a perfect high impedance opamp rather than it is a great distorter. It is actually as I've noticed quite difficult to mimick the input triode harmonic content with opamps and diodes because you easily have too much distortion. The Fetzer valve uses feedback at the source to lower harmonics. A jfet is simply too dirty.
Too much even order is known to have more intermodulation factors. Most Fuzzes are full of even order stuff and do not sound warm tubey. Just like a negative feedback tube amp clips harsher than a fuzz face. And so on and so on.
  • SUPPORTER
Rules apply only for those who are not allowed to break them

Vivek

Results of the simulations on effect of multiple gain stages :

Situation one :
We compare a 1Vp sine wave signal hard clipped at 0.5Vp
with
a 1Vp sine wave signal hard clipped at 0.85Vp and further hard clipped at 0.5Vp

Here is 1Vp sine Hard clipped at 0.5V (Output0)


and here is 1Vp sine wave hard clipped at 0.85v (Output1) and then passed to second clipper that hard clips at 0.5V (Output2)




Rob was totally on the money. For Hard clipping, the total transfer curve is equal to the last transfer curve which clips at the lowest signal level. All harmonics that were created by earlier stage are wiped out by final stage.


But the above was for hard clipping. Now let us try some soft clipping

Situation two :
We compare a 1Vp sine wave signal soft clipped at 0.5Vp
with
a 1Vp sine wave signal soft clipped at 0.85Vp and further soft clipped at 0.5Vp

Here is 1Vp sine soft clipped at 0.5V (Output0)


and here is 1Vp sine wave soft clipped at 0.85v (Output1) and then passed to second clipper that soft clips at 0.5V (Output2)




Here is the simplified graph:


and this graph shows the differential signal:


We can see that for soft clipping, there is a difference created by having multiple stages.

And most real world clippers have some degree of softness in them.

The above is true even for more complex signals than pure sine waves:


Green Out1 = complex input signal
Red Output1 = hard clipped at 0.5vP (We cannot see this trace since it is exactly overlaid by trace of Output 2)
Blue Output2 =  Out1 is first hard clipped at 0.85v and then hard clipped at 0.5V
Pink = difference between Output1 and Output2

For Hard clipping, the total transfer curve is equal to the last transfer curve which clips at the lowest signal level. All harmonics that were created by earlier stage are wiped out by final stage.

But for soft clipping: There is a difference created by having multiple stages


Conclusion:
These tests seem to say

A: As Rob had predicted, for symmetric hard clipping with no sag/inter stage coupling, the total transfer curve is determined by the transfer curve of the last stage that clips the hardest. There seems to be no advantage of having multiple stages

B) For symmetrical soft clipping with no sag/inter stage coupling, there is some harmonic movement created by having multiple gain stages.

Hence for high gain pedals with Symmetrical clipping, one stage of clipping could be enough. Adding extra high gain stages will not add harmonic motion.

For low gain pedals, there is a benefit of designing multiple stages, each with soft clipping.

Vivek

#19


Green is transfer function of single stage of soft clipping at 0.5V ( One knee due to one stage of soft clipping)



Red is transfer function of soft clipping at 0.85 first (blue) and then passing that signal through another stage with soft clipping at 0.5V

Red has 2 knees because of 2 stages of soft clipping.

Red is different than green. For soft clipping, the output of multistage amp is different than a single stage amp