◀ Back to contents

Theory of operation

This chapter explains how Phonalyser.web works inside - what actually happens to your signal between the moment it is synthesized and the moment a THD number appears on screen. It is written for the measurement user: you don't need to know anything about software development to follow it. The user-facing controls are documented in the module chapters (Generator, Oscilloscope, FFT analyser).

A tip of the hat. Phonalyser.web owes its existence to REW (Room EQ Wizard) - working with that excellent tool inspired the author to build a measurement application of his own, aiming at even more comprehensive and more precise distortion and frequency-response measurement (see the FFT chapter for what "precise" means here).

The signal path

Everything in Phonalyser.web hangs off one loop: synthesized samples leave through the DAC, pass through the device under test, return through the ADC, and are distributed to the analysis views through a shared ring buffer.

Signal generator DDS synthesis Quantizer TPDF dither + PCM Playback engine audio backend DAC output device DUT device under test ADC input device Capture engine audio backend Capture session PCM -> [-1,+1] Ring buffer last 22 s, stereo Oscilloscope reads "now" FFT analyser reads a gap-free stream Frequency response exclusive sweep capture one independent read cursor per consumer

The modules and what they are for

Signal generator - the stimulus source. Produces calibrated test signals: a spectrally pure sine for distortion measurements, two tones for intermodulation, white/pink noise, linear and logarithmic sweeps, and a compensated sine that actively cancels the playback chain's own distortion so the DUT receives a cleaner signal than the DAC alone can produce. Output level is set in volts, against the DAC calibration.

Oscilloscope - the time-domain view. This is where you look first: is the signal there at all, is it clipping, does it carry DC or mains hum, what are Vpp / Vrms / frequency? Triggering, per-channel scaling and a running measurement table work like on a bench scope. A spectral number is only worth trusting after the time-domain picture looks sane.

FFT analyser - the frequency-domain workhorse. Shows the spectrum and measures THD, THD+N, SNR, SINAD/ENOB and the individual harmonics; in two-tone mode the intermodulation products. Coherent averaging digs signals out far below the single-shot noise floor; mains rejection, calibration de-embedding and a manual fundamental reference handle real-world measurement setups (notch filters, attenuators, known source levels).

Frequency response - the swept measurement. Plays a logarithmic sweep through the DUT and computes its transfer function - magnitude and phase across the whole band in seconds. Results can be compared against RIAA / IEC curves or saved as calibration files that the FFT analyser later de-embeds from its own measurements.

Underneath all of them sit the two infrastructure layers this chapter describes: the audio backend (the bit-exact bridge to the sound hardware) and the ring buffer (the shared memory that lets every view read the same capture independently).

Chapters

Audio backend - the bit-exact bridge between Phonalyser.web and the sound hardware (including the direct QA40x analyzer backend): what it guarantees, how a capture and a playback session work, who shares the devices Ring buffer & consumers - the shared 22-second capture memory, independent read cursors, and what happens when a reader falls behind Signal generator - direct digital synthesis: the phase accumulator, every waveform, sweeps, distortion compensation, amplitude calibration and dither Oscilloscope - conditioning, triggering, and how the level / frequency numbers are measured; the frequency-tracked mains comb FFT analyser - coherent averaging and sub-bin de-rotation, glitch rejection, THD / SNR / SINAD / ENOB, two-tone intermodulation De-rotation accuracy - how precisely the per-block rotation angle is known, why its error does not accumulate over hours-long averages, and how overlap and window choice set the floor reached per unit time DAC pre-distortion - cancelling the converter's own harmonics: why the twin-T notch is mandatory, why its temperature drift forces a manual fundamental, how deep coherent averaging makes the correction trustworthy, and the dual twin-T notch for two-tone IMD measurement Frequency response - Farina log-sweep deconvolution, transport-delay removal, smoothing, and calibration de-embedding Tune-notch measurement - tuning a passive twin-T notch live: a looping sweep whose power-of-two period makes the transform shift-invariant, so the null tracks with no trigger Algorithm reference - catalogue of every named algorithm in the instrument, linking each to the chapter that explains it and to the full engineering document

Further reading

FFT analysis essentials - summary of an excellent external guide (windows, leakage, resolution, averaging), with a link to the original The exponential sine sweep in practice - summary of a hands-on article about the Farina measurement method, with links to the original and the paper

Design themes you will meet everywhere