• The move to the new server is done. There are some software and database maintenance updates in process. This has us passing the hat around to help out. We appreciate any donations. Seriously, even a dollar helps. The payment page may be found here - https://www.audiokarma.org/support.html

Total Harmonic Distortion Analysis in SPICE

audiozaz

rtfm!? - tl;dr
Hi,

I hope that some of the technical members here can help me with that.

I've been dabbling with SPICE, simulating a very simple class A amplifier and wanted to check it's maximum input before clipping and analyse this with THD levels.

This lead me to think about manufacturer spec'ed THD for certain power levels, say 0.1% THD @ 50W. Using SPICE, I drove my simulated amplifier until the negative waveform had a certain amount of clipping at it's peak, used the Postprocessor FFT function and made a normalized FFT plot and computed the THD level with the fourth formula listed here. I was slightly below 0.1%THD, 0.07%THD to be more precise, at which level the clipping of the waveform seemed unacceptable to me.

Did I do this right?

I know most THD specs on amplifier are vanishingly low and thus meaningless. But what at what point should THD be considered too high?

My experiment showed me that at the point where waveform clipping can be visually detected, THD is around 0.005%, which I always considered VERY low and thus makes me think I might have done something wrong to arrive at this result. Many amps are spec'ed between 0.01% and 0.2%THD, which I would thus find unacceptable visually, but how much of this could be heard?

az
 
Register to hide this ad
Are you sure your THD at visibility threshold is 0.005 %? This sounds very low
indeed. Maybe the actual figure is 0.005 (no percentage symbol), which
corresponds to 0.5 % (still very low to be visible in the time domain).

If you have access to some number crunching ressources, you could
compute a signal like this over a large number of points in the interval from
t=0 to 1:

cos(2*pi*t) + 0.005 cos(4*pi*t).

This should have 0.5 % distortion, and I don't believe you could see much
difference from cos(2*pi*t) alone (a perfect signal).
 
Last edited:
Are you sure your THD at visibility threshold is 0.005 %? This sounds very low
indeed. Maybe the actual figure is 0.005 (no percentage symbol), which
corresponds to 0.5 % (still very low to be visible in the time domain).

If you have access to some number crunching ressources, you could
compute a signal like this over a large number of points in the interval from
t=0 to 1:

cos(2*pi*t) + 0.005 cos(4*pi*t).

This should have 0.5 % distortion, and I don't belive you could see much
difference from cos(2*pi*t) alone (a perfect signal).

:lmao: <--- Laughing at myself there!

Yeah, indeed it seems I have rushed over the fact that my results were the straight figure and not the % yet! New values, now multiplied by 100 are more realistic-sounding to me.

I'll input that formula into Excel to see what I can do with it.

Thanks!

az
 
Here are the time domain traces for 0.5% THD and a pure sinewave. One is indeed hard-pressed to tell the difference between both. Aside from the positive offset the formula give to the distorted trace, only an ever-so-slight rounding of the peak in the negative half is a tell-tale sign of distortion. It is a bit harder to see in the smeared JPEG image.

Even in SPICE I barely notice it. I need a bit more to be able to tell.

Thanks for your help electroking!

az
 

Attachments

  • Distortion Analysis 2.jpg
    Distortion Analysis 2.jpg
    33.6 KB · Views: 17
You're welcome. By the way, the definition of THD in use effectively means
that the distortion value is the maximum possible relative error on the peak
value of the signal. In other words, if you have a 1-volt peak fundamental
sine wave and 0.7 % THD, the peak value cannot deviate more than
7 millivolts from its nominal value. This happens when the phase of all
the distortion products is such that they add constructively, and this peak
occurs at the peak of the fundamental.
 
Good stuff!

I sim'ed my amp some more, and it seems no output level will take THD lower than ~0.12%. Then again, it is of the simplest design possible: Single-ended class A current buffer, darlington pair at the output, biased with a current source. No NFB to lower distortion too. Good for ~15W in 8ohm at ~0.2%THD. Might even end-up building it!

az
 
I guess no transistor has perfectly straight characteristic curves, so this no-feedback
THD figure sounds reasonable. Built it and you will have gained more power
amplifier practical experience than I have. Good luck!
 
I guess no transistor has perfectly straight characteristic curves, so this no-feedback
THD figure sounds reasonable. Built it and you will have gained more power
amplifier practical experience than I have. Good luck!

Yeah, sounds reasonable.

I have most parts for it, maybe just a transformer will be purchased if I can't find a suitable one on the cheap. Heat removal will be paramount as well: the four TO3-P output devices will dissipate 65W each at idle! Will need massive heatsinks!

The few parts will make point-to-point soldering possible. If I get around to it, I will be sure to post pics and details in the DIY forum.

az
 
Back
Top Bottom