-3
$\begingroup$

Sinc is $\propto 1/t$. If $x(t)$ is bounded, then there exists $t: |x(t)/t| < \epsilon_M$, where $\epsilon_M$ is machine epsilon. If $x(t)$ is also time-limited, it also means there's $\tau$ such that $\int_{-\infty}^{\infty} |x(t) \text{sinc}(t - \tau)| dt < \epsilon_M$ (i.e. sinc eventually decays enough), meaning

$$ |\left((x * \text{sinc})(t)\right)[n] - (x * \text{sinc})[n]| < \epsilon_M $$

is doable - i.e., the sampling of the exact result is indistinguishable from the result of digital computation.


Plethora, if not vast majority, of real-world signals are time-limited. Hence they can be brickwalled.

So why the saying? Shouldn't it instead be that ideal lowpass isn't ideal? The sinc is infinitely long with terrible decay, meaning the input's time support is stretched out at least a hundredfold. Even with $\epsilon_M=0$, this isn't what we want at all. As shown under "Modulation Model vs Fourier Transform", Fourier "frequencies" most often aren't frequencies at all but artifacts of the transform: it can very well be that, eliminating all $f > 50\ \text{Hz}$ only actually eliminates $f < 30\ \text{Hz}$, physically.

Hence the real advantage of non-sinc is temporal compactness: the output's length is comparable to input's, a must for real-time processing. Of course there's also compute-expense, but this discussion is purely about accuracy, as it seems universally said that we simply cannot brickwall (and if we could, it's "ideal").


Since comments may vanish I've documented them here: 1, 2.

Discussion summary: agreeing with me in comments, disagreeing in answers and votes. Dislike saying it, dislike more seeing it.

$\endgroup$
11
  • 5
    $\begingroup$ What exactly is your question here? Frankly, I don't even get the point your are trying to make. $\endgroup$
    – Hilmar
    Commented Feb 11, 2023 at 14:32
  • 3
    $\begingroup$ What exactly is wrong ? Are you claiming there are ideal lowpass filters ? Is that your point here? $\endgroup$
    – Hilmar
    Commented Feb 11, 2023 at 14:47
  • 6
    $\begingroup$ Not sure I can follow that. That feels like an inherent contradiction. If a signal is time limited, it has unlimited bandwidth. Once you brick-wall it, it's limited in frequency, which means the result cannot be limited in time anymore. If your input is time limited and your output isn't, that means that the impulse response of your filter isn't time limited either. Not only isn't it infinitely long, it's also infinitely non-causal, i.e. you would have to started filtering before the big bang. $\endgroup$
    – Hilmar
    Commented Feb 11, 2023 at 14:57
  • 3
    $\begingroup$ Obviously you can always make it "good enough" within the requirements of your specific application with finite resources, but by my definition what would not be an ideal low-pass filter anymore. My meta point is: a big part of good filter design is to really understand and clarify your requirements. How much low-pass filtering do you really need? The answer "ideal lowpass filter" doesn't hack it. $\endgroup$
    – Hilmar
    Commented Feb 11, 2023 at 14:59
  • 5
    $\begingroup$ @OverLordGoldDragon I fully agree with Hilmar here, but beyond that, you're handwaving away an awful lot of detail. That one "can approach theory as closely as one wants on a computer" (at least in many practical cases) is not new. The real engineering question is, what is the cost? Being concrete: design a digital filter to low-pass filter a signal sampled at 40 kHz to a cutoff frequency of 5 kHz so the difference is less than 1e-16 from the (continuous-time) theoretical result. A problem you're likely to find is that some filter coefficients become smaller than your machine precision... $\endgroup$
    – MBaz
    Commented Feb 11, 2023 at 16:20

2 Answers 2

2
$\begingroup$

I think the OPs argument here is

For any given "machine epsilon" (whatever exactly that is) you can determine a truncation length for a sinc() where adding more coefficients will not change the output anymore.

That in itself is obviously a correct statement. The filter you would get this way would be "the best lowpass filter you can get using a truncated sinc and a specific numerical data type or resolution" I think that the OP uses that as the their definition of an "ideal lowpass filter" in a sense of "you can't do any better".

I think the flaw in this argument is referencing it to the "machine epsilon". Given enough resources you can make this as small as you like (or need) using arbitrary bit/word length data types. You are not beholden to "int, float or double".

The second flaw (IMO) is that for most standard data types you end up with a pretty crappy lowpass filter that has extremely high latency and still has significant errors with respect to the formal definition of a brickwall filter. Since you have to accept some amount of errors anyway, you are better off using a filter design that minimizes resource consumption within the requirements of your application. A truncated sinc is often not the best choice here.

$\endgroup$
1
  • $\begingroup$ Well you're right about machine epsilon but that only reinforces my thesis. But I don't follow "significant errors with respect to the formal definition of a brickwall filter", that appears to contradict the first point. "in a sense of "you can't do any better"" - in a sense that you'd get an identical array by sampling the exact continuous-time result. $\endgroup$ Commented Feb 12, 2023 at 10:40
1
$\begingroup$

I agree with the OP that the “ideal lowpass brickwall filter” isn’t necessarily ideal. A prime example is in a receiver a non-casual matched filter would be “ideal” for optimizing SNR with no delay in white noise conditions, so would be the reverse filter for whatever filter was used in the transmitter (which as non-causal is also not physically implementable).

The definition of an “ideal lowpass brickwall filter” is well defined, and when we consider that definition, it is not physically implementable. Notably the violation of causality and that the frequency domain description is continuous, not discrete. However this does not preclude creating filters that sufficiently approximate a “brickwall” response for a given application.

The statement “ideal lowpass brickwall filter” is used when describing the filtering problem of passing a band of frequencies with no distortion or delay while completely rejecting all other frequencies. This of course is not physically realizable (even if we could pass and reject with an allowably small transition band, the resulting delay required would be far from “ideal”). However understanding this as well as its limits is the first step toward understanding best practices with realizable filter design in terms of the effects of time delay and impulse response truncation. Thus many filtering concepts are first introduced in comparison to an “ideal brickwall” filter (lowpass, highpass or bandpass).

Here is a simple example to demonstrate why there is no physically realizable "brickwall" filter. A brickwall filter specifically has a rectangular magnitude response in the frequency domain. It passes all frequencies up to a passband frequency cutoff $f_c$, and immediately (brickwall) rejects all frequencies above $f_c$. Here I've made a ridiculously long filter with 262144 samples (based on OP’s suggestion in the comments) of a Sinc function using the approach described by the OP.

Filter coefficients on a log scale:

filter coeff

Filter frequency response

brickwall freq response

If we zoom in on the transition region, we see how horrible such a filter construction would be and how far from an "ideal brickwall filter" we are, and certainly not indistinguishable from one:

zoom in

Of course to implement a better filter, we would use windowing in the time domain, but this would also come at the expense of a wider transition band. I've included what this would look like in comparison; with the Sinc impulse response windowed with a Kaiser window using $\beta=12$. At the scale of the full frequency band it certainly appears as a "brickwall":

kaiser windowed

Zooming in on the transition band as done above reveals the wider transition band as a penalty for the windowing that was applied (but well worth it!). Ultimately we see that even with this long FIR filter as suggested by the OP in the comments, the differences from a true "brickwall" filter are quite distinguishable and far from reaching the limits of computing precision:

zoom in kaiser windowed

How we would see the effect of this is not done by evaluating the tail errors of the Sinc in the time domain as suggested by the OP where the result may appear indistinguishable at some arbitrary limit, but rather with test waveforms at frequencies within vicinity of the frequency cutoff. To properly test such a condition in the time domain, use two waveforms, one with a frequency set to $f_c-\Delta$ and the other to $f_c+\Delta$ where $\Delta$ is a small frequency increment on each side of cutoff. The steady state magnitude of the waveform at the output of the filter would be consistent with the frequency domain results I have shown above.

$\endgroup$
12
  • $\begingroup$ "not done by evaluating the tail errors of the Sinc in the time domain" yes it is. These plots aren't representative of my proposed design; they could show -1000000000, then we store at some precision and get back to (e.g.) -10000. And 200,000 is far from long enough, you need 1e16 to get 1e-16 in sinc (assuming t=arange). Also per Hilmar's note we could drive it even below -1000000000 and store it. $\endgroup$ Commented Feb 12, 2023 at 10:55
  • $\begingroup$ "nor anything we would ever implement" I routinely work with 262144-long filters, and folks in bioacoustics yet longer. $\endgroup$ Commented Feb 12, 2023 at 11:31
  • $\begingroup$ @OverLordGoldDragon Regardless even filters that long or 10x longer are not brickwall filters, and not indistinguishable at the precision computers allow. It's important for all that we use generally accepted terminology for our definitions. When we use those definitions, a brickwall filter is well defined and not physically feasible. What I was referring to that typically would not be done for a good filter design is designing the filter as a simple truncated Sinc. $\endgroup$ Commented Feb 12, 2023 at 11:49
  • $\begingroup$ "and not indistinguishable at the precision computers allow" I've mathematically proven otherwise. You could confirm the CS side on StackOverflow. $\endgroup$ Commented Feb 12, 2023 at 11:55
  • $\begingroup$ @OverLordGoldDragon I've updated my answer for your case. Same result. I suspect you aren't considering two closely spaced frequencies with one that passes and the other rejected? The length of such a filter that reaches the limits of precision that computers allow would take years to run! $\endgroup$ Commented Feb 12, 2023 at 12:39

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.