This page explains how Phonalyser 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 preferences and the in-app help.
The signal path
Everything in Phonalyser 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.
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? 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.
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 the FFT analyser later de-embeds.
Full theory chapters
Each chapter is a page in this guide (the same engineering theory is also served inside the app and the web version):
- Audio backend - the bit-exact bridge to the sound hardware: what it guarantees, how capture and playback sessions 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.
- DAC pre-distortion - cancelling the converter's own harmonics: why the twin-T notch is mandatory, why its drift forces a manual fundamental, and the dual notch for two-tone IMD.
- 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.
Design themes you will meet everywhere
- Coherent averaging digs below the single-shot floor - and noise sets the limit. Every deep measurement sums phase-aligned blocks so the tone holds while the noise falls as 1/√n. The floor you reach is set by the bin signal-to-noise ratio and the effective number of averages - not by any trick.
- Measure the reference afresh, never integrate it. Phase references and frequency locks are read on each block, never carried by a free-running counter. A measured reference averages out; an integrated one random-walks and slowly de-coheres the tone.
- Drift is a walking phase, not a lost level. Converter clock mismatch and notch-component temperature drift show up as a slow phase walk, which the analysis strips block by block - costing coherence, not magnitude.
- Exact frequencies by integer phase. The DDS accumulator, every harmonic correction tone and the sweep reference are formed by integer multiplication of one master phase, so a tone lands exactly at h·f and never beats against the distortion it measures.
- Windows are chosen for side-lobe margin, not noise. Above each window's recommended overlap every window reaches the same floor in the same wall-clock time, so the choice is about keeping a strong tone's leakage off the faint bins.
- Calibration at the edges, normalised in the middle. ADC and DAC full-scale voltages are applied only at display and output; the signal data stays in normalised units and full precision throughout.