Effect of Hard Clipping diodes after Rail saturated Opamp in Proco Rat

Started by Vivek, August 21, 2021, 05:44:54 AM

Previous topic - Next topic

Vivek

Cushy Chicken published his Analysis and LTSpice file for Proco Rat here :

https://cushychicken.github.io/ltspice-proco-rat/



I decided to investigate the effect of hard clipping diodes D2, D3 after the high gain, rail saturated initial Opamp

I felt that the Opamp would output almost square waves due to it's high gain and rail saturation

Hence further dicing it into smaller square waves by hard clipping diodes D2 and D3 might have very little contribution to harmonic content and dynamics. I had a hunch that all it could possibly achieve is to reduce the amplitude of the already square waves.

To test the hunch, I downloaded Cushy Chicken's LTSPICE file, set the gain pot to 10K, injected 200mvp signal at 1000Hz, ran a Transient analysis and looked at the output from the first IC and compared with the output after the diodes.



The IC is rail saturating with Vpp 7.35V
The diodes are clipping at 0.64V
All is as expected

(Never start a war unless you can predict the outcome in advance - Art of War
Never do a simulation unless you can predict the outcome in advance - Vivek)


It's obvious that the diodes will reduce the volume, so I scaled the two output levels mathematically to approximately match the peaks (but no change in wave shape)

After that rough adjustment of DC shifts and amplitudes, we get a graph like this :


We are more interested in the shapes of the signal before and after the hard clipping diodes, not in their DC shift or amplitudes.

We can already see that there is very little difference between an "Almost square wave" created by a heavily rail saturated IC and "Almost Square wave" when earlier "almost Square wave" is further hard clipped by shunt diodes.

Anyway, we proceed with an FFT to nail that coffin :



We can see that there is almost no difference in harmonics created by the hard clipping diodes to ground,

WHEN THE INPUT SIGNAL IS QUITE HIGH and the first IC was already producing almost square waves.

For smaller signals below 40mvP, the first IC has not fully entered rail saturation.

So if you remove the hard clip diodes, guitarists will feel :

A. It became slightly more crunchier rather than hard clip. This can be due to 3 reasons

The initial Opamp clips slightly less aggressively than the hard clip diodes FOR SMALL INPUT SIGNALS WHERE IC HAS NOT ENTERED RAIL SATURATION FULLY

The FET buffer might be getting saturated

The next pedal / Amp might be getting saturated


B. The volume increased considerably

So its proven :

Chopping square waves to smaller square waves does not change the frequency content.

Duh, who would have guessed !!!

PS : things are different if we reduce gain knob of pedal, roll off guitar volume substantially such that first IC does not enter saturation too early.

Steben

  • SUPPORTER
Rules apply only for those who are not allowed to break them

niektb

I think a factor here is that the LTSpice models of opamps aren't always accurate with close to rail behavior

Vivek

That could be true ! Most simulations are approximate.

Still, I'm sure it hardy matters in the context of my findings,

meaning that if there is a slight rounding of the corners of Square wave close to rail, there will still be very little deviation in the harmonics produced from a pure square wave

(But if there is lockup, phase reversal and other bad recovery, those features are not modeled in LTSPICE)

in any case, here are actual graphs of a real Opamp close to rail. The LTSPICE seems to show somewhat similar behavious.

https://www.analog.com/en/technical-articles/new-rail-to-rail-output-op-amps-bring-precision-performance.html
https://www.analogictips.com/amplifiers-rail-to-rail-single-supply-mean/



Rob Strand

QuoteThat could be true ! Most simulations are approximate.

Still, I'm sure it hardy matters in the context of my findings,

meaning that if there is a slight rounding of the corners of Square wave close to rail, there will still be very little deviation in the harmonics produced from a pure square wave

I noticed the clipper into a clipper thing shouldn't make any difference years ago.   The point is though in reality that conclusion is only strictly true for infinite gain.

Think about a high gain pedal and a guitar signal.   If you play single note you hear the clipped fundamental but you can also hear the metalic sound of the pick and resulting upper harmonics *of the string*.    Similarly when you play a chord you hear all the notes.   Why doesn't the clipped fundamental of the lowest string completely block all the other signals leaving a square-wave at the lowest frequency?   How are the harmonics getting through?   Also why does adding the common 700Hz high-pass filter before a clipping stage help even out the signal?

Take a look at clipping a 100Hz sine added to a 2kHz sine with a smaller magnitude.   Try the same test with a 700Hz high-pass filter.

You can start off with hard clippers - hard clipping but not a comparator you need a linear region near zero defining the gain.   After that you can look at diode clippers, softer on-set of clipping, clipping that isn't 100% hard on the flat parts.

You could easily spend a few days trying understand what is happening.  Think about how the highs are getting through.

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

PRR

Some times it isn't the clipped-flat part which is interesting, but the just starting/stopping to round-over part. A diode is different from a hi-gain amp here.

These are not one-dimensional problems.
  • SUPPORTER

Vivek

Quote from: Rob Strand on August 21, 2021, 10:54:42 PM

Take a look at clipping a 100Hz sine added to a 2kHz sine with a smaller magnitude.   Try the same test with a 700Hz high-pass filter.


Very good point, Rob !!!

I have lots to think about and lots to learn !

So far I only did tests with inputs of 1 sine frequency. I should start to do tests with multiple frequencies


The paper published at https://robrobinette.com/images/Guitar/Overdrive/Rutt_Overdrive_Paper.pdf says :

Quote2.3 Multiple Notes Passed Through Distortion

Each string of the guitar contributes to the output signal. The waveform from each string has its own
harmonic structure. Since a guitar has six individually controlled strings, up to six complex tonal
waveforms are mixed together in the pickup's output. The guitar also allows for bending notes by
stretching one or more of the strings. Thus at any given time the guitar signal may consist of several
independently decaying waveforms, with no direct harmonic relationships.

Linear analysis can be used when the superposition of input waveforms results in a superposition of the
outputs that would result from each input waveform alone. Amplifier nonlinearities cause superpositionbased analysis to fail.

The concept of signal spectrum comes from linear analysis. The output spectrum is
often used to characterize the nonlinear distortion components of a pure sine wave passed through an
amplifier. This output spectrum is used to define the well-known harmonic distortion measurement.

However, when input signals with a complex spectrum pass through nonlinear amplifiers, harmonic
distortion measurements provide no help in inferring the spectrum of the output waveforms.

The major perceptual differences between tube and solid-state amplifier distortion are manifest when
multiple tones pass through at the same time. While two different amplifiers may sound similar when a
single string is plucked on a guitar, they often will sound strikingly different when multiple strings are
strummed.

Different amplifiers may have similar harmonic distortion characteristics, but their
intermodulation distortion effects may differ greatly. These intermodulation distortion effects are
important for the acceptability of guitar amplifiers.


Rob Strand

QuoteVery good point, Rob !!!

I have lots to think about and lots to learn !

So far I only did tests with inputs of 1 sine frequency. I should start to do tests with multiple frequencies

The paper published at https://robrobinette.com/images/Guitar/Overdrive/Rutt_Overdrive_Paper.pdf says :
It's a not a simple thing to understand.    When you think about complex signals likes chords there's clearly a lot going on.    The two tone test at least exposes some differences between different distortion mechanisms.    That paper is on the right track and recognizes the differences.

When you use frequencies like 100Hz and 2kHz the harmonics of the 100Hz can overlap the 2kHz signal and harmonics.   So it's better to choose something like 133Hz and 2050Hz frequencies (can't remember exactly what I use to use) which prevent co-incident harmonics.   That lets you see which signal is contributing to the what parts of the output spectrum.

There are complex patterns to the harmonics.   You not only get the harmonic distortions but also the intermodulation terms eg 2kHz +/- 100Hz, 2kHz +/- 200Hz etc.   Then another lot at 4kHz +/- 100Hz and 4kHz +/- 200Hz etc.   The thing is you will see spectra on upper side of 2kHz( 2kHz + 100Hz etc)  run into the lower side of 4kHz (4kHz - 100Hz etc.)   If you choose the two frequencies correctly you can separate the terms going up and the terms going down.      If clipping is symmetrical you wont see the even terms like 2*f0  but you will see the odd terms like 3*f0.    You may need to play around with the sample rate and windowing in spice in order to get enough resolution on the harmonics.

You can also try two frequencies closer together.
Send:     . .- .-. - .... / - --- / --. --- .-. -
According to the water analogy of electricity, transistor leakage is caused by holes.

aron

With all of the analysis going on, how are all these companies and individuals doing these pedal and amp modeling? Is there some sort of "toolkit" they are using?

Rob Strand

QuoteWith all of the analysis going on, how are all these companies and individuals doing these pedal and amp modeling? Is there some sort of "toolkit" they are using?
I don't work in those companies but I suspect you will see anything from glorified clippers done in software, to modelling some specific device behaviours,  to complicated mathematical models.     If you look at say one of those Sansamp pedals they get lot of the sound from just EQ.   That would be very easy to do in DSP.   You might add a few wrappers around things to emulate certain behaviours like sag.    Early on in the history tweaking the simple methods will get you a long way, then finally you it a brick wall and you hope by that time the more complex methods are starting to work and the DSPs are fast enough to raise the bar one or two notches higher.    At this point in time I'd say all of the above exist in the market place.

Things can also go down the wrong path.  There was patent for emulating a Fender tone stack.  IMHO it was overly complicated for what it was considering you can write down a few equations for a Fender tone stack and transfer it to DSP.
Send:     . .- .-. - .... / - --- / --. --- .-. -
According to the water analogy of electricity, transistor leakage is caused by holes.