# Harmonic and Intermodulation Distortion

OP

#### DonH56

##### Master Contributor
Technical Expert
Forum Donor
Somehow the first post in this thread, on harmonic distortion, disappeared through the magic of moving the thread around. I have added it to the first post so the title is now correct (Harmonic and Intermodulation Distortion).

HTH - Don

#### amirm

Staff Member
CFO (Chief Fun Officer)
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
Often IMD spurious tones are, where as THD ones are not.

#### kchap

##### Active Member
[ATTACH=full said:
145902[/ATTACH]
Isn't this table a little confusing? Distortion as a percentage is expressing the voltage (or current) ratio of signals whereas dB is a power ratio. In measurement we ignore the impedance but carry on the pretence of measuring a power ratio. When I see a figure of 0.01% distortion I assume that is voltage measurement which would equate -80db.

#### kchap

##### Active Member
Sorry I lost the table during the edit

OP

#### DonH56

##### Master Contributor
Technical Expert
Forum Donor
Isn't this table a little confusing? Distortion as a percentage is expressing the voltage (or current) ratio of signals whereas dB is a power ratio. In measurement we ignore the impedance but carry on the pretence of measuring a power ratio. When I see a figure of 0.01% distortion I assume that is voltage measurement which would equate -80db.

dB is a ratio of anything you want to ratio. Voltage, current, power, etc. The units I find most often in audio are for voltage and power, and I wanted to highlight that since power is related to voltage squared, dB in power is one-half the values in voltage (or current). The ratios are of power for a given percentage, and yes ignores whatever impedances are present. It is just a ratio, which is unitless.

1% distortion is a ratio of 0.01 (1/100) of whatever parameter you are measuring, so 1 V of distortion out of 100 V or 1 W of distortion out of 100 W.
• In voltage: dB = 20*log10(V1/V2) = 20*log10(1V/100V) = -40 dB
• In power: dB = 10* log10(P1/P2) = 10*log10(1W/100W) = -20 dB
And so forth..

HTH - Don

Last edited:

##### The Spice must flow…
Moderator
Forum Donor
Somehow the first post in this thread, on harmonic distortion, disappeared through the magic of moving the thread around. I have added it to the first post so the title is now correct (Harmonic and Intermodulation Distortion).

HTH - Don
Btw this is Don being “super polite” and not blaming the proper culprit for the muck up. It was my faulty editing, “Magic” that made things disappear. Sorry Don!

#### MRC01

##### Major Contributor
...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!
...
True... however, the following are possible:

System A having low THD and low IMD.

System B having low THD and high IMD. It adds differences tones but not harmonics.

System C having high THD and low IMD. It adds harmonics but not difference tones.

System D having high THD and high IMD. It adds both harmonics & difference tones.

It's easy to agree that A is better than D. The question is about B and C, how to compare them in a meaningful way. What exactly is "low" or "high"? Express in absolute terms, or in terms of their audibility or psychoacoustical impact?

#### scott wurcer

##### Major Contributor
Audio Luminary
Technical Expert
System B having low THD and high IMD. It adds differences tones but not harmonics.

System C having high THD and low IMD. It adds harmonics but not difference tones.

You would need to produce examples of these before making this statement.

OP

#### DonH56

##### Master Contributor
Technical Expert
Forum Donor
True... however, the following are possible:

System A having low THD and low IMD.

System B having low THD and high IMD. It adds differences tones but not harmonics.

System C having high THD and low IMD. It adds harmonics but not difference tones.

System D having high THD and high IMD. It adds both harmonics & difference tones.

It's easy to agree that A is better than D. The question is about B and C, how to compare them in a meaningful way. What exactly is "low" or "high"? Express in absolute terms, or in terms of their audibility or psychoacoustical impact?

THD and IMD are mathematically (and physically) related. I don't know how you'd separate IMD from THD. The relationship is easy to prove if a bit tedious, just set up sine waves with x^2 and x^3 terms and work through all the trig identities. I have not hand-calculated it for higher than 5th order, and have a vague memory that the only easy closed-form solution was for third order distortion, but that was long, long ago. (Scott can probably do it in his sleep; for me, doing it again would put me to sleep ). Working through it, IMD2 is about 6 dB higher than THD2 for the same input amplitude, and IMD3 is about 9.5 dB higher than THD3.

I have helped design special circuits to suppress IMD in the RF world but not audio. They relied on double-balanced mixers and some clever feedback. It worked in the lab, but was too "touchy" for practical real-world use, at least back then (1980's).

#### MRC01

##### Major Contributor
THD and IMD are mathematically (and physically) related. I don't know how you'd separate IMD from THD. The relationship is easy to prove if a bit tedious, just set up sine waves with x^2 and x^3 terms and work through all the trig identities. ...
IIRC (I could be wrong), the transfer function coefficients contribute non-equally to HD and IMD, so I believe you can manipulate the coefficients to get what you want. For example, 2nd harmonic doesn't contribute to IMD as much as 3rd harmonic does. So system B could be all 3rd harmonic, which would have low THD but high IMD, and system C could be all 2nd harmonic which could high THD with low IMD.
Anyway, that's the idea I had in mind.

BTW, isn't an observed fact that we do see in measurements, equipment or other devices having varying levels of HD and IMD? That is, the ratio of HD to IMD is not constant. Different non-linear transfer functions have different ratios of HD and IMD.

OP

#### DonH56

##### Master Contributor
Technical Expert
Forum Donor
IIRC (I could be wrong), the transfer function coefficients contribute non-equally to HD and IMD, so I believe you can manipulate the coefficients to get what you want. For example, 2nd harmonic doesn't contribute to IMD as much as 3rd harmonic does. So system B could be all 3rd harmonic, which would have low THD but high IMD, and system C could be all 2nd harmonic which could high THD with low IMD.
Anyway, that's the idea I had in mind.

Not the math I have seen. I thought I had presented someplace but couldn't find it with a quick search. I have it in an old notebook; not hard, just have to grunge through it. All third harmonic would lead to third-order IMD with no second-order terms, and of course second-order HD would create only second-order IMD terms. There is some debate in which is worse; IMD3 creates tones close to the two fundamental tones so is usually worse than IMD2 tones that appear near DC and at twice the fundamentals, but if the two fundamental tones are very close they may be masked by our hearing.

BTW, isn't an observed fact that we do see in measurements, equipment or other devices having varying levels of HD and IMD? That is, the ratio of HD to IMD is not constant. Different non-linear transfer functions have different ratios of HD and IMD.

Hmmm... Generally not in my experience (which certainly does not cover everything). The times they did not track, it was related to bandwidth rolling off higher-order higher-frequency terms. I suppose it depends upon what sort of transfer function you can create (assuming it matches reality -- easy to create one that is not realizable by a physical circuit).

<Pause>

I actually have a copy of my old notes, from when I derived the terms way back then (and most certainly it was done many decades before I did it!) Since you asked for it, and bearing in mind I may have made copy mistakes from my old hand-written notes:

Let Vout = a + b*Vin + c*Vin^2 + d*Vin^3 where Vin = A*cos(w1*t) + B*cos(w2*t) -- stupid of me to use lower- and upper-case A/B but oh well...
Note w1 and w2 are the two input tones, in rad/s, so w1 = 2*pi*f1 and w2 + 2*pi*f2 where f1 and f2 are in Hz.

Plug in and grind through it using a few (three) trig identities:
cos^2(x) = 1/2(cos(2x) + 1); cosx*cosy = 1/2*[cos(x+y) + cos(x-y)]; cos^3(x) = 1/4*(cos(3x) + 3cosx)

At the end of a page or two of algebra and trig identity swapping you (or I, anyway) get for output Vout = four terms:
• a = DC term
• b*Vin = b[Acos(w1*t) + Bcos(w2*t)] <linear term>
• c*Vin^2 =
• 1/2*c*(A^2 + B^2) <dc>
• + 1/2*c*[A^2*cos(2*w1*t) + B^2*cos(2*w2*t)] <2HD>
• + c*A*B*[cos((w1+w2)*t) + cos((w1-w2)*t)] <2IMD>
• d*Vin^3 =
• 3/2*d*[(1/2*A^3 + A*B^2)cos(w1*t) + (A^2*B + 1/2*B^3)cos(w2*t)] <fundamental terms, typically phase-shifted>
• + 3/4*d*{A*B^2*[cos((w1+2*w2)*t) + cos((w1-2*w2)*t)] + A^2*B*[cos((2*w1+w2)*t) + cos((2*w1-w2)*t)]} <3IMD>
• + 1/4*d*[A^3*cos(3*w1*t) + B^3*cos(3*w2*t)] <3HD>
Now look at the distortion terms:
• 2nd-order distortion gives 2HD at 2*f1 and 2*f2; 2IMD at f1+f2 and f1-f2; and a DC term
• 3rd-order distortion gives additional fundamental energy at f1 and f2; 3HD at 3*f1 and 3*f2; and, 3IMD at f1+/-2f2 and 2f1+/-f2
Looking at the amplitudes, 2IMD will be 6.021 dB higher than 2HD, and 3IMD will be 9.542 dB higher than the 3HD, tracking with input and distortion terms. You can design circuits to suppress even harmonics, for example, and even-order IMD products will fall correspondingly, but according to the formulae. Of course, if distortion does not behave classically, anything goes.

I may have a made a mistake, but it matches classical amplifier design theory and practice (measurements), which was my goal at the time since I was designing high-speed amplifiers and such. I had measured the relationships empirically and my mentor wisely challenged me to prove it in theory. There were deviations, but they fairly were minor and ultimately explainable (by math a lot worse than this and I have no desire to dredge that up!).

My eyes are glazing, HTH - Don

#### MRC01

##### Major Contributor
...
Now look at the distortion terms:
• 2nd-order distortion gives 2HD at 2*f1 and 2*f2; 2IMD at f1+f2 and f1-f2; and a DC term
• 3rd-order distortion gives additional fundamental energy at f1 and f2; 3HD at 3*f1 and 3*f2; and, 3IMD at f1+/-2f2 and 2f1+/-f2
Looking at the amplitudes, 2IMD will be 6.021 dB higher than 2HD, and 3IMD will be 9.542 dB higher than the 3HD, tracking with input and distortion terms. ...
I didn't remember the math details but that idea is what I had in mind. With 2nd order, IMD ratio to HD is 6 dB but with 3rd order, IMD ratio to HD is 9.5 dB. So devices with only 2nd order HD have a different relative level of IMD to HD, than devices with 3rd order HD. More generally, different coefficients give different ratios of HD to IMD. So the ratio or amount of HD to IMD varies, depending on the coefficients of the device transfer function. For a given device & its transfer function, the ratio is the same. But different devices have different transfer functions, which can have different ratios.

#### JohnYang1997

##### Master Contributor
Technical Expert
Manufacturer
Possible to have low THD at full scale 1khz and high IMD. But I don't think high THD with low IMD is possible.

OP

#### DonH56

##### Master Contributor
Technical Expert
Forum Donor
I didn't remember the math details but that idea is what I had in mind. With 2nd order, IMD ratio to HD is 6 dB but with 3rd order, IMD ratio to HD is 9.5 dB. So devices with only 2nd order HD have a different relative level of IMD to HD, than devices with 3rd order HD. More generally, different coefficients give different ratios of HD to IMD. So the ratio or amount of HD to IMD varies, depending on the coefficients of the device transfer function. For a given device & its transfer function, the ratio is the same. But different devices have different transfer functions, which can have different ratios.

I think you have it, but I am stumbling a bit on the ratios, probably poor comprehension on my part.

The ratio of HD to IMD for each term (order) will be the same no matter the absolute value. That is, whether 2HD is 0.1% or 1%, the 2IMD will be 6 dB higher (and similarly 3IMD will be 9.5 dB higher than 3HD relative to whatever 3HD is for the device at any given signal level and frequency). But yes if 2HD is lower on one device compared to another, then 2IMD will also be lower by the same amount, and the same for 3HD/3IMD.

The ratio of HD to IMD will not change for a given order, e.g. 2nd, 3rd, etc., but the ratio of 2HD to 3HD (and thus 2IMD to 3IMD) is dependent upon the device.

Hopefully we're together... - Don

#### MRC01

##### Major Contributor
... The ratio of HD to IMD for each term (order) will be the same no matter the absolute value. That is, whether 2HD is 0.1% or 1%, the 2IMD will be 6 dB higher (and similarly 3IMD will be 9.5 dB higher than 3HD relative to whatever 3HD is for the device at any given signal level and frequency). But yes if 2HD is lower on one device compared to another, then 2IMD will also be lower by the same amount, and the same for 3HD/3IMD.
...
Exactly. So if device A has THD that consists entirely of 2H, and device B has THD that consists entirely of 3H, and if A and B have the same THD, then B has higher IMD. In this case A and B have different ratios of HD to IMD. More generally, how much total IMD you get for any level of THD, depends on the coefficients of the transfer function, or the magnitudes of the individual HD components.

#### Wes

##### Major Contributor
Forum Donor
BTW, where's TIM?

anybody seen him recently?

OP

#### DonH56

##### Master Contributor
Technical Expert
Forum Donor
BTW, where's TIM?

anybody seen him recently?

There was a thread on that earlier; it is not appropriate for this thread. Short story is it is a solved problem unless the component is badly designed. Loop gain-bandwidth products are much greater and slew-induced distortion has been addressed for many years. That said it might make an interesting article. Maybe when I retire, in about 247 years...

#### MRC01

##### Major Contributor
I've read that some people perceive 2H and 3H differently, when they exist at the same level. As 2H and 3H have different IMD profiles (frequencies & amplitudes relative to the harmonics), I wonder whether the difference people perceive is due to the harmonics, or to the different IMD profile.

#### Holmz

##### Active Member
THD and IMD are mathematically (and physically) related...

If we were to ignore pure math, then if we understood the physical things happening, one should be able to linearise the system so as to remove the majority of IMD/HD.

#### pozz

##### Data Ordinator
Forum Donor
Editor
IMD is what THD looks like with multiple tones. I don't know why they are treated as being intrinsically different, when all that's changed is the input signal.

Replies
311
Views
10K
Replies
4
Views
2K
Replies
52
Views
5K
Replies
26
Views
3K
Replies
10
Views
765