# Why shouldn't the magnitude of a practically realizable frequency selective filter be constant for a range of frequencies?

According to Paley-Wiener theorem, a practically realizable frequency selective filter shouldn't have a constant magnitude for a range of frequencies. Why is this so? How do we prove and understand it?!

To summarize, causality has very important implications in the design of frequency-selective filters. These are: (a) the frequency response $$H(\omega)$$ cannot be zero, except at a finite set of points in frequency; (b) the magnitude $$|H(\omega)|$$ cannot be constant in any finite range of frequencies and the transition from passband to stopband cannot be infinitely sharp [this is a consequence of the Gibbs phenomenon, which results from the truncation of $$h(n)$$ to achieve causality]; and (c) the real and imaginary parts of $$H(\omega)$$ are interdependent and are related by the discrete Hilbert transform. As a consequence, the magnitude $$|H(\omega)|$$ and phase $$\Theta(\omega)$$ of $$H(\omega)$$ cannot be chosen arbitrarily.

Point b in the quote. Source: Proakis ch.10 4th edition

• Hi. Rather than constant gain, a constant frequency response (magnitude and phase) should be what you are asking for. – Juancho Jan 8 '19 at 12:06
• Sorry I meant magnitude of H(w) – Trilok Girish Kamagond Jan 9 '19 at 8:55
• I didn't understand the difference between gain and magnitude? – Trilok Girish Kamagond Jan 9 '19 at 9:02
• You may want to limit the question to frequency selective filters (as in the quote) which attenuate some frequencies while pass others largely unattenuated. That would exclude all-pass filters. – Olli Niemitalo Jan 9 '19 at 9:23
• Thank you so much! I may limit the question to frequency selective filters – Trilok Girish Kamagond Jan 10 '19 at 2:27

Note that all-pass filters with a perfectly constant magnitude response over the whole frequency range are realizable. A first-order discrete-time all-pass filter has the following transfer function:

$$H(z)=\frac{1-az^{-1}}{a^*-z^{-1}}\tag{1}$$

If $$|a|>1$$, the system $$(1)$$ is causal and stable. It is straightforward to show that

$$\left|H\left(e^{j\omega}\right)\right|=1,\qquad\forall\omega\tag{2}$$

i.e., the system's magnitude response is constant.

What is not possible is to have a constant magnitude response over only a part of the possible frequency range $$[0,2\pi]$$ (or, in continuous time, $$(-\infty,\infty)$$).

This can be seen as follows. First, design an ideal frequency-selective filter by computing the IDFT of some ideal frequency response (with a constant gain in the pass band(s), and a gain of zero in the stop band(s)). Let's consider discrete-time filters, but the discussion is basically the same for continuous-time filters. Let the resulting ideal impulse response be $$h_{id}[n]$$. First, we shift that impulse response to the right to have most of its energy at positive indices $$n>0$$:

$$\tilde{h}_{id}[n]=h_{id}[n-n_0],\qquad n_0>0\tag{3}$$

In order to obtain a causal filter, we need to multiply that shifted impulse response by a sequence $$f[n]$$ satisfying

$$f[n]=\begin{cases}0,&n<0\\1,&n>n_1\ge 0\end{cases}\tag{4}$$

with some non-negative $$n_1$$. The values of $$f[n]$$ between $$n=0$$ and $$n=n_1$$ can be chosen arbitrarily, but in practice we would choose them such that $$f[n]$$ increases monotonically in the interval $$[0,n_1]$$. The final impulse response of our causal filter is

$$h[n]=\tilde{h}_{id}[n]f[n]=h_{id}[n-n_0]f[n]\tag{5}$$

Note that $$h[n]$$ is still infinitely long.

In the frequency domain this corresponds to

$$H(e^{j\omega})=\left(H_{id}(e^{j\omega})e^{-jn_0\omega}\right)\star F(e^{j\omega})\tag{6}$$

where $$\star$$ denotes convolution. This convolution destroys the piecewise constant property of the original frequency response $$H_{id}(e^{j\omega})$$, and the magnitude of the resulting causal frequency response $$H(e^{j\omega})$$ is neither piecewise constant, nor does it have infinitely sharp transitions.

• Thank you so much @Matt L. Very satisfying answer. Can u please tell why in practice f(n) should have monotonically increasing values between 0 to n1? – Trilok Girish Kamagond Jan 10 '19 at 2:46
• @TrilokGirishKamagond: That's just a reasonable choice because you want a function that smoothly moves from zero to one, just like a one-sided window function. – Matt L. Jan 10 '19 at 8:02
• You show that truncating the impulse response of a filter with a magnitude frequency response with a flat segment no longer gives such a filter. But this leaves out what can or cannot be achieved by truncating the impulse response of a filter that does not originally have that flat segment in its magnitude frequency response. – Olli Niemitalo Jan 15 '19 at 9:17
• @OlliNiemitalo: Yes, that's right, the whole answer clearly doesn't prove anything, it's just supposed to make things plausible. – Matt L. Jan 15 '19 at 10:13
• @Matt L I have a small doubt regarding multiplication of f(n) to hid[n] to get a causal system. I feel hid[n] is already causal as it depends on past values only as long as n0 is large enough. So what can I understand from the multiplication by f(n)? And when n > n0 won't the system become non causal? – Trilok Girish Kamagond Jan 17 '19 at 12:03