In many situations, we want to design a filter that has ideal bassband and ideal stopband. That is, with $|H(\omega)| = 1$ at passband frequencies and $|H(\omega)| = 0$ at stopband frequencies.
For a low-pass filter, the ideal filter is often expressed as $$ \begin{align*} H(\omega) = u[\omega + \omega_c] - u[\omega - \omega_c] \qquad \textrm{for } \pi \leq \omega < \pi \; . \end{align*} $$ This is a rectangle signal in the frequency domain. In the time domain, this becomes $$ \begin{align*} h[n] = \frac{\sin(\omega_c n)}{\pi n} \end{align*} $$ In both equations, the variable $\omega_c$ is known as the cut-off frequency for the filter. For a real-time system, we cannot use an ideal filter because (1) it is not casual and (2) it is infinite in length and not easily representable with an IIR filter.
A stable filter is necessary to ensure the system output does not go to infinity in an uncontrollable manner. Hence, this is a desirable proprety.
A causal filter is one that does not rely on any future input values. As a result, a causal filter can be implemented in real-time. Hence, this is a desirable proprety.
The phase controls the amount of delay in a signal. This delay can be expressed as a function of frequency. There are two expressions for delay. First, the phase delay is defined by $$ M_{ph}(\omega) = -\frac{\angle H(\omega)}{\omega} \; , $$ which describes how much the phase of the sinusoid at frequency $\omega$ shifts after passing thru the filter. Second, the group delay is defined by $$ M_{gr}(\omega) = -\frac{d \angle H(\omega)}{d \omega} \; , $$ which describes how much much a collection of frequencies around $\omega$ shifts after passing thru the filter.
In an ideal filter, we want the phase delay and group delay to be constant across all frequencies. If we have linear phase filter such that $$ \angle H(\omega) = - M \omega \; , $$ then this condition is satsified. Specifically, we get that $$ M_{ph}(\omega) = M_{gr}(\omega) = M \; . $$ As a result, a linear phase filter is highly desirable.
In the previous section, we established that we desire stable, casual, linear phase filters. This section establishes how these filters are represented in the time, frequency, and Z domains.
Note, for simiplicity, we are going to assume the signal length $N$ is an even number in the notes below. The equations change slightly when $N$ is an odd number.
In the time domain, a linear phase filter is represented by even or odd symmetry in the signal around some center point. The center of that symmetry represents the delay of the filter $M$. Mathematically, this is represented by the property $$x[n] = \pm x[-n + (N-1)] = \pm x[N-1-n]\; ,$$ where $N$ is the length of the signal. The operations on a causal signal, length-N signal will shift it left to become almost anti-casual ($n=0$ will still have a value) and then apply a time-reversal to make it causal again. The expression above is positive when the impulse response has even symmetry and a negative when the impulse response has odd symmetry.
In the frequency domain, the linear phase property can be expressed as $$X(\omega) = e^{-j \omega (N-1)} X(- \omega) \; .$$ Hence, if we reverse the frequency domain, we will observe a predictable difference in the signal phase.
In the frequency domain, a length-N, causal, linear phase filter with an even impulse response can be expressed as $$ \begin{align*} H(\omega) &= \left[ \sum_{k=0}^{M/2-1} a_k \left( e^{j \left( \omega \frac{M-1}{2}-k \right)} + e^{-j \left( \omega \frac{M-1}{2}-k \right)} \right) \right] e^{- j \omega \frac{N-1}{2} } \\ &= \left[ \sum_{k=0}^{M/2-1} a_k 2 \cos\left( \omega \frac{M-1}{2}-k \right) \right] e^{- j \omega \frac{N-1}{2} } \; . \end{align*} $$ The magnitude of $H(\omega)$ is equal to $$ \begin{align*} |H(\omega)| &= \left|\sum_{k=0}^{M/2-1} 2 a_k \cos\left( \omega \frac{M-1}{2}-k \right)\right| \end{align*} $$ The phase of $\angle H(\omega)$ is equal to $$ \begin{align*} \angle H(\omega) &= \begin{cases} - \omega (N-1)/2 &\mbox{for } H(\omega) > 0 \\ - \omega (N-1)/2 + \pi &\mbox{for } H(\omega) < 0 \end{cases} \end{align*} $$
A length-N, causal, linear phase filter with an odd impulse response can be expressed as $$ \begin{align*} H(\omega) &= \left[ \sum_{k=0}^{(M-1)/2} a_k \left( e^{j \left( \omega \frac{M-1}{2}-k \right)} - e^{-j \left( \omega \frac{M-1}{2}-k \right)} \right) \right] e^{- j \omega \frac{N-1}{2} } \\ &= \left[ \sum_{k=0}^{(M-1)/2} a_k 2 j \sin\left( \omega \frac{M-1}{2}-k \right) \right] e^{- j \omega \frac{N-1}{2} } \\ &= \left[ \sum_{k=0}^{(M-1)/2} a_k 2 \sin\left( \omega \frac{M-1}{2}-k \right) \right] e^{- j \omega \frac{N-1}{2} + \pi/2} \; . \end{align*} $$ The magnitude of $H(\omega)$ is equal to $$ \begin{align*} |H(\omega)| &= \left|\sum_{k=0}^{(M-1)/2} 2 a_k \sin\left( \omega \frac{M-1}{2}-k \right)\right| \end{align*} $$ The phase of $\angle H(\omega)$ is equal to $$ \begin{align*} \angle H(\omega) &= \begin{cases} - \omega (N-1)/2 + \pi/2 &\mbox{for } H(\omega) > 0 \\ - \omega (N-1)/2 - \pi/2 &\mbox{for } H(\omega) < 0 \end{cases} \end{align*} $$
In the Z-transform domain, the linear phase property can be expressed as $$X(z) = z^{-(N-1)} X(z^{-1}) \; .$$ This tells us that our poles and zeros must be symmetric about the unit circle.
In the z-transform domain, a length-N, causal, linear phase filter with an even impulse response can be expressed as $$ \begin{align*} H(z) &= a_0 + a_1 z^{-1} + a_2 z^{-2} + \ldots + a_2 z^{-(N-3)} + a_1 z^{-(N-2)} + a_0 z^{-(N-1)} \\ &= \left[ a_0 z^{+ \, \frac{N-1}{2}} + a_1 z^{+ \, \frac{N-1}{2} - 1} + a_2 z^{+ \, \frac{N-1}{2} - 2} + \ldots + a_2 z^{-(N-3)} z^{2 - \frac{N-1}{2}} + a_1 z^{1-(N-2)} + a_0 z^{- \, \frac{N-1}{2}} \right] z^{- \, \frac{N-1}{2}} \\ &= \left[ \sum_{k=0}^{N/2-1} a_k \left( z^{\frac{N-1}{2}-k} + z^{-\left( \frac{N-1}{2}-k \right) } \right) \right] z^{- \, \frac{N-1}{2}} \\ \end{align*} $$ A length-N, causal, linear phase filter with an odd impulse response can be expressed as $$ \begin{align*} H(z) &= a_0 + a_1 z^{-1} + a_2 z^{-2} + \ldots - a_2 z^{-(N-3)} - a_1 z^{-(N-2)} - a_0 z^{-(N-1)} \\ &= \left[ a_0 z^{+ \, \frac{N-1}{2}} + a_1 z^{+ \, \frac{N-1}{2} - 1} + a_2 z^{+ \, \frac{N-1}{2} - 2} + \ldots - a_2 z^{-(N-3)} z^{2 - \frac{N-1}{2}} - a_1 z^{1-(N-2)} - a_0 z^{- \, \frac{N-1}{2}} \right] z^{- \, \frac{N-1}{2}} \\ &= \left[ \sum_{k=0}^{N/2-1} a_k \left( z^{\frac{N-1}{2}-k} - z^{-\left( \frac{N-1}{2}-k \right)} \right) \right] z^{- \, \frac{N-1}{2}} \\ \end{align*} $$