← Back to ADM

The method behind ADM

How one exponential sweep gives ADM the impulse response of every harmonic distortion order, and what limits how fast it can update.

Why a single THD number is not enough

Total Harmonic Distortion is the traditional way to quantify non-linearity. It is measured with a pure tone at one frequency and one level, and it collapses everything into one number. That hides a lot:

ADM measures the thing THD summarizes: the frequency response of each harmonic distortion order across the whole audio band.

The device model

ADM treats the device under test as a non-linear system with an input x(t)x(t) and an output y(t)y(t). Each order nn of non-linearity has its own impulse response hn(t)h_n(t), and the captured signal is

y(t)=∑n=1N(xn⊗hn)(t)+noisey(t) = \sum_{n=1}^{N} \big(x^{n} \otimes h_n\big)(t) + \text{noise}

Here h1h_1 is the ordinary linear impulse response, and h2,h3,…h_2, h_3, \dots describe how the device generates the 2nd, 3rd, … harmonics. The goal of the measurement is to recover all of them from a single capture.

One sweep separates the orders in time

The excitation is an exponential sine sweep that moves from f1f_1 to f2f_2 in TT seconds. Its instantaneous frequency is

f(t)=f1 et/L,L=Tln⁡(f2/f1)f(t) = f_1\, e^{t/L}, \qquad L = \frac{T}{\ln(f_2/f_1)}

When this sweep passes through a non-linear device, the nn-th harmonic it generates behaves like a copy of the sweep that started earlier. After deconvolution with the sweep’s inverse filter, the energy of every order collapses into its own impulse response, and these responses sit at fixed, predictable distances before the linear response:

Δtn=Lln⁡n=T ln⁡nln⁡(f2/f1)\Delta t_n = L \ln n = T\,\frac{\ln n}{\ln(f_2/f_1)}

Because those positions are known in advance, ADM can place a time window around each one and cut the responses apart. Taking the FFT of each window gives the frequency response of that harmonic order.

For a 0.5 s sweep from 20 Hz to 20 kHz the expected positions are:

OrderDistance before h1h_1Position in the deconvolved signal
h1h_1 (linear)0 ms500.0 ms
h2h_250.2 ms449.8 ms
h3h_379.5 ms420.5 ms
h4h_4100.3 ms399.7 ms
h5h_5116.5 ms383.5 ms
h6h_6129.7 ms370.3 ms

The gap between neighbouring orders shrinks as the order grows, so higher harmonics get smaller and smaller windows.

The residual for higher orders

ADM keeps individual responses for the linear response and orders 2 to 5. For everything above, the windows would become too small to be useful, so ADM extracts one extra segment, called h6+h_{6+}, which runs from the start of the deconvolved signal up to the midpoint between the expected positions of the 5th and 6th orders. It holds the 6th order and every higher order that remains within the record, added together.

This residual is not the 6th harmonic alone. It is best read as an aggregate indicator of high-order distortion: in a nearly linear device it stays near the noise floor, and when high-order distortion is present its level rises.

Two ways to build the sweep

ADM can generate the sweep in two ways, which differ in how they treat phase and bandwidth.

Farina ESSNovák SSS
Starting phaseNeeds a correctionNaturally zero, when f1⋅Lf_1 \cdot L is an integer
Ending phaseArbitrary; the sweep is cut at a zero crossingZero, when f2f_2 is a multiple of f1f_1
Inverse filterIn time: reversal plus an envelopeAnalytical, in the frequency domain
Harmonic bandwidthLimited to f2f_2 for every orderExtended to n⋅f2n \cdot f_2, up to Nyquist
Phase of the harmonicsApproximateExact and independent of the input
FFTs in deconvolution2 (signal and filter)1 (signal only)

In the synchronized method the sweep rate is rounded so that the phase of the nn-th harmonic matches the phase of the sweep, shifted in time. ADM adjusts the duration automatically when this method is selected.

Why the curves can update live

ADM plays the sweep in a loop and records at the same time. Each complete record is handed to a processing thread that deconvolves it, extracts the windows and computes the spectra, while the audio thread keeps running without waiting for it. The result is drawn as soon as it is ready, so the curves follow the device as you change it.

The limit on speed is not the computer. It is the physics of the method.

Sweep length against spectral detail

The window of each harmonic can only be as long as the distance to its neighbours, and that distance is proportional to TT. A shorter sweep therefore means fewer samples per window and a coarser frequency resolution. For the 2nd-order window, with a sweep from 20 Hz to 20 kHz at 48 kHz:

Sweep duration TTWindow lengthWindow durationFrequency scale
10 s≈ 28 170 samples≈ 587 ms≈ 1.7 Hz
2 s≈ 5 632≈ 117 ms≈ 8.5 Hz
1 s≈ 2 814≈ 58.6 ms≈ 17 Hz
0.5 s≈ 1 406≈ 29.3 ms≈ 34 Hz
0.1 s≈ 278≈ 5.8 ms≈ 172 Hz
0.01 s≈ 24≈ 0.5 ms≈ 2 kHz

These are best-case values: windows for higher orders are smaller still, and the longest rows go beyond ADM’s own 5 s limit; they are shown for reference. This is the fundamental trade-off between how fast you want the plot to refresh and how much spectral detail you need. Around half a second is a good compromise for watching a device respond as you adjust it, and longer sweeps give finer detail when you want to examine a curve closely.

Using short sweeps to detect devices that adapt

The sweep methods assume the device behaves the same way for the whole duration of the sweep. A compressor with long attack and release times, a tube amplifier whose bias drifts as it warms up, or an automatic gain control will not satisfy that assumption: the change of state ends up recorded as if it were a fixed property of the device.

Because ADM lets you set the sweep duration anywhere from 1 ms to 5 s, you can use that to your advantage. If the curves change noticeably when you shorten the sweep, the device is adapting over time, and a longer measurement is averaging that drift into the result.

References

Distributed also under pay what you want model.

Every download is free. If these tools are worth something to you, pay whatever you think is fair.

Ko-fi InternationalCafecito Argentina

Payment links coming soon.