# Why can't a causal digital filter have an infinitely sharp transition between the passband and the stopband?

In DSP book by Proakis and as well as in this pdf, it is mentioned that practical causal digital filters cannot have an infinitely sharp transition from Pass-band to Stop-band. Why is it so? Can you please provide a detailed explanation (with proof)?
Edit 1: In the book in was just mentioned that is a consequence of the Gibbs phenomenon, which results from the truncation of h(n) to achieve causality. I didn't understand how.

• Isn't there an explanation further in the book? – a concerned citizen Dec 26 '17 at 6:39
• No. I didn't find any. They just mentioned it as a consequence of the Gibbs phenomenon, which results from the truncation of h(n) to achieve causality. I didn't get how. – Nagabhushan S N Dec 26 '17 at 6:45

I don't have a concrete proof for this one. However, I can tell you this... Consider a perfect low pass filter. The time domain representation is a sinc. And for any system to have a sharp transition band, a base signal has to be multiplied with a rectangular waveform in the frequency domain. Which implies that, the time domain signal of the same has to be convoluted with a sinc in time domain. We know that sinc function is a non causal signal. Hence proved.

• What happens if I FFT my discrete input data, then apply my low pass filter (just zeroing every frequency greater than a given bound) and then iFFT back? Doesn't this have an infinitely sharp transition time? – ComFreek Dec 29 '17 at 15:52
• To take FFT, you would need the complete information on the data i.e. you need the signal completely before computing FFT. Right? In that case, the filter you design won't be causal. – Nagabhushan S N Jan 9 '18 at 8:25
• @ComFreek No, it's not infinitely sharp. dsp.stackexchange.com/q/6220/29 – endolith Jan 24 at 2:05
• Your "proof" is not correct. You are implicitly assuming a linear phase realisation of a perfect low pass. There is a causal minimum phase perfect low pass, however. – Jazzmaniac Jan 24 at 13:01
• @Jazzmaniac I'd think if you try to make a causal minimum-phase perfect low-pass filter, its impulse response will start so smoothly that its peak is pushed away to infinite time, making it zero-valued for all finite times. (Nice to see you here!) – Olli Niemitalo Jan 25 at 9:03

This is three years later, but since I don't see the real answer posted here, I will post it.

The correct answer is that if we are literally interpreting the original statement as a purely mathematical claim, taken at face value, then it is incorrect. There do exist causal filters, even minimum-phase ones with nice closed-form Fourier domain expressions, with infinitely sharp transitions to the stopband, as long as the stopband isn't identically zero.

However, before we get excited, we should note that these are causal filters with irrational transfer functions. Since it is generally believed there is no way to realize any filter with an irrational transfer function (how would you make this into something iike a difference equation?) in "real life," we are generally stuck with rational approximations to this theoretical ideal, which do have a finite transition band.

But to the extent that this question is purely mathematical, the claim as written is incorrect. The author must have meant something like, a "rational causal filter," because there really do exist causal IIR filters with a one-sided impulse response and an infinitely steep transition to the stopband.

To show this, we will give a causal filter with an infinite transition from passband to stopband explicitly. We will do even better than the above claim and even make it minimum-phase, not just one-sided.

We will use a "modified brickwall filter" that has the following magnitude response, where for simplicity, we will set our frequency cutoff to $$1$$ radian/sec, and let $$\epsilon$$ be some arbitrarily small positive real number.

$$|F(\omega)| = \text{rect}_\epsilon(\omega) \begin{cases} 1 & \text{if |\omega| <= 1} \\ \epsilon & \text{if |\omega| > 1} \end{cases}$$

So for any frequency that is less than our cutoff, we have unity gain, and for any frequency that is greater than cutoff, we multiply by some small $$\epsilon$$. Note that if $$\epsilon = 0$$, we get a true brickwall filter with infinite rejection in the stopband. So, these can be viewed as "approximate brickwall filters" which have some arbitrarily small allowance in the stopband, but which still have an infinite transition.

Given this magnitude response, we want to derive an expression for the phase response which will make this a causal filter with a one-sided impulse response. It so happens that we can do one step better and derive an expression that makes it minimum phase. To do this, we can use the relation here

$$\arg[F(\omega)] = -\mathcal{H}\{\log(|F(\omega)|)\}$$

where $$\mathcal{H}$$ is the Hilbert transform. For us, this simplifies to

$$\arg[F(\omega)] = -\mathcal{H}\{ \log \text{rect}_\epsilon(\omega) \}$$

The pointwise log of one of these approximate rect functions is just the log of each part separately, so we get:

$$\log |F(\omega)| = \log \text{rect}_\epsilon(\omega) \begin{cases} 0 & \text{if |\omega| <= 1} \\ \log \epsilon & \text{if |\omega| > 1} \end{cases}$$

A useful way to write this is

$$\log \text{rect}_\epsilon(\omega) = \log(\epsilon)(1 - \text{rect}(\omega))$$

We can substitute this back into the original to get:

$$\arg[F(\omega)] = -\mathcal{H}\{ \log(\epsilon)(1 - \text{rect}(\omega)) \}$$

Now, since the Hilbert transform is linear, and since the Hilbert transform of a DC signal is zero, we can drop that term to get

$$\arg[F(\omega)] = \log(\epsilon)\cdot\mathcal{H}\{(\text{rect}(\omega)) \}$$

Now all we need is the formula for the Hilbert transform of a rect function, which is

$$\mathcal{H}\{\text{rect}(\omega)\} = \frac{1}{\pi} \log \left|\frac{\omega+1}{\omega-1}\right|$$

Putting it all together, our frequency response will be

\begin{align*} F(\omega) & = |F(\omega)| \cdot \exp(j \arg(F(\omega))) \\ & = \text{rect}_\epsilon(\omega) \cdot \exp(j (\log(\epsilon)\cdot\mathcal{H}\{(\text{rect}(\omega)) \}) ) \\ & = \text{rect}_\epsilon(\omega) \cdot \exp\left(j \left(\log(\epsilon)\cdot\frac{1}{\pi} \log \left|\frac{\omega+1}{\omega-1}\right|\right) \right) \\ \end{align*}

Here is a real example of what it looks like, with $$\epsilon = 10^{-11}$$ (equal to about 220 dB of rejection in the stopband): Summary:

1. From a purely mathematical standpoint, causal filters with infinitely-fast transition into the passband do exist.
2. One simple example is to use a modified rect function, where instead of the rejection in the stop band being exactly zero, it's some arbitrarily small epsilon (the example given has it at 220 dB)
3. We can use the minimum-phase amplitude-phase relationship formula to derive the correct phase response that, when mixed with this magnitude response, leads to a causal and minimum-phase filter with an infinitely steep transition into the stop band.
4. These are not rational filters, so there is no simple difference equation that leads to this impulse response, either FIR or IIR. So, for real life purposes, they will need to be approximated by rational filters, which really don't have an infinitely fast transition.
5. Many of the other answers seem to be equivocating between different things - between causal and FIR filters, or causal and rational transfer functions, and so on. It is very useful to make sure you have these various things straight! The subset of causal filters that can be realized with a difference equation using only finitely many terms is exactly the set of causal filters with rational transfer functions - which also includes many IIR filters (take a look at $$y[t] = x[t] + 0.5*y[t-1])$$. Causal is too broad a criterion for "real world" filters, which is most commonly characterized as only those with rational transfer functions. Similarly, limiting to only FIR filters is much too narrow. Perhaps this is a good mathematical exercise in keeping these things straight!
• Thanks! Fat32 suggested this in a comment to this answer. Thanks for the detailed and crisp answer. – Nagabhushan S N Jan 24 at 3:06
• Finally a good answer to this rather basic question. Just one thing I don't agree with is your statement "the Hilbert transform of a DC is another DC". In fact, the Hilbert transform of a constant is zero. – Matt L. Jan 24 at 16:52
• @MattL., good catch - I've corrected it – Mike Battaglia Jan 24 at 21:26
• Very nice! What will happen as $\epsilon \to 0$? – Olli Niemitalo Jan 25 at 19:04

My answer implicitly refers to ideal brickwall lowpass filters which do have infinetely sharp transition bands. For other possible interpretations, refer to other answers.

In practice, neither analog, nor digital filters can have infintely sharp (ideal) transition band frequency responses, whether causal or not. The frequency response of an ideal filter can be defined in mathematical terms, but no physical realization will be possible.

Simply call the reason is that an ideal lowpass (or bandpass etc.) filter with zero-width transition band (infinitely sharp cutoff) would require an infinetely long and non-causal impulse response which practically cannot exist.

The transition bandwidth of a filter is inversely proportional to the filter kernel length. The approximate equation is given as follows

filter_kernel_length ≈ 4 /  transition_bandwidth; //(roll-off)


The above equation is taken from this online book ( http://www.dspguide.com/ch16.htm ) but it's only approximate because it doesn't take into account the effects of windowing (e.g. Hamming). The relationship between the filter kernel length and the transition bandwidth(roll-off) still remains the same.

It follows from this equation that an infinitely sharp transition (transition_bandwidth -> 0) will require you to have an infinitely large (long) filter kernel, which can't be achieved in practical applications (not certain if this constitutes the proof though).

For most practical applications, however, it's not required that you have very large kernel lengths and you can achieve pretty good separations even with moderate kernel lengths.

• Your argument answers the question why infinitely sharp transitions cannot be realized by systems with finitely long impulse responses. But this argument does not address the issue of causality because you can of course have causal systems with infinitely long impulse responses. And many practical filters do have infinitely long impulse responses, such as all analog filters, and IIR digital filters. – Matt L. Dec 26 '17 at 12:15
• You're right, I guess I was confused by Aaditya's answer who mentioned a window sync (sinc function), which we know is a FIR filter. – dsp_user Dec 26 '17 at 12:49
• BTW, none of the answers here answer the question from a mathematical point of view. From a practical (DSP) point of view, they're all OK, in my opinion. – dsp_user Dec 26 '17 at 18:41
• @MattL. A practical filter cannot have infinitely long impulse response? A practical filter must first be created (switched on) and then destroyed (switched off) so its mathematical model is apiecewise waveform. That's why it's defined as practical; if it can exist indefinetely then it's an ideal filter. Hence the mathematical model of a practical filter must have finite support in time and infinite support in frequency which discludes the possibility of ideally selective filters. And since any jumps in frequency responses require an ideally selective filter, they'r not realizable. – Fat32 Dec 27 '17 at 4:15
• @Fat32: My point is that the argument of finite support in the time domain and infinite support in the frequency domain says nothing about infinitely sharp transitions (which is what the question is about). A filter with an infinitely sharp transition from the passband (gain 0dB) to the stopband (gain -1000dB) has infinite support (in the frequency domain), so how do you (and the other answers) show that this is impossible? The finite/infinite support argument doesn't work here. – Matt L. Dec 27 '17 at 12:30

Any practical couple of a discrete signal and filter has, at some point, one being of finite length. Because a causal filter does not know about the future by definition, and any signal is unknown in some past (before the big-bang for instance). So the "infinite" convolution formula:

$$\sum_{-\infty}^{\infty} h_{n-k}x_k$$

is necessarily trimmed on indices at both ends:

$$\sum_{-L}^{M} h_{n-k}x_k$$

Now comes a mathematical result, which can be seen as the conjugation of the Paley-Wiener theorem: the Fourier transform of "a distribution with compact support" cannot have a compact support. In other words, if a signal is zero outside a finite time domain, it CANNOT be zero outside outside a finite frequency domain, hence it cannot have a zero stop-band suddenly, which you should expect with an infinitely sharp transition between the pass-band and the stop-band.

The exact conditions are a bit technical (using entire functions of exponential type), yet with the Paley-Wiener reference, you should find initial steps.

• I think there are two "flaws" in your argument, even though I agree with everything you say (but I don't think that you actually answer the OP's question). First, you argue that all practical filters are not only causal but they also have a finite impulse response. My point here is that this argument is not necessary. Even with infinite impulse responses, causal filters cannot have infinitely sharp transition bands. So causality would be sufficient, no need to introduce the argument of finite impulse responses. – Matt L. Dec 26 '17 at 17:32
• Second, you use the first argument (compact support in the time domain) to show that those filters can't have compact support in the frequency domain, i.e., they can't have ideal stopbands. However, this has no bearing on the fact that causal filters cannot have infinitely sharp transition bands. The Paley-Wiener criterion does not say anything about the sharpness of the transition band, which is what the OP seems to be about. The Paley-Wiener criterion does not preclude the existence of a filter with a stopband attenuation of 500dB and an infinitely sharp transition from passband to stopband. – Matt L. Dec 26 '17 at 17:32
• So in my opinion, the question why causal filters can't have infinitely sharp transition bands remains unanswered. And - just to be clear - I wouldn't even start arguing if I knew that you didn't know better ... :) – Matt L. Dec 26 '17 at 17:34
• You have good point I agree with. Let me recover from the drinks, and I'll try to be sharper. The sharpness in the OP is indeed a crucial point. I chose the angle of a transition to something to "something else very flat", hence the converse PW approach. Yet a better answer is still to come – Laurent Duval Dec 27 '17 at 18:14

Whenever there's sharp transition in any system(filter),it'll have infinite length impulse response.For a system to be causal impulse response must be zero for negative input h[n]=0,for n<0 ,but due to sharp transition this condition will not be satisfied,so resulting system will be non causal and non causal systems aren't realizable. 