# How FIR filters provide a linear phase?

I know that we can design a linear phase FIR filter by choosing filter coefficients symmetric or antisymmetric, what is the intuitive idea behind that?

The reason is Euler's formula, from which you get

$$\cos(\omega)=\frac12\big(e^{j\omega}+e^{-j\omega}\big)\tag{1}$$

and

$$j\sin(x)=\frac12\big(e^{j\omega}-e^{-j\omega}\big)\tag{2}$$

If you have symmetric or anti-symmetric coefficients, the corresponding frequency response can always be decomposed in purely real-valued cosine terms $$(1)$$ or purely imaginary sine components $$(2)$$, plus a linear phase term if the filter is not centered around $$n=0$$.

Take as a simple example a filter of length $$N=5$$ with filter coefficients

$$\mathbf{h}=\big[1, 2, 3, 2, 1]\tag{3}$$

starting at index $$n=0$$. The corresponding frequency response is

\begin{align}H(e^{j\omega})&=1+2e^{-j\omega}+3e^{-2j\omega}+2e^{-3j\omega}+e^{-4j\omega}\\&=e^{-2j\omega}\big[e^{2j\omega}+2e^{j\omega}+3+2e^{-j\omega}+e^{-2j\omega}\big]\\&=2e^{-2j\omega}\big[\cos(2\omega)+2\cos(\omega)+3\big]\tag{4}\end{align}

Since the last term in brackets is purely real-valued, $$H(e^{j\omega})$$ has a linear phase response $$\phi(\omega)=-2\omega$$.

For even-length filters you get an additional delay of half a sample, and for anti-symmetric filters there's an additional phase shift of $$\pi/2$$ due to $$j$$ on the left side of $$(2)$$.

Also take a look at this answer discussing the four types of linear phase FIR filters.

• Thank you very much. – Ece Su Ildiz Jun 10 '20 at 10:55