ESP Logo
 Elliott Sound Products Project 52 

Distortion Analyser
Rod Elliott (ESP)
Updated 23 Dec 2007

Share |


Total harmonic distortion (THD) measurements are one of the most commonly quoted in audio. Contrary to belief in some circles, these can be very useful if performed properly, and reveal much about the overall performance of an amplifier.

There are a number of ways to measure distortion, none of which is perfect. Probably the best is a spectrum analyser, which shows the individual harmonics and their amplitudes. These are too expensive for the likes of you and me (well, me, anyway) and the next best thing is featured here.

There are other methods as well, one of which is to subtract the output of an amplifier from the input (with appropriate scaling). When the two signals are exactly equal and opposite they are cancelled out - any signal left is distortion created in the amplifier. This method seems easy, but is not, because there are phase shifts within the amp that can be very difficult to compensate for exactly, and the final accuracy of tuning the parameters - amplitude and phase - must be just as great as with this circuit for a meaningful result.


The standard tool for measuring THD is a notch filter. This is tuned to reject the fundamental frequency, and any signal that gets through is a combination of the amplifier's noise (including any hum) and the distortion. The distortion shows up as a signal that is harmonically related to the signal fed into the amp, but is not the fundamental. Harmonics occur at double, triple, quadruple (etc) the input frequency. These are referred to as 2nd, 3rd, 4th (etc) harmonics, and are subdivided into odd and even. Even harmonics (2nd, 4th, etc) are claimed to sound better than odd (3rd, 5th, etc), but in reality we don't want any of them.

Figure 1
Figure 1 - Basic Twin-T Notch Filter

The filter of Figure 1 is 'normalised' to 1uF and 1k Ohm, giving a frequency of 159Hz. The resistor and capacitor ratios are extraordinarily critical if a deep notch is to be obtained, and this is essential for distortion measurement. This notch filter is called a Twin-T, and works by phase cancellation of the input signal. When the phase shift is exactly +90° and -90° in the two sections, the tuned frequency is completely cancelled, leaving only those signals that are not tuned out. This residual signal represents total harmonic distortion + noise.

Figure 2
Figure 2 - Frequency Response Of Standard Notch Filter

The problem with the notch filter shown is that its attenuation is too high at the 2nd harmonic, and in fact is only acceptable one decade from the fundamental. The example shown has about 0.7dB attenuation at 1.6kHz - a decade from the 159Hz fundamental frequency. This is corrected by using feedback, which tries to get rid of the notch, but is completely unsuccessful, since when properly tuned the notch is infinitely deep.

Too much feedback, and the filter will be be almost impossible to tune because it is too sharp, so a compromise is needed. We need the filter to cause no more than a dB or so of attenuation at double the fundamental frequency (this is one octave), to prevent serious measurement errors of second harmonic distortion.

Figure 3 shows the result when we apply feedback, and the error at one octave is now less than 1dB. This is acceptable for normal measurements, and the resulting error is small, while retaining the ability to tune the filter. Note that although it is tuneable, this filter is still extremely sharp, and unless multi-turn pots are used it will be almost impossible to obtain a good notch. The slightest variation of the input frequency will create a massively high 'distortion' figure. I have found that with very low distortion amps, it is a real battle to measure the distortion whilst trying to keep the filter tuned, because of drift.

Figure 3
Figure 3 - Frequency Response With Feedback

This overall characteristic is the desired one, so the final notch filter design is shown in Figure 4, with the feedback applied from the opamp. I have chosen to make the feedback adjustable, so that you can easily modify the characteristics if you want to. This can make it a little easier to tune, since initial tuning can be done with a small amount of feedback, and as the exact frequency is tuned in, the feedback can be increased.

Once upon a time, it was possible to obtain 50k+ 50K+ 25K wirewound pots (I think that was the range) - yes, a triple gang, two separate resistances, wirewound pot! These were especially for just this type of circuit, but I doubt that you will find one any more. The only way that multiple frequencies can be tested is to use a switched selector, and ensure that there is enough range in the tuning pots to make up for all capacitor value errors.

The accuracy of tuning is critical - a 40dB deep notch will show the distortion as 1%, even though it may be much less. A 60dB notch reduces this to 0.1% and so on. For a 100dB notch, you will need all components accurate to within 10ppm (parts per million), or 0.001%. Even a small temperature change can send the meter needle (or oscilloscope trace) straight off the scale. I know this, because it happens every time I try to measure very low distortion levels, and I can't even get to 0.001% on my meter because my oscillator has more distortion than that.

Figure 4
Figure 4 - The Variable Q Tuneable Notch Filter

To change ranges, we must vary either the resistance or capacitance (or both). Figure 5 shows the range switching. To try to keep the unit reasonably versatile, I have included two switches. SW1 gives decade ranges of 20, 200 and 2kHz by changing capacitor values. SW2 gives the standard 1, 2, 5 sequence common in oscilloscopes. This combination allows the following frequencies to be tested ...

Range 1 (SW1)Range 2 (SW2)Nominal Frequency
Table 1 - Range Switching

The notch frequency is determined by

fo = 1 / ( 2 * π * R1 * C1 )
Resistor values are exactly R1 = R2, R3 = 0.5 * R1
Capacitor values are exactly C1 = C2, C3 = 2 * C1

The tuning requires that the ratios are exact - absolute values are not as important, but must be stable. To be able to tune the notch precisely, we will use pots in series with two of the resistors, R1 and R3. The range of the pots will vary depending on the resistance that is switched into the circuit, and even with multi-turn pots it is useful to have two in series, one with a lower resistance than the other. This is shown in Figure 5.

It is essential to make sure that the pots have enough range to compensate for the tolerance of the capacitors, and some care is needed to keep wiring capacitance to a minimum, especially for the highest frequency range. To this end, I suggest that all tuning components are wired directly to the switches and pots, and that wiring is done with solid tinned copper wire. All wiring can be made self supporting, and will exhibit very low capacitance.

Figure 5
Figure 5 - Input Level Control And Range Switching

The range switching simply connects different resistors and / or capacitors into the circuit. A problem is that when resistances are changed, the sensitivity of the tuning pots also changes. This is unavoidable unless you can get odd value triple-gang pots (Do you feel lucky? - If you find them, buy a lottery ticket !!). VR4 and VR6 should be multi-turn - you can get geared pot drives to use standard pots if multiturn units are unavailable.

The set/ measure switch (SW3) must have the lowest possible contact resistance. It will ideally be a double-pole switch, with both sets of contacts in parallel. The more traditional way to set the range is to

The values and exact design frequencies are shown in Table 2. To make the C3.x values, parallel two C1.x value caps, and if possible use a capacitance meter to match all capacitors to within 1%. Standard tolerances will affect the centre frequencies. Resistors must be metal film, 1% tolerance, and from the E24 series (24 values per decade). The values of R2.x and R3.x are lower than expected, because I have taken the mid resistance of the two series pots into consideration. Note that some of the resistors require 2 components in series to get the desired resistance.

FrequencyC1.x, C2.xC3.xR1.x (Ω) R2.x (Ω)R3.x (Ω)
19.4 Hz100nF200nF82k75k + 4.3k39k + 1k
40.8 Hz100nF200nF39k36k18k + 390
99.5 Hz100nF200nF16k13k6.8k + 100
194 Hz10nF20nF82k75k + 4.3k39k + 1k
408 Hz10nF20nF39k36k 18k + 390
995 Hz10nF20nF16k13k 6.8k + 100
1.94 kHz1 nF2nF82k75k + 4.3k39k + 1k
4.08 kHz1 nF2nF39k36k 18k + 390
9.95 kHz1 nF2nF16k13k 6.8k + 100
Table 2 - Resistor and Capacitor Values
Note that values shown in italics and on a grey background are simply repeats of parts already specified. They are not separate individual values.

There are a couple of things to be aware of with this circuit. Firstly, the input impedance is quite low, and use of a buffer is not recommended because this will introduce additional noise and distortion. The opamps used for the feedback should be the best you can get hold of. The Burr-Brown OPA2134 is an excellent choice, with 0.0003 distortion and low noise. Other devices that will be suitable include the venerable NE5532, LM4562 or OPA2604.

To allow power amps to be tested, an input level control is needed, and this is also used for calibration. The control ideally should be a wirewound device since power dissipation could be quite high, and wirewound pots add less noise than carbon. If high power amps are to be tested, add a suitable attenuator network before the pot, using (for example) a 1k 5W resistor and a 100 ohm 1W resistor to ground. That combination will let you test amps with over 50V RMS output (312W into 8 ohms). The attenuator must be before the 10k pot.

The ideal measuring meter is an oscilloscope, but a millivoltmeter may be used. Without the oscilloscope you will be unable to see the 'quality' of the distortion components, but use of an amplifier will allow you to listen to the residual - make sure that you have a limiter circuit on the monitoring amp, or a slight bump of the oscillator frequency control will blow your head off! A suitable limiter is published as Project 53. Modern digital oscilloscopes are a good choice, because most provide extensive maths functions that will let you perform a FFT (fast Fourier transform) of the output, or an accurate RMS measurement.

The final measurement will include the distortion from the audio oscillator, and it is likely that this will be greater than that of many amps. It is not really possible to tell you how you can subtract this from the measured distortion, since the distortion waveform has a huge influence over the result. The distortion waveform is very important - a low average level spiky waveform (typical of crossover distortion) will sound much worse than an apparently higher level of 'clean' 3rd harmonic distortion from a well designed push-pull amplifier stage.

If you were to obtain a final reading of (say) 7mV, you can now determine the distortion + noise

THD% = ( V2 / V1 ) x 100     Where V1 is the initial voltage and V2 is the lowest reading
THD = ( 0.007 / 3 ) x 100 = 0.23%
NOTE Remember that if you apply too much signal to the input, you will destroy the opamp. The use of protection diodes is not an option (IMO), as this will introduce distortion, making your measurements useless. The distortion introduced by the analyser may exceed that of a good amplifier. This is unhelpful!

The distortion meter circuit can be simplified. For example, you may feel that there are more ranges than you need, and these can be adapted for your needs. You might even think that a single range is sufficient, and for many basic tests this is OK. Naturally, you will be unaware of distortion that may become apparent only at low or high frequencies - but I shall leave this up to you.

The traces below show the fundamental (green) at 705mV, some deliberately introduced odd-order harmonic distortion (red) and even-order distortion (blue). Note that there is no evidence whatsoever of the original 159Hz fundamental - the notch filter has removed it completely. Anything left over has been added to the original signal, and is therefore distortion.

Figure 6
Figure 6 - Fundamental, Plus Distortion Waveforms

The distortion voltages were amplified by 100 times for clarity. The odd-order distortion measures 40.81mV (408.1uV), and even-order distortion was 33.05mV (330.5uV) - remember, the displayed and measured distortion was amplified by 100. The discontinuity at the beginning of the waveforms (which start at 12.5ms rather than zero) is because of the notch filter. Because it has a high Q, the waveform suffers from considerable transient distortion when the signal is applied, and the last remainder is visible on the trace.

Using the formula above, distortion can be calculated ...

THD% = ( 408.1uV / 705mV ) x 100 = 0.058%     (odd-order)
THD% = ( 330.5uV / 705mV ) x 100 = 0.047%     (even-order)

Distortion was created by the simple circuit shown below. Since the graph shown is from a simulator, it was necessary to add distortion because the simulator's output waveform is a perfect sinewave, and has zero distortion.

Figure 7
Figure 7 - Distortion Generator

With an applied signal of 1V peak (707mV RMS), the distortion added is quite small as shown above. This is especially true when you consider that the signal is limited by a 10 ohm resistor, and the diode distortion is applied via the 1k resistor. This amount of distortion is inaudible on a sinewave, and it will definitely be inaudible with a music signal (of the same peak amplitude of course).

When you use a real (as opposed to simulated) sinewave generator, R1 isn't necessary and R2 will need to be increased in value. This is because most signal generators have an output impedance of between 50 and 600 ohms. Most sine oscillators will have distortion figures that are well within the measurement range of the distortion analyser, so expecting to be able to measure much below around 0.02% THD is generally unrealistic.


IndexProjects Index
ESP HomeMain Index

Copyright Notice. This article, including but not limited to all text and diagrams, is the intellectual property of Rod Elliott, and is Copyright (c) 1999. Reproduction or re-publication by any means whatsoever, whether electronic, mechanical or electro- mechanical, is strictly prohibited under International Copyright laws. The author (Rod Elliott) grants the reader the right to use this information for personal use only, and further allows that one (1) copy may be made for reference while constructing the project. Commercial use is prohibited without express written authorisation from Rod Elliott.
Page Created and Copyright (c) 12 Feb 2000./ Updated 23 Dec 2007 - added figures 6 and 7 and accompanying text.