• 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). There are daily reviews of audio hardware and expert members to help answer your questions. Click here to have your audio equipment measured for free!

THD and IMD Measurement: Do they represent the actual nonlinear distortion?

OP
Pinox67

Pinox67

Member
Editor
Joined
Apr 8, 2020
Messages
70
Likes
144
Location
Italy
Only in pathological cases, which is what your examples are all about. When comparing two amplifiers, one decent and one pathological, the difference you reported is totally irrelevant, since the standard THD values are already two orders of magnitude (or more) apart. It's called "engineering", you know; engineers know when to ignore second order effects.

If there are substantial differences in values, yes, I agree, this discrepancy is second-rate.

But if the THD and/or IMD values of two amplifiers are comparable, let's say they differ by less than 10dB, you can't tell if in fact one is better than the other if you don't know the order of the distortions that caused them, since the mistake you make depends on them. In other words, a classification based on THD or IMD loses some meaning. Even the SINAD, which should take into account all the different energy components, is missing pieces.
Anyway, these numbers are not the most important aspects to me: it is much more interesting to observe the distribution of energy among the harmonics to understand the sound quality of a device.
 
Last edited:

lashto

Addicted to Fun and Learning
Forum Donor
Joined
Mar 8, 2019
Messages
705
Likes
369
Why should a component at the same frequency as the input be considered a distortion?
If it was not there to start with, then it's distortion. And it's also HD because technically it's the first harmonic. I'd say that's more than enough reason to put it in the THD formula.

Or just create a new formula and call it TrueHD/FullHD/whatever. If you manage to convince amirn to add it to the standard measurements @Pinox67, you have all my upvotes. Which is a grand total of one :)
With the "classic" THD in the -120Db area, that measurement is becoming even more meaningless. We surely need some innovation in the measurements area. The new stuff might just be too good for 1950 metrics (or whenever that measurement was created).
 
OP
Pinox67

Pinox67

Member
Editor
Joined
Apr 8, 2020
Messages
70
Likes
144
Location
Italy
If it was not there to start with, then it's distortion. And it's also HD because technically it's the first harmonic. I'd say that's more than enough reason to put it in the THD formula.

Or just create a new formula and call it TrueHD/FullHD/whatever. If you manage to convince amirn to add it to the standard measurements @Pinox67, you have all my upvotes. Which is a grand total of one :)

The main problem is that in the measurements the new harmonics are compared with the fundamental harmonics of the output signal from the device, not with those of the input signal, which can be at a different level. So, from the measurements you can't detect HD1 directly. I have suggested a method in the post#23 to derive HD1 indirectly for memoryless systems; it should be extended to more general cases of memory systems, much more complex...

With the "classic" THD in the -120Db area, that measurement is becoming even more meaningless. We surely need some innovation in the measurements area.

Yes, with very low THD/IMD values, the listening effects of a few more dB are not relevant. It should only be taken into account in the comparisons between different devices that each value has a modest margin of uncertainty.

The new stuff might just be too good for 1950 metrics (or whenever that measurement was created).

If you have read the thread already given, I am carrying out studies on the effects of non-linear distortions on transients, therefore on the signal in the time-domain, a field that I think is a bit neglected. I have defined new statistical indicators that could be useful in explaining some effects on perception. Work in progress…
 
Last edited:

lashto

Addicted to Fun and Learning
Forum Donor
Joined
Mar 8, 2019
Messages
705
Likes
369
If you have already read the thread already given, I am carrying out studies on the effects of non-linear distortions on transients, therefore on the signal in the time-domain, an aspect that I think is a bit neglected. I have defined some statistical indicators that could be useful in explaining some effects on perception. Work in progress…
Yes I did read your posts, very interesting stuff IMO. I am not an EE and my math is too rusty to fully understand what you do. But even so, it looks to me that you are going the right direction. So good luck and godspeed with your experiments!
 

mansr

Major Contributor
Joined
Oct 5, 2018
Messages
4,688
Likes
10,535
Location
Hampshire
If it was not there to start with, then it's distortion. And it's also HD because technically it's the first harmonic. I'd say that's more than enough reason to put it in the THD formula.
How do you differentiate this "first harmonic distortion" from gain/attenuation? Why should it matter?
 
OP
Pinox67

Pinox67

Member
Editor
Joined
Apr 8, 2020
Messages
70
Likes
144
Location
Italy
In my studies I have developed models of the most general case of non-linear systems with memory effects. Won by curiosity, I have also obtained some graphs on the trend of the THD and the IMD even for these more general cases, deriving so a method to indirectly estimate HD1 in the case of real devices.​

THD and IMD calculation in dynamic nonlinear systems

We broaden the previous study by addressing the more general case of dynamic nonlinear systems, i.e. with memory effects. These systems are able to simulate both linear effects (alterations of magnitude and phase of the frequency response) and nonlinear ones, i.e. the appearance of new harmonics and related intermodulation products generated by the non-linear interactions of the tones present in the signal source. Here they differ from static nonlinear systems in that in the latter the new tones depend in magnitude and phase on the frequency, while in the former they are constant for all predefined frequencies and phases. "black-box" models such as that of Volterra-Hammerstein allow us to well describe their behavior when the nonlinear effects are small (< 1%), therefore close to the reality of good audio amplifiers.

Briefly, the system is modeled as the sum of input signal processing by n streams. Each one models the contributions of i-order distortion, and is composed of two cascading parts. The first is constituted by the application of a function (always a polynomial of degree i) to the signal that models the non-linear part; the second part instead models the memory effects through a "classic" linear time-invariant (LTI) system. The diagram, limited for simplicity to the modeling of the 2nd and 3rd harmonic only, is as follows:
fig 6 - Hamm Model.png

Fig. 6 – Hammerstein-Volterra model, for 2nd and 3rd order distortions.

The output y(t) relative to the input x(t) can be calculated using the following formula:
cap1.png

Where '*' represents the convolution operation and the hi(t) functions represent the Kernel, with the following meaning:
  • h1(t): impulsive response of the system, dual of the classical frequency response H1(f) of the system.
  • h2(t), h3(t): impulsive responses respectively relating to the 2nd and 3rd order distortion associated with the relative harmonics.
To focus on the main aspects in the following simulations H1(f) is chosen so that it is unitary on all frequencies, while h2(t) and h3(t) are calculated to create the 2nd and 3rd harmonic distortions with the desired magnitude and phase values, constant over the entire frequency band. This is representative of real amplifiers with wide bandwidth and constant distortion in the audio band (not unusual).

With these hypotheses we study what happens to the HD1 component, "hidden" in the original signal, when HD3 changes the phase, from -180 to +180 degrees, for a single tone. The graph shows:​
  • In blue: ratio between HD1 and HD3, the latter fixed at -60dB, but the curve is independent of its absolute value. For 0 and 180 degrees of HD3, typical of a memory-less system, we have a difference of 9.54dB, as already seen. For the other intermediate values the ratio decreases, with a minimum at 0dB for -90 and +90 degrees. Hence, HD1 never disappears.
  • In orange: HD1 phase compared to fundamental. For 0 and 180 degrees we have that HD1 is respectively in out of phase and in phase with respect to the fundamental. For other values there is a gradual transition between the two values, with more significant variations around ±90 degrees. This therefore implies mixed compressive and expansive effects on the signal.
fig 7 - Dist 2-3 Hamm.png

Fig. 7 – HD1/HD3 magnitude ratio and phase of HD1 for a single tone at 1KHz, HD3 = -60dB, depending on its phase.
We observe that:
  • As the phase varies, the fundamental will undergo changes in amplitude and phase by the HD1. Carrying out some calculations, assuming a high value such as 1% (-40dB) for the HD3, these variations have a range for magnitude of ±0.25dB, while the low frequency group delay has a range of ±0.5ms (close to the limit of audibility); for 0.1% (-60dB) for the HD3, they are reduced by 10 times and so on.
  • The frequency of the tone is irrelevant since the phase of the distortion is independent of it. If this depends on it, we will also have HD1 variable with the frequency and therefore, in the presence of complex signals, each of the component tones will be altered in amplitude and phase by different values (similar to those of the previous point), although the level of the 3rd harmonic is constant over the entire audio band.
The trend of HD1 shown in fig. 7 can be used to "correct" the calculation of the THD, by including it in the denominator of its classical expression. The following figure shows the classic THD value in red, always equal to -60dB (= HD3) and the True-THD value in green, which takes HD1 into account.​

fig 8 - THD Hamm.png

Fig. 8 – Legacy-THD and True-THD for a single tone at 1KHz, HD3=-60dB, depending on its phase.

It is evident that THD is underestimated, for values ranging between about 10dB (for HD3 phases of 0 and 180 degrees) and 3dB (for phases ±90 degrees). Again, these differences do not depend on the absolute HD3 level: the graph only translates vertically. The THD values are calculated on the signal in the time domain rather than the frequency domain (by Parseval's theorem, the methods are equivalent).

Let's now analyze what happens when the 2nd order distortion also appears, which generates as an additional component only the DC. The following graph shows the ratio between True-THD and THD where a dimension is added that identifies the level of the 2nd harmonic with respect to the 3rd.​

fig 9 - THD 3d.png

Fig. 9 – Ratio between True-THD and classic THD for a 1KHz tone, depending on the HD3 phase and the ratio of HD2 and HD3 levels.

As long as 2nd harmonic prevails in the front of the graph, with HD2/HD3 = 50dB, there is no difference in THD for any phase value of HD3. When HD3 grows, and is about 32dB lower than HD2, the difference between THDs begins to be felt, and then settles on the curve of fig. 8 around HD2/HD3 ratios of -23dB. To add that the graph is independent of the phase of the 2nd harmonic.

The trend is also similar for the IMD. The following graph shows the ratio between True-IMD and the classic one in the CCIF Test (2 tones at 19KHz and 20KHz at the same level), depending on the same variables. The maximum and minimum discrepancies are 5.6dB and 2.0dB respectively.​

fig 10 - IMD 3d.png

Fig. 10 – Ratio between True-IMD and classic IMD for CCIF Test, depending on the HD3 phase and the ratio of HD2 and HD3 levels.

Therefore, even in the more general case of dynamic nonlinear systems, the contributions of the 3rd order distortion to the fundamental subsist, resulting in not exactly small variable errors in the THD or in the IMD as a measure of the extent of the overall distortions introduced by the non-linearities of a system. These errors are negligible as long as HD3 is absent or in any case lower than at least 10dB at the 2nd harmonic. Strictly speaking, even the odd orders higher than the 3rd can contribute to the fundamental, increasing the discrepancy. As usually happens in good amplifiers, they are much more modest than the 2nd and 3rd harmonics, and therefore their contribution is negligible. In this situation, common for an amplifier, by measuring only the magnitude and phase of the 2nd and 3rd harmonic distortions, it is possible to easily estimate the entity of HD1 and therefore of the correction to be made to the calculation of the THD or to the specific IMD test type.​
 
Last edited:

kongwee

Addicted to Fun and Learning
Joined
Jan 22, 2022
Messages
732
Likes
189
More interest how non linear harmonic distortion occur in the real world transistors.
 

syn08

Senior Member
Joined
Aug 9, 2019
Messages
307
Likes
372
Location
Toronto, Canada
In my studies I have developed models of the most general case of systems with memory effects. Won by curiosity, I have also obtained some graphs on the trend of the THD and the IMD even for these more general cases, summarized below.​

THD and IMD in systems with memory

In general, even systems with memory, when stimulated by a single tone, create multiple harmonics in their output. Unlike the memory-less system, here the harmonics also depend on frequency, level and with any phase. ‘Black-box’ models such as Volterra-Hammerstein allows us to describe their behavior well when the non-linear effects are small (< 1%). In short, the system is modeled as the sum of the input signal processing by n streams. Each shapes the contribution of the distortion of order i, and is composed of two parts. The first consists of a polynomial of degree i, which models precisely the non-linear part; the second part instead shapes the memory effects through a ‘classic’ linear time-invariant (LTI) system. The scheme, limited for simplicity to the modeling of only 2nd and 3rd harmonics, is as follows:
View attachment 245156
Fig. 6 – Hammerstein-Volterra model, for 2nd and 3rd order distortions.

From a computational point of view it is convenient to use the in the frequency domain, where the expression of the output Y(f) can be written as follows:​


The Hi(f) transfer functions represent the Kernel, with the following meaning:​
  • H1(f): ‘classic’ frequency response of the system.
  • H2(f), H3(f): system frequency responses attributable to the only effects of 2nd and 3rd order distortion.
To focus on the main aspects in subsequent simulations H1(f) is chosen so that it is unitary on all frequencies, while H2(f) and H3(f) are calculated so as to return in output the desired module and phase values of the 2nd and 3rd harmonic, constants throughout the frequency band.

With these hypotheses we study what happens to the HD1 component, “hidden” in the original signal, when HD3 changes the phase, from -180 to 180 degrees, for a single tone. The level of HD3 is constant at -60dB, but even here the graph is invariant with respect to the absolute values of the distortions.​

View attachment 245157
Fig. 7 – HD1/HD3 magnitude ratio and phase of HD1 for a single tone at 1KHz, HD3 = -60dB, depending on its phase.
The graph shows:
  • In blue: ratio between HD1 and HD3. For 0 and 180 degrees of HD3, typical of a memory-less system, we have a difference of 9.54dB, as already seen. For the other intermediate values the ratio decreases, with a minimum at 0dB for -90 and +90 degrees. Hence, HD1 never disappears.
  • In orange: HD1 phase compared to fundamental. For 0 and 180 degrees we have that HD1 is respectively in out of phase and in phase with respect to the fundamental. For other values there is a gradual transition between the two values, with more significant variations around +/-90 degrees. This therefore implies mixed compressive and expansive effects on the signal.
These trends determine the THD calculation "errors" shown in the following figure.​

View attachment 245160
Fig. 8 – Legacy-THD and True-THD for a single tone at 1KHz, HD3=-60dB, depending on its phase.

In red the value of the classic THD, always equal to -60dB (= HD3). In green the value of the True-THD that also takes into account HD1. It is evident that THD is underestimated, for values ranging between about 10dB (for HD3 phases of 0 and 180 degrees) and 3dB (for phases +/-90 degrees). Both THD values are calculated on the signal in the time domain instead of the frequency.

Let's now analyze what happens when the 2nd order distortion also appears, which generates as an additional component only the DC, which is always overlooked. The following graph shows the difference between True-THD and THD where a dimension is added that identifies the level of the 2nd harmonic with respect to the 3rd.​

View attachment 245183
Fig. 9 – Ratio between True-THD and classic THD for a 1KHz tone, depending on the HD3 phase and the ratio of HD2 and HD3 levels.

As long as 2nd harmonic prevails in the front of the graph, with HD2/HD3 = 50dB, there is no difference in THD for any phase value of HD3. When HD3 grows, and is about 32dB lower than HD2, the difference between THDs begins to be felt, and then settles on the curve of fig. 8 around HD2/HD3 ratios of -23dB. To add that the graph is independent of the phase of the 2nd harmonic.

The trend is also similar for the IMD. The following graph shows the difference between True-IMD and the classic one in the CCIF Test (2 tones at 19KHz and 20KHz at the same level), depending on the same variables. The principal difference is in the discrepancies in the presence of the 3rd harmonic, reduced in the maximum and minimum values to 5.6dB and 2.0dB respectively.​

View attachment 245184
Fig. 10 – Ratio between True-IMD and classic IMD for CCIF Test, depending on the HD3 phase and the ratio of HD2 and HD3 levels.

Therefore, even in the more general case, the contributions of the 3rd order distortion to the fundamental subsist, resulting in not exactly small variable errors in the THD and in the IMD as a measure of the extent of the overall distortions introduced by the non-linearities of a system. These errors are negligible as long as HD3 is absent or at least 10dB lower than the 2nd harmonic. Strictly speaking, even odd orders higher than the 3rd can make contributions to the fundamental, increasing the discrepancy. As is generally the case in good amplifiers, they are of a much lower level than the 2nd and 3rd harmonics, and therefore of negligible effect.​

Again, not sure what you are trying to show here; a memoryless system (also called static system) has the output at any time depending only on the value of the input at the same time. A continuous time system is memory less if its unit impulse response h(t) is zero for t≠0. These memory less LTI systems are characterized by y (t) =Kx (t) where K is constant.

A system with memory (also called dynamic system) has the output at any time depending on the value of the input and the value(s) on previous time(s) (not discussing causality here). Perhaps one of the simplest dynamic system in electronics is an integrator; dynamic systems necessary have an energy storage device embedded (e.g. a capacitor).

Assuming causality, there is virtually no difference in mathematically handling static or dynamic systems. I can barely think of a pure static system in electronics, though, and I am not aware of any special handling requirement for these. Separating the transfer function in a linear part and a small perturbation representing the nonlinearities up to a certain order is a standard approach in circuit analysis; you appear to be back to a previous posting, where you now consider the phase of a harmonic component as having an impact on the fundamental and other harmonic components. While this is strictly mathematically true, what I said above in #38 and #40 still holds. Pathological cases are not of much interest in audio electronics, and, if you don't like the THD metric, then don't use it and propose another synthetic indicator.

But if you are trying to write some sort of academic dissertation, then you are on the right track, although I see little original results here.
 
OP
Pinox67

Pinox67

Member
Editor
Joined
Apr 8, 2020
Messages
70
Likes
144
Location
Italy
More interest how non linear harmonic distortion occur in the real world transistors.

Transistors have an exponential transfer function. In one section of this post I looked at what happens in these cases. It must be said that the resulting distortions heavily depend on the type of circuit in which the active elements are inserted so that, for a "black-box" modeling, one can only study the trend of the distortions. Typically, in good amplifiers of any kind, low-order ones are always predominant, with the effects just discussed.
 
Last edited:
OP
Pinox67

Pinox67

Member
Editor
Joined
Apr 8, 2020
Messages
70
Likes
144
Location
Italy
Again, not sure what you are trying to show here; a memoryless system (also called static system) has the output at any time depending only on the value of the input at the same time. A continuous time system is memory less if its unit impulse response h(t) is zero for t≠0. These memory less LTI systems are characterized by y (t) =Kx (t) where K is constant.

A system with memory (also called dynamic system) has the output at any time depending on the value of the input and the value(s) on previous time(s) (not discussing causality here). Perhaps one of the simplest dynamic system in electronics is an integrator; dynamic systems necessary have an energy storage device embedded (e.g. a capacitor).

Assuming causality, there is virtually no difference in mathematically handling static or dynamic systems. I can barely think of a pure static system in electronics, though, and I am not aware of any special handling requirement for these. Separating the transfer function in a linear part and a small perturbation representing the nonlinearities up to a certain order is a standard approach in circuit analysis; you appear to be back to a previous posting, where you now consider the phase of a harmonic component as having an impact on the fundamental and other harmonic components. While this is strictly mathematically true, what I said above in #38 and #40 still holds. Pathological cases are not of much interest in audio electronics, and, if you don't like the THD metric, then don't use it and propose another synthetic indicator.

But if you are trying to write some sort of academic dissertation, then you are on the right track, although I see little original results here.

Thanks for the detailed integration to the description of static and dynamic systems, I appreciate your accuracy. I updated the nomenclature in the post for more clarity.

The model described in the post is certainly not original, it is widely used to model non-linear systems with memory and for this reason it is also a guarantee that it represents our reality of interest well. The part that I have not found described in other texts and therefore original is related to the effects of non-linear distortions on the tones of the source signal (HD1), neglected as they are hidden in the source tones themselves.

I resorted to this model because more than one person pointed out to me (but I also noticed it in my measurements) that it doesn't often happen that an amplifier behaves as expected by the nonlinear static model of the initial post. I mean that the distortions do not occur, even if they are constant in magnitude in the audio band, with phases equal to the +/-90 values for the 2nd harmonic and 0/180 for the 3rd. This means that the static model is not sufficient, and the introduction of memory effects are able to relax all these constraints.

In the last post, I therefore explored what happens in more general cases to HD1 and hence the way in which it can be estimated from the classic distortion measurements for a pure tone. Thus, there is only the intention to extend the study described in the first post valid for few classes of systems to broader classes that better describe the behavior of real amplifiers. If then all this will give rise to a correction of the THD and IMD (or to a new indicator), I am certainly not the one to decide; surely those who use these indicators will certainly have the elements to understand if and how much they leave out, in order to be able to correctly compare systems with THD and IMD values close to each other.
 
Last edited:
Top Bottom