Model notes
Ported from ADCToolbox 0.9.1. spectrum/: analyze_spectrum over several runs, which averages powers, and analyze_spectrum_polar, which averages coherently, both through compute_spectrum with its phase alignment, harmonic bookkeeping and noise-floor estimate. fundamentals/: find_coherent_frequency. This page is the interactive companion to its examples exp_s07, exp_s10, exp_s11 and exp_s12; python/adc_polar_averaging.py runs ADCToolbox on the same samples and every number here matches it.
Averaging powers. Each run's |X|² is averaged bin by bin. The noise floor becomes smoother, not lower: every bin still holds the same noise power on average, so SNR stays where one run put it.
Averaging coherently. Each run's spectrum is first turned so that its fundamental has phase 0, its h-th harmonic by h times that turn, and every other bin by its own fraction of it. Then the complex values are averaged. The tone and its harmonics add up in phase, and the noise, with a new phase every run, cancels: SNR gains 10 dB for every tenfold increase in runs. Distortion does not average away, so SNDR stops at the harmonics.
The polar plot. The coherently averaged spectrum, each bin at its phase, clockwise from the top, and at its level, outward from −120 dB. A static curve, x + k2x² + k3x³, puts HD2 and HD3 at 0°, and a negative k3 turns HD3 to 180°, wherever the tone is.
A memory. In exp_s11's converter, part of each output comes from the previous sample's coarse 4-bit code. That part is distortion delayed by one sample, and a delay turns harmonic h by h·360°·fin/fs, so its spokes swing as the input moves. The magnitude spectrum of a memory looks like any other distortion; its phases do not.
The record. 1024 samples at 100 MHz, a 0.499 V sine at a new random phase in each run (the same hundred phases every time), the rectangular window the polar plot uses, and harmonics 2 to 5. The memory converter works on the sine plus 0.5 V, as in exp_s11.