Series

Sample rate — the series

5 essays on one idea, from the one that introduces it to the one that assumes the rest.
  1. A 9.0 kHz input sampled at 10 kHz arrives as 1.0 kHz. computed by solving, not by drawing. The dots are the samples. The input at 9.00 kHz is above half the 10 kHz rate, and every dot also lies on the 1.00 kHz curve drawn beside it — the two sample sequences differ by 9.3e-15, which is the arithmetic and not a small effect. Nothing is attenuated and nothing is distorted: the samples are the samples of a different signal, at full amplitude, and there is no measurement of them that could say which one was there.

    The frequency a sample rate invents

    Every other boundary in this field is a model getting gradually worse. This one has no gradient at all: below half the sample rate a set of samples has one sinusoid through it, above half the sample rate it has another, and the two sets of numbers are identical to three parts in ten thousand billion. Nothing is attenuated, nothing is distorted, and there is no measurement of the samples that could say which signal was there.

    part 1 · digital
  2. What the reconstruction returns, either side of 5.0 kHz. computed by solving, not by drawing. The Whittaker–Shannon sum is evaluated on the samples and compared with two things: the signal that was sampled, and the frequency the samples report. Below 5.00 kHz these are the same curve and the error is 4.88e-3 — the truncation of the sum at sixty-four samples either side, and nothing else. Above it they part: at 9.00 kHz the reconstruction is 1.59e-3 from the alias and 2.000 from the input. The small number is the interesting one. A reconstruction cannot be improved into the right answer, because it is already an exact answer to a different question.

    An exact answer to a different question

    The reconstruction that turns samples back into a signal is normally introduced as the thing that recovers what was there. Measured on both sides of half the sample rate it does something more interesting than failing: above the boundary it returns the alias to 1.6 parts in a thousand, which is the same accuracy it returns the input with below the boundary, and it is wrong about the input by twice the amplitude. Its error is not a degradation. It is exactness about something else.

    part 2 · digital
  3. A sinusoid sampled 8 times a cycle, at the phase that puts its peak between two samples. computed by solving, not by drawing: the samples of a unit sinusoid at 8 a cycle, synchronous, at the sampling phase that hides its peak worst. 8 samples a cycle is 4 times the Nyquist rate and holds the waveform completely; the largest sample is still 0.9239, 7.61% below the peak, which is 1 − cos(π/8). Read straight off the samples the peak needs 22.2 samples a cycle for 1% and 70.2 for 0.1%.

    The rate each reading needs

    Twice the frequency is the rate at which a set of samples holds a sinusoid completely, and it is not the rate at which any particular property can be read off them. Eight samples a cycle — four times the Nyquist rate — hold the waveform, and their largest is still 7.61% below the peak; the largest sample needs 22.2 a cycle for 1% and 70.2 for 0.1%, because its error falls only as the square of the rate. A parabola through the three largest gets 1% at 8. A zero crossing found by a straight line between two samples is a hundredth of a cycle right at 5 a cycle, its error falling as the cube, because a sine is straight at its zero. The rms of whole cycles is exact from three a cycle — and at exactly two it reads anything from zero to √2. A slow rate with a long record of a steady signal does what a fast rate does, once the samples have slipped a whole interval past it: 42 cycles at 4.0236 a cycle.

    part 3 · digital
  4. Three waveforms at 16 samples a period, sampled at the worst instant: the largest sample of a sine is 1.92% short, of a triangle 12.5%, of a clipped sine 0. computed by solving, not by drawing: three waveforms with the same period and the same peak, sampled 16 times a period at the phase that puts the peak midway between two samples (dots). The sine leaves its peak as the square of the time, the triangle in proportion to it, and the sine clipped at nine-tenths of its height does not leave it at all for as long as it stays flat. The largest sample therefore falls short by 1.92% for the sine, 12.5% for the triangle, 0 for the clipped sine, at one rate, for three waveforms with the same period.

    The peak that is a corner

    The largest of a set of samples falls short of a sine wave's peak as the square of the sample interval, and that law belongs to the sine. Measured over every sampling phase, a triangle's corner falls short as the first power, 12.5 per cent at sixteen samples a period against the sine's 1.92, a peak whose curvature vanishes as the fourth power, and a sine clipped at nine-tenths of its height reads exactly above seven samples a period. The order in which a waveform leaves its peak is the whole of the law, and it also fixes how much better the average reading is than the worst. A real corner is round at some scale, so the law bends where the samples resolve its top harmonic, and a parabola through three samples helps a round peak, barely touches a corner and makes a flat one worse.

    part 4 · digital
  5. A Gaussian edge read at 3 samples per rise, at the worst sampling phase: straight chords between the samples say the rise is 8.78% from its true value. computed by solving, not by drawing: a Gaussian edge (solid), its samples at 3 per 10–90% rise at the sampling phase that reads worst (dots), and the straight lines an instrument's linear interpolation draws through them (dashed). The chord crosses 10 and 90 per cent earlier and later than the edge does, because a Gaussian edge curves in opposite senses at the two thresholds. The reading is 1.0878 rises against 1.

    The samples a rise time needs

    A rise time is read from two thresholds, and an instrument that draws straight chords between its samples is wrong at each by an amount that goes as the square of the interval. For a Gaussian edge at the worst sampling phase that is 5.02 per cent at four samples per rise and 0.818 at ten; the rule of thumb of three to five is a five per cent rule, and one per cent takes nine. The reading is not monotonic in the rate: above 20.9 per rise a first-order edge reads exactly at whole numbers and 0.046 per cent at 24.5, because its two errors subtract at one phase, and a Gaussian edge reads worse there because its two add. Reconstructing before reading needs 1.87 per rise for one per cent, and at four times the edge's 3 dB bandwidth the reading is still 11.7 per cent out.

    part 5 · digital

All series