• 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!

Physics and perception of low-order nonlinear distortions

OP
Pinox67

Pinox67

Member
Editor
Joined
Apr 8, 2020
Messages
70
Likes
144
Location
Italy
ADDENDUM

Crossover distortion analysis

Let's study the so-called crossover distortion, generated by class B amplifiers and to a lesser extent by class AB. In short, in these circuits the positive and negative values of the signal are amplified by different active elements. Given the non-simultaneity of switching off one chain and switching on the other, the type of distortion in question is generated in the crossing through the 0 of the signal, where small variations in the signal around 0 (gap) are not amplified correctly. The transfer curve with unit gain is exemplified in the following figure (top right), with an "exaggerated" gap of 0.1 to better show the trend; it is not represented by a polynomial, but still a continuous function of C^infinity class, with a very pronounced "elbow".​

Fig. 29 - Crossover Distortions: Transfer Function, Harmonic Distortions, Time behaviour.
fig 29 - Xover Tran.png

In the other graphs the classic values for a pure tone; we have:​
  • Bottom left: always exaggerating, the shape of the distortions as the input level decreases, with the same amplification (effect equivalent to increasing the gap, then scaling the module by the same amount). Basically, it is noted that a sort of square wave is added to the signal, in counter-phase with respect to the signal. The rising and falling edges are steeper the smaller the gap, and here they have a "soft" shape, given the simple course of the sinusoid.
  • Bottom right: derivative of the distortion, where the abrupt variations in correspondence "to the edges" are evident (i.e. in the passage from values lower than the gap to the higher ones). This results in high order harmonics in the distortion.
  • Top right: the trend of harmonic distortions (absolute values) as the signal level decreases, with gap = 1/1000. Only odd harmonics are present, including a contribution to the fundamental (HD1), with a typical square wave trend. As the signal level decreases, the low-order harmonic distortions remain almost constant, while the higher ones decrease. At the limit, the distortion "tends" to the original signal in counter-phase.
It is therefore not new that this type of distortions are higher (as a ratio) at low volumes: in the example we go from a True-THD = -57dB for 0dB to a True-THD = -17dB for -40dB.

For a complex signal, the square wave becomes more irregular. The following figure shows the usual “music-like” signal, where the original signal is shown at the top, and the distortion, amplified by 40dB, at the bottom.​

Fig. 30 - Crossover distortion, Time Simulation - gap = 1/1000.
fig 30 - Xover time.png

Basically, the distortion will be equal and opposite to the original signal as long as its absolute value is less than the gap; it will assumes the gap value (positive or negative) for all other values.

Before analyzing the DSA, PSD and PCD charts it is appropriate to allow that here the dependence on the distribution of test signal levels is even more important than in previous cases. The reason is in the graphs in Fig. 31, which show the probability density function of the levels, for a sine signal (left) and for the music-like signal (right).​

Fig. 31 - Probability Density Function. Left: sine signal; Right: music-like signal.
fig 31 - PDF.png

The simple and regular sinusoidal signal is found statistically little around 0, while it ‘frequents’ values close to extremes much more. Completely the opposite is the function of density for real signals, which typically approximates a Gaussian curve. Therefore, it is evident that the amount of signal below the gap is statistically greater in the case of real signals.

Let's now look in detail at the new indicators, DSA, PSD and PCD with the music-like signal. Always with a gap = 1/1000 and gain 0dB you have the curves in fig. 32.i​

Fig. 32 - PSD, PCD and DSA for crossover distortion - gap = 1/1000.
fig 31 - Xover PSD1.png

Both DSA curves are plotted in the graphs, both that relating to the fraction of expanded transients (DSA+) and that relating to compressed ones (DSA-). This is because the sum of DSA+ and DSA- does not give 100% here as in the previous cases: the missing part, the most conspicuous, is relative to the part of the signal whose transients are not altered, that is the one where its absolute value is above the gap value. Since PSD and PCD refer to transients, they will describe the behavior of only small parts of the distortion, i.e. only those where the signal is below the gap. In detail:​
  • The DSA+ is always equal to 0, indicating that there are no expanded transients; therefore PSD+ and PCD+ will also be null.
  • The DSA- starts from very small values for 0dB levels of the signal, to increase as the level decreases, where ever larger parts of the signal are below the level of the gap. In fact, here the DSA- represents the signal fraction below (in absolute value) to the gap.
  • When the DSA- increases, both the energy associated with the compressed transients (PSD-) and the negative correlation (PCD-) increase in value, since they "include" more of the original signal and the edges effect for transients decreases. The PSD- comes to be equal to the signal, 0dB, and the PCD- equal to -1 (in phase opposition).
For comparison, the following figure shows the same indicators when the gap is 10 times smaller. In fact, we have the same curves as in fig. 32, shifted 20dB (10 times) to the left.​

Fig. 33 - PSD, PCD and DSA for crossover distortion - gap = 1/10000.
fig 32 - Xover PSD2.png

Therefore, the crossover distortion, if small, acts on very limited fractions of transients. However, edge effects still generate harmonic distortion components of high order and level, more impacting at lower levels. These latter aspects are decisive here on the effects on perception, which in common experience do not contribute to listening pleasure if they are not appropriately contained in the design phase.​

Hard-clipping distortion analysis

Let's analyze the distortions introduced by hard-clipping, that is, an abrupt limitation of the signal when the values exceed a set threshold. These are typical distortions of solid state amplifiers when they come out of the normal working area. The transfer curve is shown in Figure 34 (top right), where the threshold is placed at a unit value. Here too it is not represented by a polynomial, but still a continuous function of C^infinity class, with a very pronounced "elbow".​
Fig. 34 - Hard-clipping Distortions - Transfer Function, Harmonic Distortions, Time behaviour.
fig 34 - fx clip.png

Applied to a pure tone we have, in the other graphs:​
  • Bottom left: distortion trend as the input level increases, from 0dB where the clipping effect is almost zero, to +3dB where the signal exceeds the clipping threshold by 1.4 times and therefore the cutting effect is more full-bodied. It is evident how the distortion takes the form of the upper (and lower) part of the sine wave where the threshold is exceeded, in phase opposition and which becomes wider as the input level increases.
  • Bottom right: Derivative of distortion. Here, too, we note the ‘edge’ effect, that is, abrupt variations in the derivative at the signal transition from the cut to the unaltered zone, and vice versa. Therefore, we expect the generation of high-order harmonic distortions.
  • Top right: The trend of harmonic distortions in absolute value as the input signal level changes, from -1dB to +2dB in steps from 0.5dB. Given the symmetry of distortion, only odd harmonics are present, including a contribution to the fundamental (HD1). As the signal level increases, harmonic distortions increase consistently for both the level and the order. At the limit, the distortion ‘tends’ to the original signal in counterphase.
For a music-like signal things are a bit different, given the different statistical distribution of signal levels, as in the case of crossover distortion. Here are relevant the high values of the signal, assumed less frequently by a real signal than a simple tone, as already shown in Fig. 31 (we add that Crest Factor of the signal used is 11.2dB, an average value, versus 3dB of the sine signal). We have the following charts for transients.​

Fig. 35 - PSD, PCD and DSA for hard-clipping distortion.
fig 35 - PSD clip.png

Here too, the sum of DSA+ and DSA- does not give 100%: the missing part is relative to the part of the signal whose transients are not altered, below the threshold value. Then, PSD and PCD will describe the behavior of distortion transients where the signal is above the threshold. We have:​
  • The fraction of expanded transients (DSA+) is identically null and therefore PSD+ and PCD+ will also be null.
  • The fraction of compressed transients (DSA-) starts from values close to 0 for 0dB signal levels to increase progressively as the signal level increases, where ever wider parts of the signal are above the threshold. Here too, the DSA- actually represents the fraction of the signal above (in absolute value) of the clipping threshold.
  • When the DSA- increases, the energy associated with compressed transients (PSD-) increases in value, tending to the original signal (0dB) in phase opposition.
  • The negative correlation (PCD-) reflects the progressive similarity to the original signal as the DSA- increases.
From what we have seen, this distortion is dual to that of crossover: while for this the distortion is equal to the signal in phase opposition below a certain value (gap), for the hard-clipping the opposite occurs, that is, the distortion is equal to the opposite of the signal for values exceeding the threshold. There is also nothing new to the hard-clipping distortion: it is more relevant to the effects on perception the presence of harmonics of high order as the clipping increases compared to the impacts on transients.​
 
Last edited:

lashto

Addicted to Fun and Learning
Forum Donor
Joined
Mar 8, 2019
Messages
705
Likes
369
After examining in detail the physics behind the distortions in the case that we can define as "base", with the consequent characterizations of “warm” and "dynamics", we explore other cases that determine different impacts on the signal and therefore on perception.
...
Very interesting stuff @Pinox67 and highly welcome, always thought that a lot more info on HD effects was needed on ASR. The forum is full of all sorts of "legends" about the effects of HD and you can find pretty much every possible miss-conception between "it does not matter" and "it's the only D that matters".

A somewhat similar investigation, but done by ear and mostly for H2 only: https://www.stereophile.com/content/katzs-corner-episode-25-adventures-distortion. The author is a well known music producer, presumably he has good ears and knows what he's talking about (I would guess that every "audiophile" has heard this pretty amazing mix/recording.)

And a so-called "internet blind test" done by user @Archimago which shows that small levels of HD are quite audible (~75Db THD made of H2 & H3). And even more, the "distorted" track was actually preferred by most test participants:

And just in case you were not aware of it, @pkane has a very nice HD tool
 
Last edited:

lashto

Addicted to Fun and Learning
Forum Donor
Joined
Mar 8, 2019
Messages
705
Likes
369
And I have an extra question @Pinox67: one psycho-acoustic effect that gets mentioned quite often is that H2-heavy signals are perceived to sound louder than the original ... and H3-heavy ones are perceived to sound quieter. There is also a related "audiophile legend" that says that at the same power level, tube amps (H2-heavy) sound louder than SS amps (usually H3 dominated).


Your Fig 13,14,18 graphs seem to support the "legend" somewhat. In most cases, it looks like the H2 has an 'expansion' effect on the signal and H3 a 'compression' effect. Would you care to add an opinion on that?
 
OP
Pinox67

Pinox67

Member
Editor
Joined
Apr 8, 2020
Messages
70
Likes
144
Location
Italy
Very interesting stuff @Pinox67 and highly welcome, always thought that a lot more info on HD effects was needed on ASR. The forum is full of all sorts of "legends" about the effects of HD and you can find pretty much every possible miss-conception between "it does not matter" and "it's the only D that matters".

On the relationships between the non-linearities of our devices (small or modest, not easily modelable) and the non-linearities of our auditory system (highly non-linear) there is still room for exploration. The important thing is to do it with a scientific approach. And in this field it is not easy, there are a lot of aspects involved that require different skills.

A somewhat similar investigation, but done by ear and mostly for H2 only: https://www.stereophile.com/content/katzs-corner-episode-25-adventures-distortion. The author is a well known music producer, presumably he has good ears and knows what he's talking about (I would guess that every "audiophile" has heard this pretty amazing mix/recording.)

Thank you for this and the other reports. Yes, I read about this device, I wrote to Bob a long time ago, but he still hasn't given me any feedback, he's very busy!

And a so-called "internet blind test" done by user @Archimago which shows that small levels of HD are quite audible (~75Db THD made of H2 & H3). And even more, the "distorted" track was actually preferred by most test participants:
...

In my own small way I have conducted similar tests with my audiophile friends and the results are in line with those presented in these works.

And just in case you were not aware of it, @pkane has a very nice HD tool

I had already seen this interesting tool. I work with the Mac and I wrote a similar one. However, the goal of my program is different: it should help my electronic technical friends in the fine-tuning design of their amplifiers. So, other aspects are also modeled, such as the variation of bias, the concatenation of multiple non-linear stages, the use of linear negative feedback and others.
It must be said that a program that injects harmonic distortions on the digital signal should be used very carefully for a couple of reasons:
  • The amplification of the downstream chain must be very neutral, otherwise the distortions multiply and we no longer know what we are listening to.
  • If you want to simulate the harmonic distortion of an amplifier it is necessary that the reproduction levels in the simulation and those at which the distortions are detected are the same, otherwise even here you no longer know how much distortion you will hear. More details in this post.
And I have an extra question @Pinox67: one psycho-acoustic effect that gets mentioned quite often is that H2-heavy signals are perceived to sound louder than the original ... and H3-heavy ones are perceived to sound quieter. There is also a related "audiophile legend" that says that at the same power level, tube amps (H2-heavy) sound louder than SS amps (usually H3 dominated).

Your Fig 13,14,18 graphs seem to support the "legend" somewhat. In most cases, it looks like the H2 has an 'expansion' effect on the signal and H3 a 'compression' effect. Would you care to add an opinion on that?

Wanting to briefly summarize the result of the simulations for devices with limited memory effects that use "musical" signals, I can say that:
  • 2nd order distortion: The non-linear interaction of harmonics in the original signal creates many low-medium frequency intermodulation products (d2L) in general at new frequencies compared to the original signal and at not very low levels (see fig. 8). These components are responsible for the effects of "swelling" in this part of spectrum on our perception (not detectable by the normal frequency response measure). The changes in the transients (50% expanded; 50% compressed) seem to have effects on the "softness" of the sound and on the localization of sound objects; on this last aspect I have to finish the experiments.
  • 3rd order distortion: This generates its main distortion components at the same frequencies of the harmonics in the original signal (and which are overlooked in the calculation of THD and IMD, see fig. 9). These distortions cause a fully compressive or expansive effects on the transients, which can be related to the perception of a minor or greater micro and macrodynamics.
  • Mix of the two distortion orders: It generates intermediate effects, with the 2nd order prevailing over the 3rd for low signal levels.
What emerges from the study is that in order to qualify the described effects it is important to analyze not only the levels of injected distortions, but also the relative phases, an aspect that is most often overlooked, with the risk of leading to conclusions that are not entirely correct. So the "legend" can found a physical justification; but there are also other variables that can influence the result.
 
Last edited:

NTK

Major Contributor
Forum Donor
Joined
Aug 11, 2019
Messages
1,810
Likes
3,744
Location
US East
  • 3rd order distortion: This generates its main distortion components at the same frequencies as the harmonics of the original signal (and which are overlooked in the calculation of THD and IMD, see fig. 9). These distortions add up to the signal causing compressive or expansive effects; this correlates us with the perception of a minor or greater micro and macro-dynamic.
We should be able to infer the auditability of the modulation of the fundamental using our understanding of auditory masking. Below is a typical figure (e.g. from Egan's paper)

947fig4.jpg

The masking level is roughly 20 dB (e.g. a 80 dB masker will mask a 60 dB signal of the same frequency), meaning that an additional signal at the same frequency of more than ~20 dB below it (10% in signal volage amplitude or 1% in power) is inaudible. It can be understood as:
  • If we have a coherent signal of -20 dB added (in phase) (or subtracted, (out of phase)), the resulting signal amplitude is: 1x + 0.1x = 1.1x = 0.8 dB, which is close/comparable to our JND (just noticeable difference).
Therefore, I reasoned that it will require an at least several percent amplitude modulation at the fundamental frequency to cause a perceptible effect in "micro" or "macro-dynamics".
 
Last edited:
OP
Pinox67

Pinox67

Member
Editor
Joined
Apr 8, 2020
Messages
70
Likes
144
Location
Italy
We should be able to infer the auditability of the modulation of the fundamental using our understanding of auditory masking. Below is a typical figure (e.g. from Egan's paper)

947fig4.jpg

The masking level is roughly 20 dB (e.g. a 80 dB masker will mask a 60 dB signal of the same frequency), meaning that an additional signal at the same frequency of more than ~20 dB below it (10% in signal volage amplitude or 1% in power) is inaudible. It can be understood as:
  • If we have a coherent signal of -20 dB added (in phase) (or subtracted, (out of phase)), the resulting signal amplitude is: 1x + 0.1x = 1.1x = 0.8 dB, which is close/comparable to our JND (just noticeable difference).
Therefore, I reasoned that it will require an at least several percent amplitude modulation at the fundamental frequency to cause a perceptible effect in "micro" or "macro-dynamics".

So, transposing your analysis into the world of nonlinear distortions, this would imply a distortion level of 3rd harmonic at -30dB to have a contribution of -20dB on the fundamental (from fig. 10a you can see that HD1 is 10dB higher than HD3, at least in the static model) so that the modulation is audible. They seem to me to be a bit high values... in practice much lower 3rd harmonic distortion values are audible. It could be that the 3rd harmonic distortion component (in the graph masked at -50dB) is audible before the effects on the fundamental... Maybe.

The “quid” is in the fact that these calculations are valid only in the case of two pure tones, stationary, mono, with the masking tone at 415Hz. In the case of musical signals, which are much more complex, none of these hypotheses are true: you will know better than me that in this case a myriad of other non-linear effects of our auditory system come into play that influence not a little on our perception and that models that offer psychoacoustic texts still have some gaps. So, I'm not confident in these numbers for the "normal" musical content we listen to.
 
Last edited:

lashto

Addicted to Fun and Learning
Forum Donor
Joined
Mar 8, 2019
Messages
705
Likes
369
We should be able to infer the auditability of the modulation of the fundamental using our understanding of auditory masking. Below is a typical figure (e.g. from Egan's paper)

947fig4.jpg

The masking level is roughly 20 dB (e.g. a 80 dB masker will mask a 60 dB signal of the same frequency), meaning that an additional signal at the same frequency of more than ~20 dB below it (10% in signal volage amplitude or 1% in power) is inaudible. It can be understood as:
  • If we have a coherent signal of -20 dB added (in phase) (or subtracted, (out of phase)), the resulting signal amplitude is: 1x + 0.1x = 1.1x = 0.8 dB, which is close/comparable to our JND (just noticeable difference).
Therefore, I reasoned that it will require an at least several percent amplitude modulation at the fundamental frequency to cause a perceptible effect in "micro" or "macro-dynamics".
Yes, HD-masking happens but is it important for the THD calculation? Or more generally, does the audibility of (individual) HDs matter?

I would argue that none of those things matters for the THD. Audible or not, those HD sound-waves still exist and they interact with the fundamental, with each other etc.. Those "invisible" HDs still have a timbre/coloring effect on the fundamental and that's the only thing we hear. No matter how many HDs, no matter how big/smalll they are, you still hear one single sound: the (colored) fundamental. And actually it's even "worse", see missing fundamental.

I remember reading a visual analogy somewhere which I found very useful.
Let's use a "pure-red" light-wave as test signal, say 450 THz. Its H2 is 900THz which is already in the ultraviolet. Its H3 is at 1200THz and quite far in the ultraviolet.
Individually, the H2 and H3 light-waves are invisible. But what happens if you "play" all three light-waves together? You'll see a darker, blood-ish red (i.e. red+violet). It does not matter that the H2 & H3 color waves are individually invisible, you still see their effect on the (red) fundamental.
 
Last edited:

deadwood83

Member
Joined
Sep 1, 2022
Messages
80
Likes
133
I really appreciate you making this thread. On ASR we are fed graphs all the time, but knowing how each portion of a dataset is related to another is the real power. This post takes me back to university days. I was sort of hoping to see some best-fit equations with a full explanation but I guess matlab and other SW is so popular now I'm not sure if the latest gen of engineers will spend much time hand-calculating. I bever found hand-calculations of best-fit to be especially valuable, but it made the data mean so much more (to me, knowing how it was done).

Thanks again!
 

lashto

Addicted to Fun and Learning
Forum Donor
Joined
Mar 8, 2019
Messages
705
Likes
369
The missing fundamental wiki reminded me of one of those HD miss-conceptions which is often posted on ASR. Often "shouted" as some sort of indisputable/absolute "mathematical truth".

The "logic" goes approx like this: the noise floor of my room is at ~30Db and those HDs were measured below -100Db. No matter how loud I can (practically) play my music, those HDs will be below the noise floor and therefore inaudible (...and they do not matter, and I couldn't care less, and get off my lawn etc...)

That math is actually 100% ok. Problem is, ears and sound-waves do not work that way:
  1. the noise-floor is not some sort of brickwall that masks all sounds below. You can still hear sounds many dB below it (depends on the frequencies). Probably best to think about the noise floor as a sort of "transparent fog". And it's usually much safer to assume that it masks ~nothing.
  2. even if "masked", as soon as those HD waves hit the air they will have effects. And they do not care much about your noise floor. Wiki quote: "experiments subsequently showed that when a noise was added that would have masked these distortions..., listeners still heard a pitch corresponding to the missing fundamental, as reported by J. C. R. Licklider in 1954.[4]"
 
Last edited:
Top Bottom