Harmonic content distribution at various clipping points

Started by Vivek, May 14, 2021, 04:05:44 AM

Previous topic - Next topic

Vivek

I am interested in data regarding the amount of harmonics created when a 1Vp sine wave is symmetrically hard clipped at 0.9V, 0.8V, 0.7V etc





A) Has this already been done and the raw data already published ?

B) What is the best software to do this analysis ?
I know how to do this in SPICE and use XL to present the results, but its tedious

C) Any predictions on what will happen to the harmonics at various clipping levels ?

We know clipper set at 1Vp = no harmonics created

and clipper set at 0.00001Vp = square waves with wellknown harmonic distribution



Any predictions on shape of harmonic content curve versus clipping point in between these extremes ?

Idea is to try and find if there is some optimal point with lowest possible clipping and maximum/acceptable harmonics (I know Guitar signals are not sine waves and dont have fixed amplitude, still this exercise could possibly yield something interesting)



ElectricDruid

#1
(A) No, because of reasons I'll come to in a minute

(B) I don't know. I finish up building tools for things like this myself. I have PHP software that I've written that does Fourier Analysis of waveforms and can show me the harmonic content, for example.
One quick way to do this is to get some FFT software set up on your computer or o'scope and feed the output from a clipping circuit into it. Then you can see and hear the harmonics build up as you change the gain. I recommend this as a way of developing your intuition about what waveshapes and harmonic structures are going to sound like. An analogue synth run out to speakers and a scope is good for this too, since you can see the effect of filtering and resonance on the waves and harmonics.

(C) The details of how much/how many harmonics you get depends not only on the level, but also the shape. I notice your examples are fairly smooth - "flattened" rather than "hard clipped". If you look at the harmonics produced when you hard-clip a sine wave, you'll see that you get higher levels of higher harmonics. If the edges are rounded, you won't.

You won't see any discontinuities in the overall harmonic growth. For a single sine wave input, if you took several "snapshots" of the harmonics at various clipping points (like you've shown us) you could assume that the level of a harmonic changed linearly between one FFT and the next one and you won't be far wrong (piecewise linear approximation to a curve, but not a very curvy curve!).




antonis

The higher the value of clipping diode pair parallel (shunt) capacitor the "smoother" the clipped waveform..
"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..

Vivek

I wrote a mathematical formula in SPICE that does hard clipping of sine waves (no real circuit, no oscilloscope, no bypass capacitor, no diodes, no moving voltage across hard clip diodes)

I get waves like this :



Those are 1Vp sine wave hard clipped at 900, 800,700 mvp etc mathematically

Then I ran FFT on these hard clipped waves



It's interesting to see that at the third harmonic of 3KHz, the 600mvp clip has highest output, but for 5th Harmonic, the 800mvp has highest output.

And I made a sheet in XL with the normalised output per harmonic, the THD and the RMS mv for each clipping point :


I dont know how to post the raw data here

But I will soon analyse it with XL


But I can already see very little difference in the 1Vp sine wave chopped at 0.1 or 0.01 or 0.001vp. When the output is already almost a square wave, chopping at lower threshold does not seem to change the harmonic content.

Vivek

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

Vivek

Total Harmonic Distortion % versus hard clipping point of a 1vp Sine wave



Mark Hammer

Please keep in mind that guitar signals are only briefly at the 1V level, and quickly decline.
It always pays to remember that guitars are not oscillators.

GFR

I may be mistakenly remembering this, but aren't those curves (falling quickly and then a damped oscillation around zero) expressed by sin(x)/x  functions?

GFR


Vivek

Quote from: Mark Hammer on May 14, 2021, 08:22:31 AM

Please keep in mind that guitar signals are only briefly at the 1V level, and quickly decline.
It always pays to remember that guitars are not oscillators.


Yes, guitars are not sine waves and don't have fixed amplitude.

I feel that the harmonic content of a 1Vp sine wave chopped at 0.5Vp

Is exactly the same as a 0.1Vp sine wave chopped at 0.05Vp

ie the data and graphs have been normalized

iainpunk

another important note is that guitar signal is not symmetric by nature. both the actual harmonic content of the string and the proximity effect of a pickup contribute.
a guitar string has a complex mix of the harmonic series, determined by a bunch of factors, like material, stifness of the body and hardness of the bridge/nut/frets
then there is the pickups. they experience a log scale of magnetic field vs string proximity. even a string that moves away and toward a guitar pickup with a perfect sinusoidal motion will produce harmonic content other than the original sine wave, and that isn't even taking in to account that a string doesn't move in one direction only.
these effects also have a large impact on how the FFT actually looks, and i don't think FFT of a sine wave has all that much to do with how anything actually sounds to our ears.
this has more to do with the whole even/odd harmonic debate of symmetric vs asymmetric clipping. while i do agree with the premise that asymmetric clipping does feel and sound better (to my ears), the even/odd harmonic argument generally used is mostly wrong, and its way more complex than that.

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

cheers

Mark Hammer

Quote from: Vivek on May 14, 2021, 08:39:43 AM
Quote from: Mark Hammer on May 14, 2021, 08:22:31 AM

Please keep in mind that guitar signals are only briefly at the 1V level, and quickly decline.
It always pays to remember that guitars are not oscillators.


Yes, guitars are not sine waves and don't have fixed amplitude.

I feel that the harmonic content of a 1Vp sine wave chopped at 0.5Vp

Is exactly the same as a 0.1Vp sine wave chopped at 0.05Vp

ie the data and graphs have been normalized
It's not just the signal amplitude.  The harmonic content of the guitar signal changes quickly over time as well.  That's why it is so difficult to mimic a guitar sound with a bunch of synth modules.  And since the harmonic content produce by clipping depends on the harmonic content one is feeding the clipping circuit, as well as dynamic changes in the amplitude of those original harmonics, and the number of strings combining to produce the harmonic content of the output, I don't place a lot of personal faith in graphs obtained by modelling.  And bear in mind I'm not even factoring in string gauge/type, neck scale, where a note is being fretted (higher up the neck = stiffer more damped string = less harmonic content) and a host of other "mechanical" factors (e.g., floating wooden vs metal hard-tail bridge) that impinge on what the guitar feeds the circuit.

I mean, the graphs are valid for that brief instant where the signal can correspond to them.  But it's a bit like trying to predict the behaviour of a nation from a detailed examination of two of its inhabitants for a day.  It will only take you so far.

Vivek


ElectricDruid

#13
Quote from: Vivek on May 14, 2021, 08:05:32 AM
Normalised Harmonic content versus clipping point for a 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

The final conclusion isn't a surprise, but the little bumps that occur before you get there are interesting, for sure.

Reminds me a lot of some of the findings in this:

https://electricdruid.net/timbral-evolution-harmonic-analysis-of-classic-synth-sounds/

I think your results *do* suggest that there might be a "sweet spot" before you get to heavy clipping. I wasn't expecting that.



edit:typos

iainpunk

QuoteI think you results *do* suggest that there might be a "sweet spot" before you get to heavy clipping. I wasn't expecting that.
i don't think a guitar signal is consistent enough for that logic to be correct. with a synth that creates pure sine waves, you'd be right on the money, but gutar volume and wave shape are constantly changing, and differ from fret to fret.

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

cheers

Rob Strand

#15
I have a feeling there's a closed form solution for the harmonics of a hard-clipped sine wave.

If you think of a clipped sine as the sum "clean sine" * (1- pulse) + "square wave" * pulse  where pulse is a rectangular waveform 0 when not clipping and 1 when clipping then it's not hard to see a sinc() function getting in there.

I've done the clipping thing in spice and in Matlab/Scilab/Octave in the past.

To be a devils advocate you can take a spectum and reshape it using filtering.    Think about how that differs from trying to reshape the spectrum using the shape of the non-linearity.

-------------------------------------
Equation 23 might be related but the text doesn't quite sound right.   If it's going to work A is probably the clip level and Tau is the time (or half the time) the sine-wave is clipped.   For a square-wave it looks like a pi is missing you might need to add a scaling factor.   Keep in mind it might not be applicable at all.
https://file.scirp.org/pdf/JEMAA20120300004_77129008.pdf
Send:     . .- .-. - .... / - --- / --. --- .-. -
According to the water analogy of electricity, transistor leakage is caused by holes.

dschwartz

In simple words..
Softer clipping gives lower order harmonics..

Assymetric clipping gives more even harmonics and intermodulation distortion.
----------------------------------------------------------
Tubes are overrated!!

http://www.simplifieramp.com

PRR

Quote from: dschwartz on May 15, 2021, 12:57:48 AM..Softer clipping gives lower order harmonics..
Assymetric clipping gives more even harmonics...

Yes...

Quote from: dschwartz on May 15, 2021, 12:57:48 AM.. and intermodulation distortion.

??? Not sure.....
  • SUPPORTER

iainpunk

ALL distortion brings along intermodulation, even the most symmetric opamp clipping.

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

cheers

dschwartz

Quote from: iainpunk on May 15, 2021, 01:00:28 PM
ALL distortion brings along intermodulation, even the most symmetric opamp clipping.

cheers

Oh, of course..but I've found that assymetric clipping produces lower freq intermodulation artifacts..perceived as 'low end" or "fat"...
----------------------------------------------------------
Tubes are overrated!!

http://www.simplifieramp.com