Skip to article frontmatterSkip to article content
Site not loading correctly?

This may be due to an incorrect BASE_URL configuration. See the MyST Documentation for reference.

Ideal Filtering

Approximation of continuous-time filtering via discrete convolution after ideal reconstruction

Nice — this is a great line of thought. Short answer up-front: yes, it’s mathematically tractable and (under the usual bandlimited assumption) equivalent to a discrete convolution with the continuous filter sampled at the sampling instants. Whether it’s efficient in practice depends on how fast that sampled impulse decays (which you can exploit), and on whether you prefer block FFT methods or a truncated FIR / IIR fit. Below I walk through the math, the equivalence, time-decay behavior, and practical implementation/optimization strategies (with concrete tradeoffs).


1) The mathematics / exact equivalence

Let T=1/FsT=1/F_s and let x[n]=xc(nT)x[n]=x_c(nT) be samples of a continuous-time, bandlimited signal xc(t)x_c(t) (bandlimit f<Fs/2|f|<F_s/2). Reconstruct with ideal sinc interpolation

xc(t)=mx[m]sinc ⁣(tmTT).x_c(t)=\sum_{m} x[m]\,\operatorname{sinc}\!\big(\tfrac{t-mT}{T}\big).

Apply a continuous LTI filter with impulse response hc(t)h_c(t) (frequency response Hc(f)H_c(f)), and then sample:

y[n]=(yc(t))t=nT=(hcxc)(t)t=nT.y[n]=\big(y_c(t)\big)_{t=nT}=\left.\big(h_c * x_c\big)(t)\right|_{t=nT}.

Because convolution is linear and sampling commutes with convolution, you can show

y[n]=mx[m]  g[nm],g[k]=Thc(kT).y[n]=\sum_m x[m]\; g[n-m],\qquad g[k]=T\,h_c(kT).

(That factor TT depends on your definitions of Fourier transform conventions; the key point is g[k]g[k] is the continuous impulse sampled at integer multiples of TT.)

So the entire continuous → continuous → sample pipeline is exactly equivalent to a discrete convolution with the (usually infinite-length) sequence g[k]g[k]. In other words: applying an arbitrary continuous-time LTI filter to an ideal-reconstructed bandlimited signal is the same as convolving the sample sequence with the sampled continuous impulse response.


2) Frequency-domain viewpoint (why no aliasing if bandlimited)

If Hc(f)H_c(f) is supported (or you only care about it) for f<Fs/2|f|<F_s/2, then there is no aliasing when sampling yc(t)y_c(t). In frequency terms the discrete-time frequency response (DTFT) of g[k]g[k] equals the continuous frequency response Hc(f)H_c(f) restricted to the baseband and mapped to digital frequency:

G(ejω)ω=2πfT  =  Hc(f),f<Fs/2,G(e^{j\omega}) \big|_{\omega=2\pi fT} \;=\; H_c(f),\qquad |f|<F_s/2,

so multiplication by Hc(f)H_c(f) in continuous-time corresponds exactly to multiplication by G(ejω)G(e^{j\omega}) in discrete-time (no aliasing) and you recover the identical sampled output.

Thus designing hc(t)h_c(t) for the continuous magnitude you specified and then sampling it gives a discrete-time filter whose effect at the sample points is exactly the continuous one.


3) Impulse decay / how long is g[k]g[k]?

Important practical question: is g[k]=Thc(kT)g[k]=T\,h_c(kT) very long (intractable), or does it decay fast so it can be truncated?

Time-domain decay of the sampled impulse depends on the smoothness of Hc(f)H_c(f):

Your magnitude law is continuous at fc=4f_c=4 kHz but its slope changes (the slope of the magnitude vs frequency has a corner at 4 kHz). That implies a discontinuity in a derivative (so not infinitely smooth). For the power-law → flat join you get roughly a 1/t21/t^2 decay for the impulse—i.e. coefficients fall roughly like C/k2C/k^2. That’s much better than 1/k1/k but not exponentially small.

Implication: the impulse is infinite but decays reasonably fast (≈ 1/k21/k^2). That usually means you can truncate to a few hundred or a few thousand taps depending on your precision/quantization goals — not infinite order and definitely not as pathological as an ideal brickwall.


4) Quantization and truncation criterion

Because you’re working with 16-bit audio, there is a natural numerical/irrelevance threshold: once tap amplitudes are below the level that contributes less than half a quantization unit (or any chosen perceptual/effective threshold), you can truncate.

Heuristic procedure:

  1. compute g[k]=Thc(kT)g[k]=T h_c(kT) numerically (via inverse FFT of Hc(f)H_c(f) sampled on a fine grid).

  2. decide on an absolute contribution threshold ϵ\epsilon tied to your dynamic range / audible criterion (e.g. ϵ=216\epsilon = 2^{-16} relative to full scale or a stricter energy criterion).

  3. truncate where g[k]<ϵ|g[k]|<\epsilon and/or cumulative tail energy is small (e.g. tail energy < −120 dB). Because of 1/k21/k^2 decay, required truncation length NN grows like C/ϵ\sqrt{C/\epsilon} (C depends on the spectral discontinuity strength).

So you can make the “implicit window because of quantization” rigorous and choose a finite filter length that meets a numeric error bound.


5) Efficiency — how to actually compute/apply it

Multiple practical routes; pick based on latency/cost constraints:

A. Precompute g[k]g[k] and convolve (FIR)

B. FFT block processing (frequency-domain multiplication)

C. Combine sinc and low-cut analytically

D. Model reduction / approximation


6) Is this equivalent to the DFT/bin approach?


7) Practical recommendations for your 48 kHz / 16-bit case


8) Want me to do it for you now?

I can compute the exact sampled impulse g[k]g[k] for your specific continuous magnitude (the +12 dB/octave+12\text{ dB/octave} law with the join at 4 kHz) at Fs=48F_s=48 kHz and:

If you want that, tell me which you prefer (FFT block size to use, or target FIR length or target maximum error in dB), and I’ll produce the coefficients and plots. If you don’t want to choose, I can make a reasonable default (e.g. Nfft=65536, report g[k] decay, suggest truncation to where tail energy < −120 dB).