Model notes
Ported from ADCToolbox 0.9.1. dout/: analyze_bit_activity, analyze_overflow, analyze_weight_radix, analyze_enob_sweep. calibration/: calibrate_weight_sine. spectrum/: analyze_spectrum. This page is the interactive companion to its examples exp_d11, exp_d12, exp_d13 and exp_d14; python/adc_reading_the_bits.py runs ADCToolbox on the same bits and every number here matches it.
The converter. The examples' SAR loop: each comparison asks whether what is left of the input is above zero, and its capacitor's share of the range is taken off or put back. The binary array is exp_d11's, 1024 down to 2, 1, 1; the redundant one repeats the 256, as in exp_d14; the sub-radix one steps down by about 1.8, as in exp_d13. The last comparison moves nothing, so the last weight comes out half the one before it.
Bit activity. A full-scale sine around mid-scale sets every bit half the time. An offset tilts that, most in the middle bits, where the code spends its time near the offset. A bit that sometimes reads 0 when it should read 1, exp_d11's poor contact on the second-last bit, sits below 50 on its own.
Where each segment sits. analyze_overflow takes the bits from one bit down to the LSB, weights them, and divides by their weights' total: a number from 0 to 1 for every sample. A redundant comparison keeps its segment away from both ends, and the gap is its margin. The orange figures are the percent of samples on 0 and on 1: at the top bit that is the input clipping, while at the LSB it is half the samples each way, since one bit is always at an end.
The weights. calibrate_weight_sine finds the weights that make the bits add up to a sine. From a good capture they are the capacitors, in units of the tone, and their ratios are the array's radix, which analyze_weight_radix reads along with the resolution the weights span. A clipped sine is not a sine: the fit bends the weights to explain the flat tops, and the ratios drift from the capacitors'.
ENOB against bits. analyze_enob_sweep calibrates once with every bit, then keeps only the first one, two, three of them. Each bit should add about one effective bit until the noise has the rest; one that adds nothing is noise itself, like the random LSB of exp_d12, or broken. The dashed line is all the bits with the capacitors as weights.
The record. 8192 samples at 1 GS/s and a 299.9 MHz tone, bin 2457, on a ±1 range. The noise is added before the SAR loop and the faults after it. Every ENOB here comes from analyze_spectrum with the Hamming window and the side bins it detects by itself, as analyze_enob_sweep leaves them.