• WANTED: Happy members who like to discuss audio and other topics related to our interest. Desire to learn and share knowledge of science required as is 20 years of participation in forums (not all true). Come here to have fun, be ready to be teased and not take online life too seriously. We now measure and review equipment for free! Click here for details.

Harmonic and Intermodulation Distortion

DonH56

Master Contributor
Technical Expert
Forum Donor
Joined
Mar 15, 2016
Messages
5,676
Likes
10,158
Location
Monument, CO
This post provides a quick comparison of how a distortion percentage relates to dynamic range in dB. That is, if an amplifier has 1% distortion, what does that mean? How soft (or loud) is 1%?


Figure 1 shows a 1 kHz voltage signal with 1% second harmonic distortion (HD2) added. The spectral analysis (FFT, fast Fourier transform) shows the second harmonic at 40 dB below (-40 dB) the (0 dB) signal. So, 1% distortion is 40 dB below the signal level. Recall that dB = 20log(x), 1% is 1/100 = 0.01, and 20log(0.01) = -40 dB. Aside: Power goes as 10log(x), so 1% distortion in power (Watts) is only -20 dB. In SPL (dB/W), 20 dB is about the difference between say a pretty loud sound (80 dB) and a normal conversational volume (60 dB). Since we are in voltage (maybe a preamplifier output before the power amp), 40 dB takes you from that loud sound down to a fairly quiet room, say a library.

thd1.jpg


The lower plot shows an ideal sine wave, the signal with 1% distortion, and the difference (error) signal multiplied by 10 to make it easier to see. By eye, I cannot see any difference in the ideal input signal and output with 1% distortion (Vout). Because the error is purely second harmonic distortion, notice there are twice as many cycles in the error as in the input signal.

The figure below shows the same 1% distortion but now it is third harmonic distortion (HD3). The HD3 spur is -40 dB, but notice there are now three error cycles for each full cycle (0-up-0-down-o) of the signal. And again, I can’t see anything by eye (maybe you can).

thd2.jpg


Just for grins, and for something to see, the following two pictures show 10% HD2 and HD3. As expected the harmonic terms are now only 20 dB below the signal. What is interesting is how the high level of distortion changes the look of the waveforms. Second harmonic distortion does not change the picture too much, but third harmonic distortion causes the peaks to flatten, sort of like a soft square wave. Even harmonics tend to sound more pleasant than odd harmonics, adding a bit of edge to the sound while odd harmonics create a raspy buzz.

thd3.jpg


thd4.jpg


Last is a figure showing 0.1% HD3, with a spur 60 dB below the signal. A factor of ten in distortion changes the level by 20 dB (in voltage; a 10x change in power is 10 dB).


thd5.jpg


Finally, here’s a table showing the relationship among distortion in percent and dB in voltage (or current) and power. The dominant source of distortion in most systems is the speakers, which often run 1% or more in the midrange even for good ones, and 10% or more for large low-frequency signals. Amplifiers usually run in the 0.1 – 1% range, and preamps often 0.01% or better.

THD_table.JPG


Hopefully this will help relate those distortion percentages to the dB specifications used for SNR, SPL, and so forth.

--- On to IMD ---

A previous post discussed harmonic distortion (HD), but to most people intermodulation distortion (IMD) is far more objectionable. Why? Because IMD generates tones that are not harmonically related to the input signals, and these tones “stick out” more than tones that are harmonics of the input tones. They sound “off” to our ears.

As an example, I created two tones at around 523 Hz (C above middle C on a piano) and 661 Hz (the E above, the root and third of a major chord). I added 0.1 % second- and third-order distortion terms (x^2 and x^3) and plotted the spectrum.

imd_1.jpg


You can see the two signal tones at -6 dB, and a group of distortion spurs (tones) around the signal. I used -6 dB (0.5 full-scale) because two signals added will peak at 0 dB when they are each at one-half full-scale. You can see that in the next picture, which shows a few cycles of the signal. The funny-looking waveform is a result of the two signals mixing together, adding and subtracting from each other at different times. Even though each signal alone would only reach 0.5, together they reach 1.0 when they are in phase so both signals add. The error signal is multiple by 100 to make it easier to see; otherwise, the 0.1 % error would be essentially invisible by eye.

imd_2.jpg


Below is a zoom showing the bunched signals, and a table of all the frequencies present. Not only do we have harmonics of each signal, at 2x and 3x the fundamental tones, but also intermodulation sum and difference terms. That means that we get C and E, and their second and third octaves, but also a tone a little over high D, a little below a low C# from the second-order IMD. The third-order IMD gives back the fundamental tones (but in general out of phase, causing amplitude modulation), and tones around a couple of (lower and higher) G’s (not too bad), Bb (oops), and a strange tone about half-way between Ab and A (what?) As a matter of fact, none of the IMD tones lie exactly on a piano note. These added tones add dissonance not in the original chord structure, and our ears are pretty good at picking out this dissonance. Yuck.

imd_3.jpg


imd_4.jpg


So, IMD creates non-harmonic tones, tones that do not lie in the chord, and that sounds bad. One other note: IMD tones are actually higher in magnitude than HD tones. Theoretically, IMD-2 tones are 6.021 dB higher than HD-2 tones, and IMD-3 tones are 9.542 dB above the corresponding HD-3 tones. Adding insult to injury… This is another reason IMD is more important than HD in the real world.

The derivation of all this is straight-forward but tedious. Take a couple of signals represented by Vin=sin(2*pi*f1*t)+sin(2*pi*f2*t), then build a function using

Vout = Vin + HD2*Vin^2 + HD3*Vin^3

After expanding out the terms and plugging in various trig identities you will find the terms in the table above, and the relation between HD and IMD amplitudes.

Hope this is useful - Don
 
Last edited:

amirm

Founder/Admin
Staff Member
CFO (Chief Fun Officer)
Joined
Feb 13, 2016
Messages
35,409
Likes
136,153
Location
Seattle Area
Thanks Don. I want to make an observation.

A system that is non-linear produces both THD and IMD. That system is going to sound the same whether you look at the THD rating or IMD! It has to, it is the same system!

What this says is that the phrase "IMD distortion is worse sounding than THD" has no meaning by itself. The only meaning it can have is for example, if the same amount of *measured* IMD may be worse sounding than same amount of *measured* THD. You may have noticed that I do not produce single number IMD values so in this regard, it doesn't even apply.

The problem with using IMD in measurements is that it is very difficult to apply psychoacoustics to it. You have tones all over the place, ahead, behind, and in relation to the primary tones.

THD on the other hand, has a single tone and everything that follows it. As such, it is easy to apply perceptual masking to it to figure out the level of audibility. So while THD by itself is not a very direct measure of audible distortion, its spectrum is quite readily adaptable to such an analysis. So to the extent we are trying to assess the audibility of single system, THD is a better measurement.
 

Jimbob54

Master Contributor
Forum Donor
Joined
Oct 25, 2019
Messages
7,337
Likes
8,717
I understood at least 12.92% of this. I R syantist now!

(Thanks Don, very well stated)
 
OP
DonH56

DonH56

Master Contributor
Technical Expert
Forum Donor
Joined
Mar 15, 2016
Messages
5,676
Likes
10,158
Location
Monument, CO
Thanks Don. I want to make an observation.

A system that is non-linear produces both THD and IMD. That system is going to sound the same whether you look at the THD rating or IMD! It has to, it is the same system!

What this says is that the phrase "IMD distortion is worse sounding than THD" has no meaning by itself. The only meaning it can have is for example, if the same amount of *measured* IMD may be worse sounding than same amount of *measured* THD. You may have noticed that I do not produce single number IMD values so in this regard, it doesn't even apply.

The problem with using IMD in measurements is that it is very difficult to apply psychoacoustics to it. You have tones all over the place, ahead, behind, and in relation to the primary tones.

THD on the other hand, has a single tone and everything that follows it. As such, it is easy to apply perceptual masking to it to figure out the level of audibility. So while THD by itself is not a very direct measure of audible distortion, its spectrum is quite readily adaptable to such an analysis. So to the extent we are trying to assess the audibility of single system, THD is a better measurement.

True. The point back then, and hopefully now, was to introduce IMD to audiophiles and other folk that may not have seen the term since it is not usually provided in consumer datasheets. I could say I might have worded it better now, ten or so years later, but I probably would have made the same mistake today. For a given level of HD, there is a commensurate level of IMD, and I find IMD more objectionable than HD. In the real world, you cannot separate them, so I find it useful to remember the relationship among HD, IMD, and the varying distortion frequencies that they can produce.
 

AnalogSteph

Major Contributor
Joined
Nov 6, 2018
Messages
1,814
Likes
1,681
Location
.de
What is perhaps worth mentioning is that IMD testing may reveal a DUT's weaknesses much more readily than HD testing. An AB amplifier than suffers from thermal modulation of bias may show perfectly acceptable 1 kHz but score surprisingly badly on an SMPTE IMD (60 Hz / 7 kHz) test. There is also the case of how in a speaker driver two distortion mechanisms producing virtually identical HD(f) profiles end up having a radically different effect.

The intrinsic correlation of HD and IMD in "well-behaved" distortion sources (think most things line-level) can be helpful in tracking a rising HD(f) profile even beyond the point where harmonics start falling outside measurement bandwidth. CCIF IMD (19/20 kHz) is one popular test like that; RMAA also implements a swept frequency 2-tone IMD.
 

amirm

Founder/Admin
Staff Member
CFO (Chief Fun Officer)
Joined
Feb 13, 2016
Messages
35,409
Likes
136,153
Location
Seattle Area
What is perhaps worth mentioning is that IMD testing may reveal a DUT's weaknesses much more readily than HD testing. An AB amplifier than suffers from thermal modulation of bias may show perfectly acceptable 1 kHz but score surprisingly badly on an SMPTE IMD (60 Hz / 7 kHz) test.
That's because the test frequencies and numbers are different. If you test at 60 Hz and then 7 kHz, then you have the same information as the SMPTE IMD except now they are separated and easier to analyze.
 

KSTR

Major Contributor
Joined
Sep 6, 2018
Messages
1,587
Likes
3,426
Location
Berlin, Germany

amirm

Founder/Admin
Staff Member
CFO (Chief Fun Officer)
Joined
Feb 13, 2016
Messages
35,409
Likes
136,153
Location
Seattle Area
A bright guy over at diyaudio.com suggested using a 7kHz+13kHz 1:1 twin tone for testing electronics and he explained very well why it is more useful than 1kHz, or even 20kHz HD/THD, as well as 19+20kHz IMD.
https://www.diyaudio.com/forums/equ...stortion-levels-sound-card-6.html#post6615692 (and following posts).
I for one got fully convinced.
I don't like 13 kHz full amplitude tone as there is no music that remotely has such characteristic. Such a test is also not sensitive to low frequency distortion as SMPTE one is with its 60 Hz component.
 

JohnYang1997

Master Contributor
Technical Expert
Manufacturer
Joined
Dec 28, 2018
Messages
7,006
Likes
15,848
Location
China

pkane

Major Contributor
Forum Donor
Joined
Aug 18, 2017
Messages
2,604
Likes
4,308
Location
North-East
Last edited:

abdo123

Major Contributor
Forum Donor
Joined
Nov 15, 2020
Messages
4,245
Likes
3,780
Location
Brussels, Belgium
. So to the extent we are trying to assess the audibility of single system, THD is a better measurement.

I disagree with that statement.

we already know that IMD is a result of one diaphragm producing too much of the entire audible range. So when comparing two systems, one with 4 diaphragms (floor standers), the other with one or two (bookshelf), it is very incorrect in my opinion to say that THD% will better reflect the audibility of overall distortion in these two systems as it completely disregards the fact that speakers typically play a plethora of tones at any particular moment and completely disregards the benefit of having multiple diaphragms in a system.

IMD has always been the better indicator of distortion audibility as it encapsulate both harmonic distortion and distortion due to playing multiple tones at the same time. The only problem is how to standardize measuring it. and how to interpret the measurements. to say THD is the better indicator just because it is easy to measure and interpret is false imo.
 
Last edited:

boXem | audio

Major Contributor
Manufacturer
Forum Donor
Joined
Jun 19, 2019
Messages
1,270
Likes
1,875
Location
Europe
True, but can be done digitally. I wrote a multitone generator/analyzer software that can handle from two up to many thousands of tones. I can notch any of them, no problem :) never published it as I didn’t see much value in this kind of testing, plus it required a lot more polish to become usable by others:

https://www.audiosciencereview.com/...ds/multi-tone-audio-testing.12865/post-382712
That's nice for the readability of the result and performing some calculation, but doesn't ease the work for the ADC, which is the primary goal of an analog notch.
 

pkane

Major Contributor
Forum Donor
Joined
Aug 18, 2017
Messages
2,604
Likes
4,308
Location
North-East
That's nice for the readability of the result and performing some calculation, but doesn't ease the work for the ADC, which is the primary goal of an analog notch.

Yeah, an analog notch for a 10k-tone multi-tone signal would be extremely impressive ;)
 
OP
DonH56

DonH56

Master Contributor
Technical Expert
Forum Donor
Joined
Mar 15, 2016
Messages
5,676
Likes
10,158
Location
Monument, CO
A bright guy over at diyaudio.com suggested using a 7kHz+13kHz 1:1 twin tone for testing electronics and he explained very well why it is more useful than 1kHz, or even 20kHz HD/THD, as well as 19+20kHz IMD.
https://www.diyaudio.com/forums/equ...stortion-levels-sound-card-6.html#post6615692 (and following posts).
I for one got fully convinced.

Isn't there a testing standard that uses widely-spaced tones? I do not recall it off-hand but have seen/read it before... There are also good arguments for using two tones that are relatively prime to obviate FFT windowing and binning artifacts; that is part of the IEEE's ADC and DAC Standards with which I am somewhat familiar (been a while now, but I helped write the ADC Standard, in a minor way).

There are all sorts of pros and cons for using closely- and widely-spaced tones but that's a debate for another thread IMO. For example, closely-spaced tones put IMD in-band for a narrowband system where they cause the most damage, but for audio there is the masking argument (which I am familiar with only in a very hand-waving way). Testing methodology in general could fill its own forum...
 

Andrew s

Member
Joined
May 9, 2021
Messages
59
Likes
80
The problem with using IMD in measurements is that it is very difficult to apply psychoacoustics to it. You have tones all over the place, ahead, behind, and in relation to the primary tones.
It seems to me that's exactly why you would want to see it measured as thay are not easily masked. That is below the threshold of hearing?

Regards Andrew
 

KSTR

Major Contributor
Joined
Sep 6, 2018
Messages
1,587
Likes
3,426
Location
Berlin, Germany
Isn't there a testing standard that uses widely-spaced tones? I do not recall it off-hand but have seen/read it before... There are also good arguments for using two tones that are relatively prime to obviate FFT windowing and binning artifacts; that is part of the IEEE's ADC and DAC Standards with which I am somewhat familiar (been a while now, but I helped write the ADC Standard, in a minor way).

There are all sorts of pros and cons for using closely- and widely-spaced tones but that's a debate for another thread IMO. For example, closely-spaced tones put IMD in-band for a narrowband system where they cause the most damage, but for audio there is the masking argument (which I am familiar with only in a very hand-waving way). Testing methodology in general could fill its own forum...
Multitones on bin centers (that is, periodic sequences) are easily generated (with arbitrary levels and phases), I have various code snippets for this. In that context, it makes sense to uses rather sparse multitones whose components are on specific bin multiples. REW can do that (the NID option in the Multitone section).

I'm fully with @alexcp, the 7+13kHz is simple and efficient and revealing. Thisone really should become a new industry standard. 19+20Khz, while a standard, is quite useless in comparison.
 
Top Bottom