Four rectangles and no filter
Assumes: The staircase on the way out · The frequency a sample rate invents
The pole a straight line is worth replaced the converter’s held staircase with straight lines between the samples. A straight line is a triangle two clocks wide, which is a one-clock rectangle convolved with itself, so its transform is the hold’s sinc squared: every decibel of droop and every decibel of image rejection doubled. The part of that result worth carrying was exact. Because , the second sinc rejects the nearest image, relative to the signal, by exactly — which is the most a single analogue pole can ever do there, reached only as its corner goes to zero. The straight line is worth exactly one pole of reconstruction filter at every oversampling ratio, and it pays with a whole clock of delay against the hold’s half.
That essay ended by asking about the next pulse. A rectangle convolved with itself three times is a smooth bell four clocks wide, the cubic B-spline, and by the same argument it should be the sinc to the fourth power and worth three poles over the hold. This essay measures that, asks where the law stops, and finds the point on the oversampling axis at which a long enough pulse leaves no analogue filter to build.
One power of the sinc per rectangle
A pulse of rectangles is the unit rectangle convolved with itself times: one is the hold of the staircase on the way out, two the triangle, three a piecewise quadratic three clocks wide, four a piecewise cubic four clocks wide. Each sample launches one such pulse at its own clock edge, and the output is their sum. Convolution in time is multiplication in frequency, so the output’s spectrum should be the sampled spectrum times the sinc to the -th power.
Built sample by sample as a converter would build it and transformed, the four-rectangle waveform’s lines agree with the fourth power of the sinc to a few parts in ten million — closer than the hold and the straight line agreed with their own closed forms, because a smoother waveform has harmonics that fall faster and fold back less in the finite record. For one and two rectangles the same construction reproduces the staircase and the straight lines of the earlier essays sample for sample, so the three routes are one route checked three times.
The numbers at 20 kHz on a 48 kHz clock follow the law exactly. The hold droops 2.64 dB at the band edge and rejects the nearest image, 28 kHz, by 2.92 dB relative to the signal. Four rectangles droop 10.56 dB and reject it by 11.69: four times each, in decibels. The nulls stay on the multiples of the clock, because every factor of the product is zero there — the nulls the nulls are where nothing is found no image ever sits on — and every other point on the curve deepens. The slider on the figure at the head of the page steps through one to four.
Half a clock for each
The price the magnitude does not show is time.
A pulse of rectangles is symmetric about its middle, clocks after it starts, and a causal converter cannot start it before its sample arrives. So the output lags by clocks, and the figure reads exactly that from the phase of each fundamental: 0.500, 1.000, 1.500 and 2.000 clocks.
The figure also shows the second price, and it is new with the third rectangle. The hold and the straight line are interpolators: at the right instant each reproduces its sample exactly, late. The quadratic and cubic pulses are not. A cubic B-spline is nonzero over four clocks, so at any instant three samples contribute; two clocks after sample was taken the output is , a weighted average, which the figure confirms to rounding. That averaging is the extra droop seen in the spectrum. It is a fixed filter on the sample sequence, which makes it correctable exactly in the digital domain before the converter — the pre-emphasis flatness, and the two currencies it is bought in priced for the hold, at a cost in headroom rather than in signal-to-noise ratio. The correction for a pulse of rectangles has to undo times the hold’s droop, so the headroom it costs grows with the pulse.
Exactly one pole each
The straight line’s one-pole identity generalises without change. Each rectangle multiplies the image’s level relative to the signal by , which is exactly the image’s distance from the band edge. That is a pole’s worth at that distance, so a pulse of rectangles is worth exactly poles over the hold, at every oversampling ratio.
The figure uses the same rule as one knob, and the two exponents it turns: a maximally flat filter gains of rejection per pole at the nearest image, and the pulse’s own rejection is subtracted from the sixty decibels wanted before the filter is sized. Each curve is the hold’s moved down by exactly one pole for each rectangle, and the check is exact, to the ninth decimal, at every one of twenty-five ratios. The law holds until a curve reaches zero. Once a pulse rejects the image by sixty decibels on its own there is no filter left to shorten, and another rectangle buys nothing but droop and delay.
At the Nyquist rate this is not much use, for the reason what the filter in front costs met on the input side, where the clock a filter family demands turned out to be the whole of its price: close to the Nyquist rate every decibel of separation is expensive. The image is only 1.4 times the band edge away, a pole is worth 2.92 dB there, and the hold needs a filter of 19.5 poles. Four rectangles bring that to 16.5. Three poles of nineteen is a small saving, bought with the next section’s bill.
Smoothness, read in the time domain
The one-pole-per-rectangle law has a reading in the waveform that makes it less of a coincidence. A held staircase jumps at every clock edge, and a waveform with jumps has harmonics that fall as the first power of frequency, twenty decibels a decade — which is the sinc’s envelope. A straight-line waveform is continuous but has a corner at every sample, and a waveform whose first derivative jumps has harmonics falling as the square of frequency, forty decibels a decade. The quadratic pulse’s output has a continuous slope and a jump in its curvature, sixty decibels a decade; the cubic’s is continuous through its second derivative, eighty.
So each rectangle adds one continuous derivative to the output and twenty decibels a decade to the fall of its far images, and twenty decibels a decade is what one pole contributes to a filter’s asymptote. The identity at the nearest image and the slope at the far ones are the same fact about smoothness, measured at two distances. It is also why the four-rectangle record agreed with its closed form a thousand times more closely than the staircase did: the finite record folds back whatever lies above its own resolution, and a smoother waveform has less there to fold.
The practical form of the statement is about the converter’s analogue output stage. An output that jumps asks the stage for an unbounded slew rate at every edge and gets a glitch; an output with a continuous slope asks for a bounded one. The longer pulse is kinder to whatever follows the converter as well as quieter in its images, and that is a separate reason, not captured by any of the counts here, to prefer it once the droop is small.
What each rectangle costs
The droop grows with the pulse and falls with the ratio, and the ratio is where the whole trade is decided.
Every rectangle costs one hold’s droop, 2.64 dB at the Nyquist rate, so the cubic pulse there droops 10.56 dB at the band edge — a correction that would have to lift the top of the band by a factor of 3.4 in amplitude, spending that much headroom. At four times oversampling the hold’s droop is 0.156 dB and four rectangles cost 0.622 dB, a correction nobody would notice. At sixteen times four rectangles droop 0.0388 dB, which is already below what most specifications care about uncorrected.
The delay is two clocks of whatever clock is running. At 48 kHz that is 41.7 µs; at 192 kHz, 10.42 µs. So the two costs of a long pulse fall with oversampling at different rates — the droop as the square of the ratio, the delay as its first power — which is the same pair of exponents one knob, and the two exponents it turns found for the hold alone, applied to a pulse times as long.
The pulse that replaces the filter
Setting the two figures beside each other asks a sharper question than whether a longer pulse helps. At each ratio, what is the fewest rectangles that need no analogue filter at all, and what does that pulse cost?
The count is the ceiling of sixty decibels over what one rectangle rejects, and it falls fast as the image moves out. At the Nyquist rate it is 21 rectangles drooping 55.4 dB, which is a description of why nobody reconstructs at the Nyquist rate without a filter. At twice the rate it is six, drooping 3.78 dB. At three and four times it is four — the cubic pulse — drooping 1.11 and 0.62 dB. From six times up three rectangles suffice, and from sixteen times up the straight line alone does it.
So the answer to the question the straight-line essay left is that a longer pulse stops paying at a definite point, and the point is set by the target rather than by the pulse: once reaches the filter is gone, and every rectangle past that is droop and delay with nothing bought. And the pulse that does the whole job gets cheap quickly. The cubic at four times oversampling, 192 kHz for a 20 kHz band, replaces a reconstruction filter entirely for two clocks — 10.4 µs — and a correction of six tenths of a decibel.
The figure counts only the nearest image, and the claim needs one check more. The next images out, either side of twice the clock, sit about twice as far from the band as the nearest does, and each rectangle rejects an image by its own distance ratio in decibels, so a pulse that clears the nearest image by sixty decibels clears the rest by more. The nulls at the clock’s multiples help further; they are exact zeros of every factor.
A worked converter
Take the ordinary case, a 20 kHz audio band reconstructed at 192 kHz, four times a 48 kHz base rate, with sixty decibels wanted at the nearest image, 172 kHz. One rectangle rejects that image by 18.7 dB relative to the signal, and a maximally flat filter gains 18.7 dB a pole there.
Held, the output needs 2.2 poles of analogue filter: a third-order filter, placed to droop as little as possible in the band, plus the hold’s own 0.156 dB, half a clock of delay, 2.6 µs. Joined by straight lines, it needs 1.2 poles, which is a second-order filter, and droops 0.311 dB with a clock of delay, 5.2 µs. The quadratic pulse needs 0.2 of a pole — in practice a single gentle pole well above the band, or nothing if the last two decibels can be found elsewhere — and droops 0.467 dB with 7.8 µs of delay. The cubic needs nothing at all and droops 0.622 dB with 10.4 µs of delay.
So at this rate the whole analogue reconstruction filter is exchanged, pole for rectangle, for six tenths of a decibel of digital correction and eight microseconds. For a playback path that is an easy trade. For a converter inside a control loop, where eight microseconds is phase rather than latency, it is not obviously one, and that is the next question.
What a designer should take
A converter’s pulse length is a filter parameter in its own right, worth exactly one pole of reconstruction filter per rectangle and costing one hold’s droop and half a clock of delay per rectangle. At low oversampling it is a poor trade, since the droop is large and the poles saved are a small fraction of a large filter. From about three times oversampling it is the best trade available: the cubic pulse removes the analogue filter entirely for 60 dB, with a fixed digital pre-emphasis for the droop.
Two conditions come with that. The pulse must actually be emitted as a smooth waveform, which means an interpolating filter running at a much higher rate in front of a converter that holds for a short time — the analogue output is the B-spline only if the converter’s own hold is short against the pulse. And from three rectangles on the output is a smoothed version of the samples rather than the samples, so anything that depends on the output passing through each sample — a waveform generator that promises its sample values at its sample instants — has to apply the inverse filter first.
In a control loop, the delay is the bill that matters, and half a clock against a pole prices it at a loop’s crossover.
How the numbers were obtained
Each pulse is the cardinal B-spline of rectangles, evaluated by the truncated-power formula , and each output record is the sum of the pulses launched by twelve clocks’ samples of a tone at five-twelfths of the clock, at 256 points per clock over a whole number of periods of both, so every line is a bin centre and no window is needed. The one- and two-rectangle records are compared point for point with the hold’s staircase and the straight lines of the earlier essays and differ by nothing and by . The delays are read from the phase of each fundamental over twelve clocks at twelve thousand points. The pole counts, droops and filterless counts are the identities stated, evaluated at twenty-five ratios spaced a quarter of an octave apart.
What it leaves out
The converter’s own hold. A real digital-to-analogue converter holds each of its own samples for its own clock period, so an interpolator running at times the rate in front of it emits a staircase approximation to the B-spline with steps per clock. That adds one more sinc, at the fast clock, which is small in the band and puts its own images at multiples of the fast clock where the B-spline’s images are already deep.
The interpolating cubics. The cubic most often used in resampling is not the B-spline. A Keys or Catmull–Rom cubic passes through its samples, so it needs no correction, and its transform is not a power of the sinc: it rejects the nearest image less and droops less. Whether an interpolating cubic is worth a pole, a fraction of one or more than one is a different measurement on the same apparatus.
Every image but the nearest. The argument above says the further images are rejected more, and the transforms show it. It is not a claim about a signal whose band reaches close to half the clock, where the second image comes nearer.
Still open: the interpolating cubic, the correction’s own length, and the pulse in a loop
The interpolating cubic. Keys’s cubic kernel passes through the samples and has a transform that is not a sinc power. Its rejection of the nearest image, measured on its own waveform, would say whether the requirement that the output pass through its samples costs a pole, and how much of one.
The pre-emphasis for a long pulse. Undoing times the hold’s droop needs a digital filter whose gain at the band edge is that large; its length for a tenth of a decibel of accuracy, and the images it lifts in doing so, would complete the bill for the filterless cubic at three and four times oversampling.
The pulse inside a loop. Every rectangle is half a clock of delay, and in a digitally controlled loop that is phase at the crossover rather than latency. Half a clock against a pole takes the straight line into a loop; the cubic’s two clocks would be the harder case.
Part 6 on reconstruction
One argument about Reconstruction, and one of 7 essays on it so far, each part numbered by how much of the idea it assumes. What sits either side of it:
The objects named here
The third axis, after the field and the idea: the things themselves, and every essay that touches each one.
Anti imaging filterDesign tradeoffFilter orderGroup delayOversamplingReconstructionZero-order hold
- What a steep skirt costs design tradeoff, filter order, group delay
- The digits the arithmetic did not have design tradeoff, filter order
- The loop that is worse at full scale design tradeoff, oversampling
- The selectivity that is not free design tradeoff, filter order
- Two loops, and the mismatch between them design tradeoff, oversampling
- Two thirds of a bit for a factor of twenty-eight filter order, oversampling