Laboratory: Filter method for measuring the harmonic distortion coefficient
This article discusses the measurement of such a parameter of audio path components as the Total Harmonic Distortion (THD), with a sensitivity that goes beyond the capabilities of any commercially available ADCs/DACs.

Basic Terms
Harmonic distortion is a type of nonlinear distortion measured with a single-tone input signal.
Nonlinear distortion is the appearance of harmonic components (integer multiples of the fundamental frequency) in the output signal spectrum that are absent in the input signal.
Harmonic distortion is expressed either as a percentage (linear scale) or in decibels (logarithmic scale). High levels of distortion are conveniently expressed in percentages, while low levels are expressed in decibels.
The relationship between these scales is as follows:
$dB=20\ast\log_{10}\frac{\%}{100}$
$\%=100\ast10^{\frac{dB}{20}}$
Examples:
1% = -40 dB
0.01% = -80 dB
0.001% = -100 dB
0.0001% = -120 dB
0.0000017783% = -155 dB
The Total Harmonic Distortion (THD) is defined as the ratio of the root mean square (RMS) value of the harmonic voltages to the voltage of the fundamental tone.
$Kг_{\%}=100\ast\frac{\sqrt{{U_2}^{2}+{U_3}^{2}+...{U_n}^{2}}}{U_1}$
U1 – voltage of the fundamental tone, U2, U3 … Un – voltages of the harmonics.
The same formula in decibels:
$Kг_{dB}=20\ast\log_{10}\frac{\sqrt{10^{\frac{dB_2}{10}}+10^{\frac{dB_3}{10}}+..10^{\frac{dB_n}{10}}}}{10^{\frac{dB_1}{20}}}$
Band-Pass Filter (BPF) – an analog filter that isolates a narrow frequency band (in our case, a single frequency) to which it is tuned, while attenuating all other frequencies.
Band-Stop Filter (BSF) – an analog filter that attenuates a narrow frequency band (in our case, a single frequency) to which it is tuned, while leaving all other frequencies unchanged.
Measurement Schemes
The essence of the filter method lies in the fact that, using analog filters (band-pass and band-stop), we can separate the fundamental tone from its harmonics.
Let us suppose we want to measure the THD at the input of an ADC. To do this, a pure sinusoidal signal with no harmonic distortion must be applied to the ADC input (the distortion level should be at least an order of magnitude lower than the expected measurement result). A single-tone sinusoidal signal is generated using a DAC, then cleaned of harmonics with an analog band-pass filter (or two, if necessary), fed into the ADC input, the spectrum is analyzed, and the THD is calculated using the formula given above.

Let us suppose we want to measure the THD of a DAC output signal. In this case, we generate a single-tone signal through the DAC under test, then pass it through a band-stop filter that suppresses the fundamental tone by a significant amount (50 dB or more). The remaining signal is fed into the ADC, and the spectrum is analyzed. Since the fundamental tone is suppressed, the harmonics introduced by the ADC (related to the fundamental) become negligible. Before applying the THD calculation formula, the levels of the signal’s spectral components must be corrected by the inverse of the band-stop filter’s frequency response. For example, if the fundamental is attenuated by 50 dB, we add 50 dB back to it; if the second harmonic is amplified by 5 dB, we subtract 5 dB from it, and so on.

To measure the THD of an amplifier, the full set of filters must be used. The DAC-generated signal is first cleaned using a band-pass filter, then fed into the amplifier, after which the amplifier output is passed through a band-stop filter to suppress the fundamental tone. The remaining signal is then fed into the ADC and analyzed. Corrections are applied in the same way as in the previous case.

Our Equipment
We have two active band-pass filters at 20 kHz, one active band-stop filter at 20 kHz, and one passive band-stop filter at 20 kHz with a post-amplifier.



Our active filters are built on the basis of a super-linear amplifier core with an inherent THD of ≤ –160 dB. At this point, we are not ready to publish the complete schematics; instead, we will provide only the part where the amplifier core is shown as a functional block. All other components are accurate, and the models attached to this article are simulated in LTSpice.
Simplified schematic of the active band-pass filter:

Calculated frequency response of the band-pass filter:

The second harmonic is attenuated by –36.4 dB, and the third harmonic by –41.4 dB.
If two band-pass filters are connected in series:

The second harmonic is attenuated by –72.9 dB, and the third harmonic by –82.8 dB.
The measured frequency response of the band-pass filters at the control points almost completely matches the calculated values (20 kHz = –0.21 dB, 40 kHz = –36.5 dB, 60 kHz = –41.5 dB).
The filter is built using the Tow-Thomas topology and requires three amplifier cores in an inverting configuration. This topology is more convenient than MFB for high Q-factor values.
The band-pass filter is tuned by a single parameter: frequency. Tuning is performed by maximizing the 20 kHz signal at the output. Rough adjustment is acceptable, since the frequency response is not very sharp.
Simplified schematic of the active band-stop filter:

It consists of an input buffer, a band-pass filter based on the MFB topology, and a differential amplifier that subtracts the fundamental tone from the input signal. Three amplifier cores are also required.
Calculated frequency response of the active band-stop filter:

The fundamental tone is suppressed by > 100 dB, the second harmonic by –0.65 dB, and the third harmonic by –0.22 dB.
This represents an ideally tuned filter. In practice, the band-stop filter requires very precise adjustment of two parameters simultaneously, which directly determines the practically achievable depth of fundamental suppression.
Our measured result was: 20 kHz = –66.5 dB, 40 kHz = –0.64 dB, 60 kHz = –0.21 dB.
Complete schematic of the passive band-stop filter:

It is a 2-T bridge made entirely of passive components, followed by an amplification stage with a gain of +20 dB.
Calculated frequency response of the passive band-stop filter:

The fundamental tone is suppressed by > 100 dB, the second harmonic is amplified by +6 dB, and the third by +10.67 dB.
This filter also requires very precise tuning of two parameters, which makes the practically achievable suppression depth significantly lower than the theoretical value.
Our measured result was: 20 kHz = –69.3 dB, 40 kHz = +5.1 dB, 60 kHz = +9.4 dB.
Considering the gain of the useful signal, the equivalent suppression of the fundamental tone is –74.4 dB, which is noticeably better than that of the active filter.
Advantages of the passive filter: no need for ultra-linear amplification elements and the ability to handle high-amplitude input signals.
Disadvantages: the frequency response depends on the source resistance, and there is significant non-uniformity of the frequency response within the useful signal band.
Measuring a Signal Below the Noise Floor
It is commonly believed that the lower limit of measuring weak signals is restricted by the noise level of our ADC and the amplifiers preceding it. However, this does not apply to periodic signals, which can be reliably detected at levels an order of magnitude below the noise floor, provided that a sufficiently long portion of the signal is analyzed. The noise resolution improves proportionally to the square root of the averaging time. For example, by increasing the measurement time by a factor of 100, the noise floor can be lowered by 20 dB.
Put simply, it works like this: a periodic signal remains identical in each period, while noise is always random. If a noisy signal is added to itself N times, the signal amplitude increases N times, while the noise amplitude increases only √N times (since the random signs of noise components cause them to partially cancel out). As a result, the signal-to-noise ratio increases by √N.
Now let’s move on to practice. We conduct an experiment: a 20 kHz sinusoidal signal with an amplitude of 0.1 V is generated, then attenuated by 120 dB using a voltage divider, and fed into the input of a Lynx Hilo ADC.

The voltage divider is two-stage, in order to reduce the influence of parasitic capacitance of the resistors and the circuit layout. It was assembled on a breadboard using 0.1% thin-film SMD resistors in 0805 package size.
The calculated signal level after the voltage divider is 99.205 nV, which corresponds to –137.85 dBu. The input sensitivity of the Hilo is set to +18 dBu. Therefore, the resulting signal level at the ADC input is: –137.85 dBu – 18 dBu = –155.85 dBFS, with the specified input signal-to-noise ratio being 118 dB. Clearly, the signal lies 37.85 dB below the noise floor. For reference, the theoretical dynamic range of a 24-bit ADC is 146.26 dB (formula ). Our signal is not only below the noise floor but also below the minimum quantization step. Nevertheless, we will attempt to observe it.
The signal will be analyzed using SpectraPLUS-SC 5.3.1.2.
Settings: Sample Rate = 192 kHz, 24-bit, mono, FFT size = 4096.
The frequency range from 5 to 40 kHz is displayed, with a marker set at 20 kHz. At first glance, nothing is visible at all — just solid noise.
Now let’s increase the FFT size to 1,048,576 (the maximum in this program). This will improve both frequency resolution and noise resolution. According to theory, this should lower the noise floor by $20\ast\log_{10}\sqrt{\frac{1048576}{4096}} = 24.082dB$

The observed result looks very much like what theory predicts. And lo and behold, we can just barely see our signal, and its level appears close to the expected value.
Let’s try to further improve the noise resolution by enabling averaging of the measurement result 100 times.

The noise floor has dropped below –160 dB; our signal is clearly visible, and the noise has disappeared from the screen.
Now let’s zoom in on the region of interest by displaying the plot at a larger scale:

Both the signal and the noise are clearly visible. There is no doubt that this is indeed the signal, and not a random measurement artifact.
How is it possible at all to detect a signal that is smaller than the least significant bit (LSB) of the ADC? If the signal were noise-free (and the noise also below the LSB), it would be impossible. But in a noisy signal, the useful component, when mixed with stronger noise, alters the probability of a “0” or “1” appearing in the least significant bit, making it not entirely random. Over a sufficiently long observation period, these statistical deviations become detectable.
This method does have limitations. One cannot increase the observation time indefinitely in order to detect infinitely weak signals, because any real periodic signal does not repeat with perfect accuracy. It has phase noise, and its frequency drifts slightly over time. All of this smears the spectrum and reduces the efficiency of accumulation. On the graph above, this is reflected in a 0.2 dB signal loss (observed –156.05 dB, while the expected value was –155.85 dB). With an ADC that has higher jitter than the Lynx Hilo, the result would be worse.
Verification of the Measurement System Capabilities
To evaluate the limits of our measurement setup, we will assemble the following chain:

Between the DAC and ADC—represented here by the Lynx Hilo output and input—we insert two band-pass filters and one band-stop filter in series. Two band-pass filters are used to more effectively suppress the DAC’s second harmonic. A single filter providing 36 dB suppression of the second harmonic may be insufficient to reach the limit (the DAC’s expected THD is on the order of –110 dB). One band-stop filter is sufficient, since its fundamental suppression depth is > 60 dB.
Settings: Sample Rate = 192 kHz, 24-bit, mono, FFT size = 1,048,576.
I/O level = +6 dBV (corresponds to 2 V RMS, the standard signal level for unbalanced outputs of consumer/music DACs), active band-stop filter used.

The same plot, but without markers, so that the signal is easier to see:

It is not possible to discern the second and third harmonics, as their levels are below –155 dB and –147 dB, respectively.
Now let’s enable 100× averaging and greatly zoom into the region where the second harmonic is expected to appear:


The second harmonic appears at –152 dB; the third is not visible.
Applying corrections for the band-stop filter’s frequency response, we obtain that the measurement limit for a signal level of +6 dBV (2 V RMS) is at least –151.36 dB for the second harmonic and –146.8 dB for the third.
We will repeat the measurements by applying a signal level of +20 dBu (7.746 V RMS), the maximum permissible for the active filters:

The second harmonic is at –145.15 dB, and a noticeable third harmonic appears at –136.15 dB. After applying corrections, the measurement limits are –144.5 dB and –136 dB, respectively.
Now let’s repeat the measurements using the passive band-stop filter.
Signal level: +6 dBV (2 V RMS):

Measurement limit with corrections: –151 dB and –156 dB.
Signal +20 dBu (7.746 V RMS):

Measurement limit with corrections: –131.4 dB and –146 dB.
Measuring THD at the Input of the Lynx Hilo ADC
We will measure the THD of the Lynx Hilo input by applying a 20 kHz signal cleaned of harmonics with two band-pass filters and calculating THD using the formula from the beginning of the article. No corrections are needed, since the band-stop filter is not used.
Level: +6 dBV:

$Kг=20\ast\log_{10}\frac{\sqrt{10^{\frac{-126.56}{10}}+10^{\frac{-119.83}{10}}}}{10^{\frac{-1.42}{20}}}=-117.57\ dB$, или 0.0001323%
Level: +20 dBu:

THD = –113 dB, or 0.0002234%.
Измерение КГИ выхода ЦАП Lynx Hilo:
We will measure the THD of the Lynx Hilo output by sending a 20 kHz signal from its output through the band-stop filter to the input. Before calculating THD, the levels of all harmonics must be corrected for the band-stop filter’s frequency response. Let’s proceed.
Level: +6 dBV:

$Kг=20\ast\log_{10}\frac{\sqrt{10^{\frac{-116.21+0.64}{10}}+10^{\frac{-115.11+0.21}{10}}}}{10^{\frac{-68.66+66.5}{20}}}=-110.05\ dB$, или 0.0003144%.
Level: +20 dBu:

THD = –109.57 dB, or 0.0003323%.
Measuring THD of the SCIBER Enflow Headphone Amplifier
Measurement conditions: input signal +0 dBV (1 V RMS, corresponding to the nominal sensitivity), applied to the unbalanced input; input sensitivity set to 0 dB; volume control at maximum; load of 30 Ω. The output signal level was 8 V RMS, delivering 2.13 W into the load.

After applying all corrections and calculating using the formula given above, we obtain THD = –120.63 dB, or 0.000093%.
Now let’s reduce the volume so that the output signal is 2 V RMS (delivering 133 mW into the load), which corresponds to listening to music at a medium volume level:

THD = –123.47 dB, or 0.000067%. Now let’s reduce the volume further to obtain an output signal of 0.1 V (listening at a low volume level):
Here the harmonics are not visible; they’ve sunk into the noise. It was not possible to measure the exact THD value, but it is at least no worse than –120.68 dB, or 0.000093%.
Conclusion
This article has demonstrated the possibility of measuring ultra-low THD values, beyond the capabilities of any commercially available DACs and ADCs, as well as the ability to detect harmonics lying below the noise floor. The filter method can be applied across a wide frequency range, from tens of hertz to hundreds of kilohertz. The main drawback of the method is that the filters are built for fixed frequencies. However, for measuring audio amplifiers, the most representative THD measurement is at 20 kHz, where it is usually sufficient to account only for the second harmonic (optionally, the third). The THD of amplification devices generally increases with frequency due to decreasing loop gain.
That concludes this article. Stay tuned for the upcoming piece on measuring intermodulation distortion.