Title: Harmonic phase – the missing factor in distortion measurement
Location: Royal Academy of Engineering, London, SW1Y 5DG
Description: Lecture by Keith Howard
Start Time: 18:30 for 19:00
Date: Tuesday 12th April 2011
Lecture Report
It is a truism that harmonic distortion affects the perceived quality of an audio signal. It is less readily accepted that such distortion may sometimes be pleasant. In 1977, Hiraga’s article ‘Amplifier Musicality’1 controversially suggested that certain kinds of harmonic distortion may improve the perceived quality of a Hi‑Fi system. This notion is now dubbed ‘euphonic distortion’, although more than thirty years later, few, if any, new insights exist on the subject.
Less controversially, many recording engineers insist on specifying equipment that introduces certain types of harmonic distortion at high input levels — valve amplifiers and analogue tape, for example — and deliberately overdriving it. The effect of this distortion is not always obvious, but imparts a diaphanous quality of warmth or complexity. Other types of harmonic distortion, such as Class B amplifier crossover distortion, are undoubtedly dysphonic: even tiny amounts of crossover distortion are audible, and very unpleasant.
Keith Howard has measured, characterised and emulated harmonic distortion in certain situations. This research led to a number of important conclusions. One of these gives this lecture its title: whether reproducing distortion or measuring it, is not sufficient to record only the level and spectrum of harmonics. Rendering the correct harmonic phase correctly is just as important.
The distortion algorithm that Keith Howard uses in his experiments is based around a waveshaping kernel. This is a function which maps every input sample value to an output sample value. This process is time and frequency invariant, but forms the core of a class of systems that are commonly used for non-linear signal processing. The mapping function may be controlled, using any of a number of methods, to generate a certain pattern of harmonics for an input of a certain amplitude. To add a second harmonic, for example, a waveshaping kernel is derived using the following trigonometric identity as a starting point:
2 cos2 x - 1 = cos 2x
So y = 2x2 - 1 is a waveshaping kernel function for generating a second harmonic, mapping an input sample value between -1 and +1 to an output in the same range. (Click the image to see an animated version.)

Neither this example, nor even harmonic kernels in general, cross at the origin, so a d.c. component is generated that must be filtered from the output if anything but a full-amplitude sinusoid is presented. For the third harmonic, a different identity is used:
4 cos3x - 3 cos x = cos 3x
So y = 4x3 – 3x is a waveshaping kernel function that generates a third harmonic. (Click the image to see an animated version.)

In waveshaping, the amplitude of a harmonic falls faster than that of the input signal, so that attenuating the input (in this case, by 3dB) changes the shape of the output wave. (Click the image to see an animated version.)

The generation of wave shaping functions higher than this order may be performed iteratively using Chebyshev polynomials.
Keith’s method of designing and applying waveshaping distortion is encapsulated in a free program called AddDistortion, available from the freeware page of his web site.
Beyond the second and third harmonics, the fractions of each order of polynomial become strongly interdependent. For any input signal that is not a sinusoid at full amplitude, it is not possible to add a fourth harmonic without also introducing a second harmonic. The same is true for any other harmonic beyond the third. Also, because the distortion kernel is derived from a series of continuous functions, discontinuities such as corners or jumps in the transfer characteristic cannot be modelled. A final complication is that the signal must be interpolated before waveshaping and decimated afterwards. This prevents aliasing distortion from occuring when the upper harmonics pass the Nyquist limit.
The ramifications of these limitations are powerful. For example, we could attempt to correct a system that distorts audio in a known way, by applying pre-distortion to the input. However, this results in problems. If the system introduces a second harmonic, we might generate this harmonic in antiphase in the input so that it cancels the distortion product. However, the second harmonic introduced in the input will itself be distorted by the system, and will generate a fourth harmonic in the output, and very likely a third harmonic as an intermodulation product. We eliminated the second harmonic, but possibly made the problem somewhat worse. If we then anticipate the fourth harmonic, there will then be an eighth harmonic in the output, and so on. Such correction cannot therefore be performed using analogue circuitry. This rule was often advanced in the argument against the use of corrective feedback when the debate raged in the Hi-Fi community a few decades ago. However, a correct transfer characteristic may carefully be derived in the digital domain by generating a true inverse function, which is effective at least until a certain maximum frequency is reached.
When more complicated signals are distorted by nonlinear functions, it is known that harmonic distortion is a very small part of the overall picture: Brockbank and Wass determined analytically that, for a signal containing thirty harmonic products, the intermodulation distortion generated by a nonlinearity in the system comprises 99% of the total distortion power2. Full measurement and analysis of intermodulation distortion requires at least as many components in the input signal as harmonics that are under scrutiny.
This method and these observations take us to a practical example of the importance of harmonic phase. Keith advanced three case studies, the first of which demonstrates the point effectively; the other two highlight the opportunities for wider research.
Case study 1: Crossover distortion
In 1975, James Moir performed a series of listening experiments in which a Class AB amplifier was biased at different levels, and the audibility of the resulting distortion measured3. Keith Howard’s first attempt to reproduce these results using a waveshaping kernel was not effective: amounts of distortion that would have been perceived as unacceptable in the listening test were barely audible in practice. The generated transfer characteristic looks nothing like crossover distortion, and has very little effect on a low-amplitude signal.

However, by alternating the polarity of the harmonic partials but keeping them at the same level, a more familiar characteristic is revealed:

For a full-deflection sine tone, these would measure exactly the same on a spectrogram or a THD+n meter, but they are clearly not the same. The resulting waveform reproduces the results of Moir’s test satisfactorily, and keeps the distortion components far higher as the amplitude falls. It also proves that when we are analysing or modelling distortion, we are interested just as much in the waveshaping function as the absolute level of the harmonic partials.
Case study 2: Hysteresis in transformers
In addition to the nonlinearities caused by saturation, audio transformers exhibit an asymmetrical transfer characteristic caused by their magnetic memory (hysteresis). As well as being frequency dependent, this characteristic makes modelling the distortion very difficult, because phase shift is introduced into the signal as well as wave shaping. Keith suggested a number of ways in which this could be incorporated into the distortion model in future, by using two waveshaping kernels in quadrature.
Case study 3: Loudspeaker distortion
The mechanisms that cause loudspeaker distortion are split into many different types: some, such as the cone or spider hitting their maximum excursion, are proportional to the displacement of the loudspeaker; some, such as eddy currents, are proportional to the force applied to the coil; others are proportional to cone velocity. The problem of modelling this distortion therefore falls into the same category as hysteresis in transformers: non-linearities act in different ways at different phases of the signal, and a static waveshaping kernel is clearly of limited use.
References
1. Hiraga, J. ‘Amplifier Musicality’. Hi-Fi News & Record Review, Vol. 22(3), March 1977, pp.41–45.
2. Brockbank, R. A., and Wass, C. A. A. ‘Non-linear distortion in transmission systems’. J. I.E.E., Vol. 92, III, 17, 1945, pp.45–56.
3. Moir, J. ‘Crossover Distortion in Class AB Amplifiers’. 50th AES Convention, March 1975. Paper number L-47.
Further reading
Howard, K. ‘Weighting Up’. Multimedia Manufacturer, September/October 2005, pp.7–11.
Report by Ben Supper