How do you REALLY measure THD?

IIUC at one time long, long ago the standard was that you play a test tone and use a notch filter to filter the test tone out. Whatever is left must be noise and or distortion. Thus, you have a number for THD+N.
Yep. Which is different from THD.

As far as I know, you get the total THD by squaring each harmonic level, adding the results and taking the square root.
There are actually two different methods for calculating THD:
  • IEC: THD = sqrt((h2^2 + h3^2 + h4^2 + h5^2 ... + hn^2) / (h1^2 + h2^2 + h3^2 + h4^2 + h5^2 ... +hn^2))
  • IEEE: THD = sqrt(h2^2 + h3^2 + h4^2 + h5^2 ... + hn^2) / h1
h1 is the amplitude of the fundamental.
h2, h3, h4, h5 ... , hn are the amplitudes of the harmonics.

It seems most use the IEEE math.

Sure it's measurable, but just how objectionable is it? And how about linear distortions such as LF transients smeared out into whoooshes?f Inaudible some may say...
Blah, blah, blah.

Tom
 
Yes, THD and THD+N are two different things. But they share something very important to keep in mind which has been known since at least 1938. That includes for SINAD. And you know what it is.

What I wonder is why nobody in this thread has bothered to point it out to the OP? Was it assumed he already knew?
 
Probably reasonable to check. @njswede do you know who Toole is? If so, then maybe you are familiar with his colleague Sean Olive?

Here is what Sean had to say about THD, THD+N, and SINAD that some people might rather you didn't know (especially manufacturers who hope you don't know because they sell product based on THD numbers):
1737087134310.png


There are other people who can even tell you more about why those metrics are worse than useless. Dr. Earl Geddes is one. If you would like to know the details I can post some of what he wrote and link to his AES articles. Or, maybe you don't care. In that case I don't care for now either.

Moreover, it is well known that other things are audible to humans besides THD/IMD and noise floor. Those things are things manufacturers may also find it useful not to tell you about.

 
Last edited:
  • Like
Reactions: adason
Please re-read my question! It concerned some pretty technical details on how to measure THD, specifically in SPICE (hence the reason I posted it in Software Tools). If I ever need lecture on THD and its impact on listening experience, you will be the first person I ask.
 
  • Like
Reactions: tomchr
Okay, fair enough. Just don't quite understand why you want to measure THD if its quite arguably useless for predicting SQ of an audio device? Regarding reconciling sims with actual devices, its pretty well known that sims tend to be overly optimistic in estimating nonlinear distortion.
 
So, ideally, raw THD as a measure of THD+N is not a valid psychoacoustic measurement.

To measure Effective Total Harmonic Distortion (ETHD) we should assign a weight to each harmonic...

That should blow some heads over at The Julian Hirsch Memorial Society.. AKA, ASR... huh?
 
This isn't the worst really short explanation out there:

Nonlinear distortion explanation

Here's what Wiki says:

Nonlinear distortion

OK, not entirely satisfying. But, the Taylor expansion is what is at the core here. Additional frequency products are generated by the circuit devices (usually, but not always, the "active" devices like transistors and vacuum tubes) because they have higher order transfer functions.

Webster has a decent definition for linear:

Linear

So, linear distortion has first order variables. The most common example is a non-flat frequency response for amplitude and/or time delay.

You could argue on the basis of semantics that noise, which includes hum and the rest, is also a distortion. After all, they cause a deviation from the desired signal.

OK, if nothing else, I understood what you were asking in the first post. I hope that we helped with that. I hope that I didn't mess up your thinking or transmit misinformation.
 
LOL! I know what linear means 😀

I just never referred to a non-flat Bode plot as “distortion”, but I guess that’s what linear distortion means. Variations in gain. I’m going to start throwing that term around to sound cool now! 😀

And no, you did not inject misinformation into the conversation. Quite the opposite!
 
  • Like
Reactions: CG
As for THD, I do understand that:
1. It’s not the be all end all quality metric in amplifier design. It is, however, a decent indicator on whether your design is decent and free of obvious errors. I realize that my listening experience isn’t going to change much if I go from 0.003% to 0.0003%. But it’s bragging rights and a fun mental exercise. I recreationally spend hours in SPICE just trying different things as a way of getting my mind off the daily grind. Sometimes I end up learning a thing or two.

2. SPICE simulations aren’t reality. However, and I know this from hands on experience, it’s a VERY good predictor of whether your design is sound, garbage or even broken.
 
Linear Distortion also includes phase shifts. Anything that changes the time domain waveform of the audio signal (like as seen on a scope) is considered a distortion. Nonlinear distortion also creates new frequencies.

A volume level change can be considered a nonlinear distortion if the volume is changed while a FFT spectrum analyzer is acquiring data points. A volume level change is a type of multiplication of the audio signal. Multiplication of two frequencies produces new frequencies, which is the case while the volume knob is being turned to a new position (it amounts to a type of amplitude modulation).

In the case of dacs based on sigma-delta modulators, there can also be signal-correlated distortion and or noise. That type of problem is more insidious and requires different measurement techniques. The simplest way to see some evidence is to to use a very high resolution spectrum analyzer view to look at spectral line noise skirts. (similar can happen if RFI noise is demodulated in forward biased semiconductor junctions)
 
Last edited:
This is some kind of gotcha question, isn’t it?

From the top of my head, what I would care about are THD, frequency response, slew rate, the shape of transient response, noise and maybe phase margin. There are myriads of other parameters like harmonics crossover points (critical in RF amplifiers) and group delay linearity.

Did I pass the test? 😀