**Introduction**

In the engineering of electronic devices for music production or reproduction all designers are faced with the problem of minimizing the different forms of distortion inexorably introduced by their creations on the audio signal. They are commonly classified into two categories: **linear**and

**nonlinear**. With reference to the representation of the signal in the frequency domain, the former are characterized by alterations of the modulus and phase of the signal; the tone controls are a typical example. The latter instead add new frequency components not present in the original signal, due to the nonlinear interaction of the frequencies present in the input signal. Both forms of distortion are often created voluntarily in production to give particular characters to voices or musical instruments, or to manage loudness and dynamics, but they are to be avoided in musical playback, especially nonlinear ones, since the effects they cause on our perception may be slightly "euphonic", not reversible and are still the subject of studies. However, it should be noted that some audiophiles prefer, even unconsciously, the presence of some types of nonlinear distortion in playback. More specifically, common experiences show that modest amounts of low-order nonlinear distortion are able to give sound properties such as:

- 2nd order distortion: “warmer” and “softer” sound;
- 3rd order distortion: sound with more “dynamic contrast”.

**Nonlinear distortion measurement**

The commonly adopted approach to measuring nonlinear distortions on audio devices such as an amplifier is based on assuming that this is linear and permanent, and then looking for deviations from this ideal model. We then measure the amount of tones generated by our device by introducing single or multiple tones (synusoidal components at fixed frequencies). In the first case we will have new harmonic components at multiple frequencies of the fundamental; in the second we will have intermodulation products resulting from the interaction of two or more tones at frequencies identified by their linear combination. We then numerically quantify the magnitude of the former with THD; the latter with IMD. For example, the graph in Figure 1 shows distortions introduced by a real tube preamplifier (6H30 in a Mu-follower stage) for a 1KHz sine signal.Fig. 1 - Measure of nonlinear distortions for a tone of 1Vrms@1KHz, 0dB gain.

The 2nd order harmonic level is here of [email protected] while that of 3rd is very small, [email protected]; the THD detected is -72dB. The higher orders all have a lower level and not detectable here; the other tones present at lower frequencies are signal independent and are due to power supply. With two tones at 19KHz and 20KHz in a 1:1 ratio of Figure 2, we see the intermodulation products, at 1KHz and in the side bands.

Fig. 2 - Measure of nonlinear distortions for two tones @19KHz+20KHz (CCIF test).

The detected IMD is -76dB. The increase in the number of tones will cause a considerable proliferation of intermodulation products, in this case at linear combination frequencies of all pairs or triplets of original tones, which form a sort of “carpet” at non-harmonic frequencies. Finally, other measurements can detect THD and IMD levels for each frequency or different levels of the input signal.

Listening experiences of this preamp reveal soft sound, with a slight emphasis on mid-low frequencies and a modest soundstage, at least when compared to a neutral solid state preamplifier like the Threshold FET Ten/e used as a reference. Which is in line with common experiences on the perception of distortions, as the preamp has predominantly 2nd order distortions. Now, none of the measurements or parameters listed provide clear clues to physical alterations on the signal that can be related to this perceived character for 2nd-order distortion, different from that of the 3rd. So let's try to understand what may be the determining aspects hidden in the measurements made.

**Mathematical model of nonlinearity**

One way to study in detail the effects of nonlinear distortions is to mathematically model the input/output behavior of amplifiers for these aspects. We will then be able to build a simulator (a program) that replicates its behavior for any input signal and thus perform all our investigations on any type of signal.The definition of the model starts from identifying the cause behind the generation of nonlinear distortion in amplifiers: the non-constant gain for each level of the input signal. In other words, the input/output transfer curve

*f*(

*x*) is not a perfect line in the working interval but has imperfections around 0 or towards extremes. By modeling this curve and calculating the output values for each input signal value we can get a simulator of our amplifier. This approach determines a

**static model**, since the curve is constant over time; if instead this curve is dependent on it, it is said that the amplifier “has memory” and it is necessary to resort to more complex models, called

**dynamic**. In a previous work I dealt with these issues in more detail.

For the following analysis we will adopt the static model, in which the transfer function

*f*(

*x*) is modeled by a third degree polynomial:

*x*(

*t*) signal into this polynomial we will have that the different addendums control:

*a*0 : Contributed to DC, normally 0.*a*1*x*: Gain of the device.*a*2*x*² : 2nd order distortion amount, -90 degrees phase shift + DC input.*a*3*x*³ : 3rd order distortion amount, 180 degrees phase shift + original frequency contribution.

*a*1; then, completely eliminating the

*x*addendum will give only the distortion component. Furthermore, we will assume for the moment that the coefficients are all positive; we will see later the implications of this hypothesis.

The preamplifier described in the previous paragraph (without global feedback) is well represented by this model. As a verification we can generate test signals and compare the output of the amplifier with that of the simulator. As a sample, the following graph shows the output of the preamplifier for a series of 8 balanced tones in frequency from 10KHz to 17Hz, level at -18dB and

*f*s = 192KHz.

Fig. 3 - Measure with 8 tones @ 10KHz, 11KHz, …, 17KHz; input at 1Vrms; 0dB Gain.

The graph clearly shows the intermodulation products in the side bands of the original tones. The result of the simulator for the same source signal with distortion level of 2nd and 3rd order derived from measurements in single tones is in the following diagram. The input signal is depicted in orange; distortion component alone is in blue.

Fig. 4 - Simulation with 8 tones @ 10KHz, 11KHz, …, 17KHz, in a static nonlinear system.

The agreement is very good; the small differences are due to neglecting linear distortions (the frequency response of the preamp not perfect for module and phase) and interactions with the nonlinear distortions of the DAC/ADC converters of the measuring instrument. Note the distortion components coinciding with the original tones not detectable in the measurements.

**Analysis of impulsive signals for single order distortions**

Let’s start by analyzing distortion behavior in the time domain with a band limited impulsive signal. We then build a source signal composed of multiple equispaced tones in frequency at the same level and phase: 100 tones spaced apart by 200Hz, from 50Hz to 20KHz, level at -40dB to avoid clipping; for the phase we choose the same constant value, for example -90 degrees, to move the signal more. In the time domain all these tones are constructively added into a few short time windows: the signal takes the form of a train of sinc pulses, given the 20KHz band limitation, with alternating phases of 0, -90, -180, -270, 0, ... degrees, and spaced by 1/200 sec..Let's now simulate the transit of this sampled signal to

*f*s = 192KHz into two amplifiers (without memory effects): the first introduces a distortion of only of 2nd order and the second only of 3rd order, both at -60dB (THD = 0.1%) on a single source tone. Figure 5 shows the detail for a single pulse (phased by -90 degrees) in channel 1; channels 2 and 3 report only the resulting distortion components, amplified by 50dB to highlight its trend.

Fig. 5 - Source signal (top) and its 2nd order (middle) and 3rd order (bottom) distortions, last two amplified. Detail, Time simulation.

We observe that:

- 2nd order distortion always assumes positive values, proportional to the absolute value of the source signal, compressing the negative half-wave and expanding the positive half-wave (asymmetrical distortion). As a consequence we will have simultaneously effects of attenuation and enhancement of the transients.
- 3rd order distortion instead enhances both positive and negative half-waves, thus increasing the steepness of all transients; the signal extension also increases symmetrically.

To try to answer this question, we must resort to notions of psychoacoustics. It is now well understood that, from the point of view of frequency impacts, low-order harmonic distortions (Figure 1) are not audible as distinct tones from the main tone. This is due to the masking effect of our auditory system which, by raising the audibility threshold of frequencies close to the main one, makes them undetectable as such. It should be added that the musical signals are rich in harmonic components, and therefore the harmonic distortions are superimposed on those in the original signal, making them less "invasive" in practice. This discourse does not apply to intermodulation products (Figure 2), present at frequencies theoretically very distant from the main, non-harmonic ones, potentially capable of confusing the weakest signal levels.

From the point of view of the temporal impacts of the distortions we can refer to recent advances in the field of neuroscience. These confirmed that our auditory system under certain circumstances exhibits a much higher temporal resolution than that in frequency. In fact, if it is now widely established that our hearing system is able to detect frequencies up to 18KHz (a limit that can reach 24KHz), the temporal resolution, that is the ability to localize transient events over time, is between 6 and 10μs. The math tells us that this value corresponds to a frequency of around 125KHz, well above 18KHz. It is therefore hypothesized that these two aspects, frequency content and arrival times of a signal, are managed by different parts of our auditory system, probably in a similar way to what our eye does, in which the cells of the retina are differentiated into two types, rods and cones, to reveal brightness and color separately. Not surprisingly, the new MQA format has among the key aspects of its design that of "time precision" (further details in this article).

Returning to the distortions of the previous diagram, we have that 8μs (the average) correspond to 1.5 times the distance between one sample and another (

*f*s = 192KHz). It is therefore reasonable to hypothesize that the nonlinear distortions, acting on the transients, can have an impact on the temporal precision. Again an analogy with our visual system regarding transient alterations is curious. If we look at the 3rd order distortion curve in Figure 5, we note that this is attributable to the effect caused by a filter known as "unsharp mask". The filter (due to Laplace) does nothing but detect the edges in an image: subtracting the result of this filter (possibly attenuated) from the original image, a sort of double border is added to each element contained in the image, where the darker part is further darkened and the lighter part is lightened. This effect is clearly visible at very close range, but by observing the image from a distance it induces an effect of greater sharpness on our visual system. The filter relating to the 2nd order, on the other hand, is not used. An example of applying these filters in a non-aggressive way is in the following figure (to be observed at 100% of the dimensions).

Fig. 6 - Simulation of 3rd order distortion al left; 2nd at right; original RAW image at center.

The image on the left (equivalent to the 3rd order) appears sharper, more "dynamic", enhancing both transients; in the one on the right (equivalent to the 2nd order) this effect is still present but less pronounced, enhancing the transients on the light tones and compressing those relating to the dark tones, appearing overall more “soft”. Both modified versions seem to improve on the original image: of course it is not exactly the same processing that our hearing system does, but it seems a nice coincidence for the equivalent effect on the sound!

**Analysis of music-like signals for single order distortions**

Now let's try to understand how much of the considerations in the previous paragraph applies to a signal more similar to a musical one. We build a harmonic signal, with different phases and decreasing intensity with frequency: 64 tones from 30Hz to 48KHz in 1/6 octave steps, starting from -25dB, decreasing on the frequency level linearly to -2dB/KHz, each with random phase. This signal will appear erratic over time, given the random phases and the relationships between frequencies, which is difficult to analyze directly over time. Also the 2nd and 3rd order distortions, always at -60dB on single tone, will follow the same trend as shown in the following figure.Fig. 7 - Source signal (top) and its 2nd order (middle) and 3rd order (bottom) distortions, last two amplified of 55dB. Time simulation, detail.

Upon visual inspection, both distortions seem to be attributable to the curves of Figure 5, applied to each micro-transient: here too the 3rd order distortion enhances all transients; that of 2nd enhances the transients where the signal is positive and attenuates the negative ones. Furthermore, the 2nd order distortion values also appear negative. At this point it is appropriate to use a couple of statistical indicators that give quantitative evidence, based on the availability of the source signal and that relating only to the distortion perfectly time-aligned.

*TSD**(Total Signal Distortion)*

With this indicator we quantify the overall distortion suffered by the signal, calculated as the ratio between the RMS level of the distortion signal

*d*[

*i*] and that of the source signal

*s*[

*i*]:

The higher this value, expressed in dB or percentage, the more distorted the signal is, and therefore the distortion is potentially more audible. If the DC component is null (typically so) the TSD is proportional to the

*standard deviation*of the distortion, i.e. its

*variance*, unless a multiplicative constant equal to the RMS value of the source signal.

*DSA**(Derivative Sign Agreement)*

With the second indicator, the DSA, we quantify the effects on transients. This expresses the overall percentage of agreement between the transients of the source signal and those of the distortion. Transients are qualified by calculating the derivative of each signal, which expresses the rate at which signals vary: when it is positive the signal grows; when it is negative it decreases. So:

- Where there will be agreement between the sign of the source signal derivative and that of distortion, we will have an increase in the speed of the transient, positive or negative;
- Where there is discrepancy, distortion will reduce the speed and level reached of the transient.

Returning to the signal in question, we will have:

- 2nd order: TSD = -62.2dB (0.077%), DSA = 50.0%
- 3rd order: TSD = -62.3dB (0.077%), DSA = 100.0%

To complete the picture, we perform the analysis in the frequency domain of the distortions. The following diagrams show the spectral trend of the distortions in Figure 7, normalized to the source signal level, decreasing in frequency to -2dB/KHz. Figure 8 shows the 2nd order distortion and the same without the components at the same frequencies of the source tones; Figure 9 that of 3rd order.

Fig. 8 - Normalised 2nd order distortions (in dB, blue line) and average (red line) - Simulation.

Fig. 9 - Normalised 3rd order distortions (in dB, blue line) and average (red line) - Simulation.

Fig. 9 - Normalised 3rd order distortions (in dB, blue line) and average (red line) - Simulation.

Both distortions have an uneven frequency distribution. On their qualitative trend we can say that:

- The level of the "carpet" of distortion is almost constant for both orders, higher for the 2nd order.
- The peaks of 2nd order distortion are modest, almost at the same level at each frequency, denser in the medium-low frequencies and generally not coincident with the tones of the original signal.
- The peaks of 3rd order distortion are very pronounced, almost at the same level at each frequency and coinciding with the tones of the original signal.

**Analysis of music-like signals with more distortion orders**

Let's analyze now what happens in the presence of both distortion orders, where we expect a mix of the two effects. The graphs in Figure 10 show TSD and DSA values as a function of the ratio of distortion levels of 3rd and 2nd order (expressed in dB) to single tone. The different curves refer to three references for the 2nd order: -110dB, -90dB, and -70dB.Fig. 10 - Left: TSD per 3rd/2nd order ratio (dB). Right: DSA per 3rd/2nd order ratio (dB). Change of 2nd order reference.

On the left side of the graphs 2nd order distortion prevails, at a constant value; on the right side the 3rd order prevails, which determines the overall increase in distortion. In detail we have:

*TSD Chart*

The graph shows the magnitude of the overall distortion, coupled with the variability which is about 12dB lower. Changing the 2nd order reference level logically translates the curves upwards by the same quantity. These remain constant where 2nd order distortion (constant) prevails up to a ratio of -6dB; then they grow with constant slope on the right side where the 3rd order prevails over the ratio 6dB.

*DSA Chart*

The graph shows how the character of the distortion progressively shifts from that of the 2nd to 3rd order, therefore of the perception of the “warm” effect (DSA = 50%) towards the "dynamic" effect (DSA = 100%). Since the curve is unique for all the reference levels we will have that the character of the distortion depends only on the relationship between the two types of distortion, while the different reference levels make them more or less audible (TSD). With a ratio of 6dB we have the intermediate situation between the two orders for transient effects, with DSA = 74%. Finally, we note that the most important variations occur when the ratio between the two distortions is between -3dB and 20dB.

The following figure shows the detail of the frequency trend of distortions for the 1:2, 1:1 and 2:1 ratios, always normalised to the level of the source signal by frequency.

Fig. 11 - Normalised 2nd+3rd order distortion (in dB) for 1:2, 1:1 and 2:1 ratios - Simulation.

The graphs show how the progressive increase of the 3rd order distortion marginally increases the level of the carpet, acting mainly on the peaks.

Finally, let's verify how to change the distortions in function of the level of the source signal. The graphs in Figure 12a show the graphs of the TSD and DSA values in correspondence with the reduction of input levels of 10dB, 20dB, 30dB and 40dB. The 2nd order reference level is -70dB.

Fig. 12a - TSD (dB, left) and DSA (%, right) per 3rd/2nd distortion ratio, for more input levels.

Both graphs show that 3rd order distortion decreases faster than 2nd order with the reduction of the level (the 3rd decreases with the cube of the signal level; the 2nd with the square). This implies that all curves translate to the right by the same amount as the reduction in the input level (10dB). Furthermore:

*TSD Chart*

The level of distortions decreases with the level of the source signal. Where the 2nd order prevails, the level of distortion decreases by the same amount as the entry level; where the 3rd prevails, the level of distortion decreases by double the level of the input.

*DSA Chart*

From the curves it can be seen that with the same ratio between the two orders, the characterization of the 3rd order distortion (i.e. dynamic) decreases very quickly as the entry level decreases. For example, if for a level of 0dB we have a DSA = 74.4% for the 3rd/2nd ratio = 6dB, for a 10dB reduction of the level we have DSA = 51.0%, i.e. the disappearance of the dynamic effect.

It should be added that these effects are obtained by acting on the volume of the reproduction, if the amplifier has this control at the signal input (in this study more details), or within the same music track when passing from parts at high level to other lower ones and vice versa. This latter aspect is more evident from the graphs in Figure 12b, where the TSD and DSA values are shown as a function of the input level (dB) for different 3rd/2nd order ratios (from 0dB to 30dB, in steps of 6dB), with a reference for 2nd order = -70dB.

Fig. 12b - TSD (dB, left) and DSA (%, right) per input level, for more 3rd/2nd distortion ratio.

Finally, the curves do not take into account the level of background noise which in practice hides the lower levels of distortion.

**Conclusions**

The above helps us to bridge the apparent gap between the subjective experiences of listening to music and the measures of nonlinear distortions. The study shows that the "dynamic" effect is likely caused by the contributions of 3rd order distortion to the tones in the main signal, which strengthen the energy content of the musical signal and the transients, to which we are very sensitive. These contributions are much milder for the 2nd order, which distributes energy in the form of a "carpet", more pronounced in the medium-low frequencies. The presence of both orders produces intermediate effects, as well as the variation of the input signal level. And here we stop with speculations: to what extent a more or less large variation in physical quantities is perceived as more or less important must be experimented with listening tests or other types. There is also the most popular world of “memory” amplifiers to explore that have different behaviors about distortions.

Last edited: