2.34 Sinc / Scaling Functions: The Closest Thing to a Brick-Wall Filter
The sinc is the exact brick-wall low-pass: full pass below the cutoff, nothing above. But it runs infinitely long and needs future bars, so you build only a truncated, windowed version that rings.
The old article "Why the SMA Is Often a Terrible Smoother" showed that the simple moving average leaks 22 percent of the high-frequency noise it was supposed to block, because its frequency response is a ragged sinc with sidelobes that never settle. The old article "The Trader's Guide to Low-Pass Filters" gave you the recursive smoothers that do better with a gentle rolloff. This article reaches for the opposite extreme, the filter whose frequency response is as close to a vertical wall as a low-pass can get: the sinc function. It passes everything below a cutoff at full size and kills everything above it, the ideal a trader keeps wishing the SMA were. The price for that near-perfect cut is the reason you cannot run the ideal version live, and understanding why is half the lesson.
The sinc is the ideal low-pass, by definition
A brick-wall filter passes every cycle below a cutoff untouched and stops every cycle above it dead, with a vertical edge between the two. Ask what impulse response produces that perfectly rectangular frequency response and the math hands back exactly one answer: the sinc function. The trading form Don Mak uses indexes it by a smoothing parameter n.
$$ h_n(k) = \frac{\sin(\pi k / n)}{\pi k}, \qquad k = \ldots, -2, -1, 0, 1, 2, \ldots $$
These coefficients are the unit impulse response of a low-pass filter, and their Fourier transform is the rectangular wall: flat gain up to the cutoff, then nothing. This is not an approximation that happens to look good. The sinc is the rectangle's exact partner, because a rectangle in the frequency domain and a sinc in the time domain are a Fourier-transform pair. Where the SMA's response wobbles with sidelobes that leak noise at minus 13 decibels forever, the sinc's response is the clean step the SMA only pretended to be.
These coefficients are also called scaling functions, and they are the father of wavelets. A scaling function is a low-pass; the wavelets built on top of it are band-pass. So the sinc sits at the root of the whole wavelet machinery, the smooth foundation that the band-pass detail filters are constructed against.
Less phase lag than EMA(M=3), until you push the cutoff
The sinc's appeal for traders is not only the sharp cut. Over the slow part of the band it is also light on lag. Don Mak's measurement is concrete: the two-term sinc holds a phase lag under 0.41 radians for cycle speeds below about 1.13 radians per bar, which is less phase lag than an EMA with M equal to 3 over the same range. So in the band where most tradable structure lives you get a sharper cut and a lighter delay than a fast EMA, a rare combination.
The warning sits right next to the measurement. As the cycle speed climbs toward the fast end, near half the sampling rate, the phase lag increases dramatically. The filter is gentle on lag only in its passband; push the cutoff up toward the noise floor and the delay grows fast. The practical reading is that the sinc is excellent when you want to keep a clearly slow band and reject a clearly fast one, and it degrades when you ask it to cut close to the Nyquist limit, which is the same region the old article on the SMA warned was physically fragile anyway.
Why you truncate, and what truncation costs
Here is the catch that keeps the ideal sinc off your live chart. The sinc function has infinite length. Its tails ripple out forever and never reach zero, so the exact filter would need infinitely many past and future bars to compute one output. Future bars make it non-causal, which alone disqualifies it for real-time trading, and infinite length makes it impossible regardless. In practice the tails are tiny far out, so you truncate: Don Mak notes that for the two-term sinc the coefficients past about k of 120 are effectively zero, so you keep a finite window and drop the rest.
Truncation is not free. Chopping the sinc's tails reintroduces ripple in the frequency response, the wall stops being perfectly vertical and the passband and stopband pick up small oscillations, the Gibbs phenomenon. Cutting the window shorter narrows the cost in computation and lag but widens the ripple; keeping it longer tightens the wall but costs more lag and more bars of warmup. The standard repair, beyond raw truncation, is to taper the window rather than chop it square, which trades a slightly less vertical wall for far smaller ripple, the same windowing logic that fixed the SMA's sidelobes in the old smoother article. The honest summary: the sinc is the closest thing to a brick wall you can build, you can run a truncated, windowed, delayed version on history, and you can never run the ideal one at the live right edge.

KEY POINTS
- The sinc function is the exact impulse response of an ideal brick-wall low-pass: flat gain below the cutoff, zero above, a vertical edge. It is the clean response the SMA from the old article "Why the SMA Is Often a Terrible Smoother" only imitated.
- A rectangle in frequency and a sinc in time are a Fourier-transform pair, so the rectangular wall and the sinc coefficients are two views of one filter, not an approximation.
- Sinc coefficients are scaling functions, the father of wavelets: the scaling function is the low-pass foundation, the wavelets built on it are the band-pass details.
- In its passband the two-term sinc carries less phase lag than EMA(M=3) (under 0.41 radians below about 1.13 radians per bar), but the lag rises sharply as the cutoff approaches the fast Nyquist end.
- The ideal sinc has infinite length and needs future bars, so it is non-causal and unrealizable live. You truncate (coefficients past about k=120 are negligible) and run a delayed version on history only.
- Truncation reintroduces ripple (the Gibbs phenomenon). A tapered window beats a square chop, trading a slightly softer wall for far less ripple, the same windowing fix that tames the SMA's sidelobes.
References
- Sinc filter: the ideal brick-wall low-pass (Wikipedia)
- The Ideal Lowpass Filter: impulse response is a sinc (Stanford CCRMA)
- Windowed-Sinc Filters (The Scientist and Engineer's Guide to DSP, ch. 16)
- How to Create a Simple Low-Pass Filter: sinc, truncation, windowing (TomRoelandts)
- Gibbs phenomenon: ringing from truncating the sinc (Wikipedia)
- Statistically Sound Indicators for Financial Market Prediction - Timothy Masters (Amazon)