As part of a study of the effects of non-linear distortions in amplifiers, I came across an aspect that left me a little perplexed. This is the way in which the THD value (and also the IMD) of the data collected by the standard measurements is calculated.

*THD and IMD calculation in static nonlinear systems*

*THD and IMD calculation in static nonlinear systems*

To introduce the discussion, let's start by summarizing what THD is: it represents the measure of harmonic distortion present in a signal. This indicator is calculated as the ratio between the sum of the RMS values of all the harmonic components of the distortion and the RMS value of the fundamental frequency. For the IMD, the RMS value of all the intermodulation products is considered in relation to the RMS value of all the test tones used. All audio enthusiasts are well aware that these indicators provide us with an indication of the extent of the non-linear distortions injected by an audio device (and therefore of the fidelity in music reproduction) when it is stimulated with specific sample signals. In practice, to measure the THD, a pure tone is introduced into the device under test, generally a sinusoid at 1KHz, and the level of the harmonics generated at 2KHz, 3KHz, etc. is detected in the output signal. The THD is then obtained using the classic formula:

Where

But let's take a step back to identify the cause of the nonlinear distortion. This is due to the non-constancy of the

If we want to simulate a system that has 2nd and 3rd harmonic distortions, the transfer function

*Vi*is the peak level or the RMS value of the*i*-th harmonic and*V*1 that of the fundamental. The measurement of the IMD is similar: several tones are used, usually a couple, and all the intermodulation products are detected, i.e. all the harmonic components resulting from the non-linear interaction of the tones in the source signal, created at frequencies identified by their linear combination.But let's take a step back to identify the cause of the nonlinear distortion. This is due to the non-constancy of the

*g*gain of the device for each level of the input signal. In other words, the input/output transfer curve*f*(*x*) of our device is not represented by a straight line (of slope*g*) in the working interval but has "imperfections". If we model this curve and calculate the output values for each value of the input signal we will be able to numerically simulate the behavior of our device for any signal. This is a simplified approach, capable of modeling only certain classes of nonlinear systems given the instantaneous dependence of the output on the input, i.e. the absence of "memory effects" (also called**static**model), but it is sufficient for the considerations that follow.If we want to simulate a system that has 2nd and 3rd harmonic distortions, the transfer function

*f*(*x*) can be modeled by a third degree polynomial:In fact, by inserting a sinusoidal

*x*(*t*) signal in this polynomial and carrying out the appropriate trigonometric transformations, we will have that the different addends control:*a*0: component in DC, normally null.*a*1*x*: amplification (of gain g) of the fundamental component (i.e. H1).*a*2*x*²: 2nd order distortion, consisting of two components:- 2nd harmonic (HD2), out of phase by +90 or -90 degrees;
- DC, of the same entity as HD2.

*a*3*x*³: 3rd order distortion, consisting of two components:- 3rd harmonic (HD3), 0 or 180 degrees out of phase;
- contribution to the fundamental component (HD1), about 10dB (9.54dB) higher than HD3.

Therefore, it is appropriate to distinguish the distortion of order

*i,*due to the*i*-th power addition of the transfer function, from the harmonic component of order*i*. To better establish the concepts, let's make an example. The following figure shows:- Transfer function (left), relating to a mixed distortion of 2nd and 3rd order, with HD2 = -70dB and HD3 = -60dB, having a phase of 90 and 0 degrees respectively; the gain
*g*is unity. - Distortion undergone by a single tone (right): in blue the resulting curve, where a “compressive” effect can be seen, and in red the isolated distortion component.

In both graphs the curves are amplified by 40 times to better show the shape of the distortion. As explained above on the transfer function, the distortion curve in red is here composed of four harmonics: HD2 + DC, due to 2nd order distortion, and HD1 + HD3, due to 3rd order distortion.

*Fig. 1 - Transfer function (left) and distortion on a single tone (right).*

In the common calculation of the THD in the numerator here are considered only the values of HD2 and HD3, determining a value of -59.6dB, and the DC and HD1 are omitted. Now, if the DC component can be neglected, since it does not reach our speakers due to the decoupling capacitors between the electronic devices that block it, the same discourse is not applicable to the HD1 component, which instead crosses the entire audio chain downstream, and it is mainly responsible in this case for the compressive effect on the signal. Therefore, the THD value calculated in this way is not really representative of the entity of the distortion related to the red curve shown in the previous figure (actually, it is relative to the curve in green), although the definition of THD speaks of "all" harmonic distortion components, and not only "new". If HD1 were included in the calculation, we will have a THD of -50dB, almost 10dB higher!

Let's investigate the phenomenon better by verifying what happens for different mixes of distortion.

Let's investigate the phenomenon better by verifying what happens for different mixes of distortion.

*
*

Fig. 2 - HD, “True-THD”, THD [dB] for more ratio of 3rd/2nd harmonic.

Fig. 2 - HD, “True-THD”, THD [dB] for more ratio of 3rd/2nd harmonic.

The figure illustrates the trend of distortions in dB as a function of the ratio between the levels of the 3rd and 2nd harmonic, with the latter set at -90dB. The red curve relates to the 2nd harmonic (HD2), constant, while the light blue curve shows the value of the 3rd harmonic (HD3), increasing. The resulting THD value for these 2 harmonics for each value of their ratio is represented by the dashed purple curve. Including in the calculation also HD1, shown in blue (parallel to HD3 and 10dB higher), we will have the “True-THD” curve shown in purple. This coincides with the “classic” THD value as long as the distortion is mainly 2nd order, while it is higher up to 10dB when 3rd order prevails; moreover, it begins to grow much earlier.

Figure 2b shows what happens if we observe the same quantities as a function of the input signal level for the transfer curve in Figure 1. Hence, HD2 = -70dB and HD3 = -60dB. The reference here is H1; if instead we considered H1+HD1 as a reference we would not have any “visible” impact in the curves.

Figure 2b shows what happens if we observe the same quantities as a function of the input signal level for the transfer curve in Figure 1. Hence, HD2 = -70dB and HD3 = -60dB. The reference here is H1; if instead we considered H1+HD1 as a reference we would not have any “visible” impact in the curves.

*Fig. 2b - HD, “True-THD”, THD for input levels from -60dB to 0dB.*

From the figure it is evident that the classic THD coincides with the True-THD for low input values, below -30dB; for higher levels the True-THD deviates up to 10dB, as in the previous graph. This is due to the fact that the effect of 3rd order distortion (and therefore both HD1 and HD3) at low levels is not felt very much, since it depends on the cube of the signal level, leaving "the field" at the 2nd order (HD2) which depends on the square of the signal level. It should be added that by increasing or decreasing the HD2 and HD3 values by the same amount (in dB), all curves translate respectively upwards or downwards. Therefore, the discrepancies between the classic THD and the True-THD depend on the relationships between the harmonics, not on the absolute values.

From what has been described it follows that not considering the harmonic HD1 in the calculation of the THD distorts its "representativeness" as an indicator for the overall amount of distortion suffered by the signal when the 3rd harmonic appears. More generally, we can say that it is not correct to compare THD values close to each other when the harmonics involved in its determination are of a different nature, i.e. mainly of even or odd order: there is a risk of committing gross errors of evaluation, since not considering HD1 can lead to differences of 10dB.

The situation is analogous when we increase the number of test tones, where their intermodulation products appear. To get an idea, the following graph shows the simulation of the distortion suffered by a signal composed of 8 equally spaced tones in frequency from 5KHz to 12KHz, level at -18dB, when it passes through a system with only 2nd order distortion (HD2 = -60dB) and another with only 3rd order (HD3 = -60dB).

From what has been described it follows that not considering the harmonic HD1 in the calculation of the THD distorts its "representativeness" as an indicator for the overall amount of distortion suffered by the signal when the 3rd harmonic appears. More generally, we can say that it is not correct to compare THD values close to each other when the harmonics involved in its determination are of a different nature, i.e. mainly of even or odd order: there is a risk of committing gross errors of evaluation, since not considering HD1 can lead to differences of 10dB.

The situation is analogous when we increase the number of test tones, where their intermodulation products appear. To get an idea, the following graph shows the simulation of the distortion suffered by a signal composed of 8 equally spaced tones in frequency from 5KHz to 12KHz, level at -18dB, when it passes through a system with only 2nd order distortion (HD2 = -60dB) and another with only 3rd order (HD3 = -60dB).

*Fig. 3 - Signal and distortion (HD2 = -60dB) in the frequency domain for 8 tones @ 10KHz, 11KHz, …, 17KHz - Level = -18dB.*

*Fig. 4 - Signal and distortion (HD3 = -60dB) in the frequency domain for 8 tones @ 10KHz, 11KHz, …, 17KHz - Level = -18dB.*

For both orders of distortion, the graphs show intermodulation products (in orange) coinciding with the frequencies of the source signal (in blue) of different levels. These would not be directly detected by any measurement. The comparison between the "classic" and "real" IMD values is as follows:

- 2nd order (Fig. 3): Classic / True IMD = -57.8dB / -57.5dB

- 3rd order (Fig. 4): Classic / True IMD = -58.5dB / -52.5dB

Therefore, even in the case of the IMD calculation, the differences are not always negligible, the value is underestimated and the discrepancy is higher when there are odd-order distortions.

In conclusion, beyond the difficulty of detecting directly the values of the distortions at the same frequencies of the test tones in the measurements, I cannot see any valid reason to neglect these harmonics in the calculation of the THD and IMD. These are in fact the main responsible for the compressive or expansive effects on the signal (in this thread the details). However, it would be possible to develop a more sophisticated

What do you think?

In conclusion, beyond the difficulty of detecting directly the values of the distortions at the same frequencies of the test tones in the measurements, I cannot see any valid reason to neglect these harmonics in the calculation of the THD and IMD. These are in fact the main responsible for the compressive or expansive effects on the signal (in this thread the details). However, it would be possible to develop a more sophisticated

**dynamic**model, (i.e., with memory) which contemplates arbitrary phase values of the distorsion, to estimate the entity of these harmonics from the values of the other harmonics detected and then correct the calculation of these indicators, at least for the simplest cases. Perhaps also providing additional test signals to facilitate this calculation.What do you think?

Last edited: