Series

Reconstruction — the series

7 essays on one idea, from the one that introduces it to the one that assumes the rest.
  1. The droop a zero-order hold imposes at 48 kHz. computed by solving, not by drawing. Holding each sample for a clock period convolves the output with a rectangle, so the spectrum is multiplied by a sinc: -0.143 dB down at a tenth of the sample rate, -0.912 at a quarter and -3.922 at half — which is exactly 20 log(2/π) and contains no design decision at all. The dots are the amplitude of the fundamental read out of the transform of the staircase itself, agreeing with the closed form to 0.008%. There is also half a sample of delay, 10.417 µs here, which is the reason a held reconstruction is not a droopy copy of the signal but a droopy copy that has moved.

    The staircase on the way out

    A converter does not emit impulses. It holds each sample for a whole clock period, which is a convolution with a rectangle and therefore a multiplication by a sinc — 0.14 dB down at a tenth of the sample rate, 0.91 at a quarter, and 3.92 at half, which is exactly 20 log(2/π). Nobody chose that droop and it is nearly eight times the half-decibel ripple of a Chebyshev passband. Measured on the transform of the staircase itself, it agrees with the closed form to 0.008%.

    part 1 · digital
  2. The images a zero-order hold leaves, at 0.222 of the sample rate. computed by solving, not by drawing. A 10.67 kHz tone held at 48 kHz, with every line read out of a transform of the staircase itself. The sampled spectrum repeats at every multiple of the clock and the hold multiplies all of it by one sinc, so each image survives scaled by the sinc at its own frequency: the fundamental at -0.72 dB, the largest image (1fs−f, 37.3 kHz) at -11.60 dB, which is 10.88 dB of rejection. The sinc's nulls are exactly at the multiples of the clock and the two first-order images straddle the first of them without touching it — so the hold's rejection is 25.6 dB for a tone at 0.05 fs and 1.74 dB for one at 0.45, falling to nothing at half the clock. Measured and closed form agree to 0.026%.

    The nulls are where nothing is

    A zero-order hold multiplies the whole repeated spectrum by one sinc, so it attenuates every image at the image's own frequency and its nulls land exactly on the multiples of the clock. Nothing is ever at a null: the two first-order images straddle it, and the closer the signal comes to half the clock the closer they come to each other. The hold gives 25.6 dB of image rejection to a tone at a twentieth of the clock, 1.74 dB at 0.45 of it, and nothing at all at half — which is the frequency the band most needs it at.

    part 2 · digital
  3. What flatness costs, in the two places it can be bought. computed by solving, not by drawing. The hold's sinc across a band ending at 0.40 of the sample rate, and the same sinc with a one-zero one-pole shelf fitted to its reciprocal over that band. The droop to be removed is 2.420 dB. Corrected digitally the band comes flat exactly and the flat level sits 2.420 dB below what the uncorrected converter gave at direct current, because nothing may exceed full scale — the price is the disease. Corrected in analogue the band comes flat to 0.2308 dB and the shelf is still rising where the images are, so the worst image at 0.60 fs comes up by 3.799 dB, which is 1.57 times the droop it removed — and that boost is between 3.4 and 4.7 dB at every band on the slider, while the droop it cures runs from 0.58 to 3.75. Neither correction changes the signal-to-noise ratio, because the droop never cost any.

    Flatness, and the two currencies it is bought in

    The hold's droop takes the signal and everything arriving with it down together, so it costs no signal-to-noise ratio at all — a fact that is never stated and settles what correcting it can possibly be worth. Corrected digitally the price is headroom and is exactly the disease: 2.42 dB of flatness for 2.42 dB of output level. Corrected by an analogue shelf the price is image rejection and is nearly a constant: between 3.4 and 4.7 decibels whatever the band, so it is eight times the droop at a fifth of the clock and nine tenths of it at forty-nine hundredths.

    part 3 · digital
  4. What an oversampling ratio buys, and at two different rates. computed by solving, not by drawing. A 20 kHz band on a 48 kHz base clock, interpolated by ratios from 1 to 64. The hold's droop at the band edge falls with the SQUARE of the ratio — the fitted exponent over six doublings is -2.0113 — from 2.640 dB at the Nyquist rate to 0.0097 at sixteen times it. The nearest image moves out with the FIRST power, exponent 1.0222, from 1.40 times the band edge to 37.4. So one decision buys two things at rates differing by a factor of two in the exponent, and the third quantity — the poles a reconstruction filter needs for sixty decibels — collapses from 20.5 to 3.21 by a ratio of four alone.

    One knob, and the two exponents it turns

    Oversampling is quoted as buying one thing and buys two that improve at different rates. The hold's droop at the band edge falls with the SQUARE of the ratio — fitted exponent −2.011 over six doublings, from 2.640 dB at the Nyquist rate to 0.0097 at sixteen times it — while the nearest image moves out with the first power, exponent 1.022. The third quantity, the poles a reconstruction filter needs for sixty decibels, collapses from 20.5 to 3.21 by a ratio of four alone, because it is a logarithm of the second.

    part 4 · digital
  5. Joining the samples with straight lines squares the hold's sinc: 5.28 dB of droop and 5.8 dB of image rejection, both doubled. computed by solving, not by drawing. A 20 kHz tone on a 48 kHz clock, reconstructed two ways: held for a whole clock period (dashed envelope, open stems) and joined sample to sample by straight lines (solid envelope, filled stems). Every line is read from a transform of that waveform itself. The held one comes out 2.640 dB down and its nearest image 2.92 dB below it; the interpolated one 5.280 dB down with the image 5.85 dB below. A straight line between samples is a triangle two clocks wide, which is a rectangle convolved with itself, so its transform is the sinc squared: every decibel doubles and the nulls stay where they were.

    The pole a straight line is worth

    A converter that joins its samples with straight lines instead of holding each one is convolving with a triangle rather than a rectangle, and its transform is the hold's sinc squared. Every decibel doubles: 5.28 dB of droop at a 20 kHz band edge on a 48 kHz clock instead of 2.64, and 5.85 dB of image rejection instead of 2.92. Both exponents of the oversampling ratio are unchanged. The second sinc is worth exactly one pole of reconstruction filter at every ratio, because a sinc's rejection of the nearest image is twenty times the log of that image's distance from the band edge, identically. A single analogue pole allowed the same droop gives a fraction of that rejection. The price is a whole clock of delay rather than half.

    part 5 · digital
  6. 4 rectangles: the hold's sinc to the power 4, 10.56 dB of droop and the first image 11.7 dB down. computed by solving, not by drawing. A 20 kHz tone on a 48 kHz clock, reconstructed by a pulse of 4 rectangles convolved together — the hold, the straight line, the quadratic and the cubic B-spline for one to four — with the envelopes of all four drawn and the lines of the 4-rectangle waveform read from its own transform (stems). They agree with the sinc to the 4th power to 0.000 per cent. Droop 10.560 dB; the nearest image 11.69 dB below the signal, 4 times the hold's 2.92. The nulls stay on the multiples of the clock; each rectangle deepens everything else.

    Four rectangles and no filter

    A converter's output pulse can be any number of one-clock rectangles convolved together: one is the hold, two the straight line, four the cubic B-spline. Measured on its own waveform, n rectangles give the hold's sinc to the n-th power to a few parts in ten million, so each one rejects the nearest image by exactly what one analogue pole could at best — and each saves exactly one pole of reconstruction filter until none is left. At the Nyquist rate that is three poles of nineteen and a half, bought with 10.56 dB of droop. From about 2.8 times oversampling the cubic pulse needs no analogue filter at all for 60 dB, for 0.62 dB of droop at four times and two clocks of delay. The cost is that from three rectangles on the output no longer passes through its samples.

    part 6 · digital
  7. With the crossover at 10% of the clock the straight line overshoots 13.7%, the hold with its pole 32.8%. computed by solving, not by drawing, marched at 160 steps a clock. A unit step through a loop whose plant is an integrator crossing over at 10% of the sample rate, reconstructed three ways: held (dotted), joined by straight lines (solid), and held then passed through the analogue pole that attenuates the nearest image, at 90% of the clock, exactly as much as the straight line's second sinc does (dashed) — a pole at 9.90% of the clock, at the crossover itself. Overshoot: 0.0%, 13.7% and 32.8%. The straight line buys the same image rejection for half a clock of delay; the pole buys it for forty-five degrees.

    Half a clock against a pole

    Inside a digitally controlled loop a converter's delay is phase at the crossover, and a straight-line output pays one more half clock than a hold: 180 degrees times the crossover over the clock. The analogue pole that rejects the nearest image as much as the straight line's second sinc does turns out to sit at the crossover itself — 0.990 of it when the loop crosses over at a tenth of its clock, sinc(r) of it in general — so it costs forty-five degrees however slow the loop is. By the phase estimate the half clock is the cheaper filter below 26% of the clock. Marched as a sampled loop the answer is 17.6%, and at a tenth of the clock a step overshoots 13.7% through the straight line against 32.8% through the hold and its pole, for the same image rejection measured on both waveforms.

    part 7 · digital

All series