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:

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 H*i*(*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.