1
20kviews
Design a linear phase FIR high pass filter using hamming window, with a cutoff frequency, $\mathrm{w}_{\mathrm{c}}=0.8 \mathrm{\pi rad} /$sample and N = 7.
3
1.3kviews

Given: $\mathrm{N}=7$

Cut-off frequency $\omega_{c}=0.8 \pi$

Let Gain $\mathrm{C}=1$

$\therefore \alpha=\frac{N-1}{2}=\frac{7-1}{2}=3$

For a HPF, Desired Frequency Response is

$H_{d}\left(e^{j w}\right)=\left\{\begin{array}{cc}{0} & {|\omega| \leq \omega_{c}} \\ {C e^{-j \alpha \omega}} & {\omega_{c} \leq|\omega| \leq \pi}\end{array}\right.$

$=\left\{\begin{array}{cc}{0} & {|\omega| \leq 0.8 \pi} \\ {1 e^{-j 3 \omega}} & {0.8 \pi \leq|\omega| \leq \pi}\end{array}\right.$

$\therefore$ Desired Impulse Response

$h_{d}(n)=\operatorname{Inv} D T F T\left\{H_{d}(\omega)\right\}$

$=\frac{1}{2 \pi} \int_{-\pi}^{\pi} H_{d}(\omega) e^{j \omega n} d \omega$

$=\frac{1}{2 \pi}\left\{\int_{-\pi}^{-0.8 \pi} e^{-3 j \omega} \cdot e^{j \omega n} d \omega+\int_{-0.8 \pi}^{0.8 \pi} 0 \cdot e^{j \omega n} d \omega+\int_{0.8 \pi}^{\pi} e^{-3 j \omega} \cdot e^{ j \omega n} d \omega\right\}$

$=\frac{1}{2 \pi}\left\{\int_{-\pi}^{-0.8 \pi} e^{(n-3) j \omega} d \omega+0+\int_{0.8 \pi}^{\pi} e^{(n-3) j \omega} d \omega\right\} \cdots(1)$

$=\frac{1}{2 \pi}\left\{\left[\frac{e^{(n-3) j \omega}}{(n-3) j}\right]_{-\pi}^{-0.8 \pi}+\left[\frac{e^{(n-3) j \omega}}{(n-3) j}\right]_{0.8 \pi}^{\pi}\right\}$

$=\frac{1}{2 \pi} \times \frac{1}{(n-3) j}\left\{\left[e^{-j(n-3) 0.8 \pi}-e^{-j(n-3) \pi}\right]+\left[e^{j(n-3) \pi}-e^{j(n-3) 0.8 \pi}\right]\right\}$

$=\frac{1}{2 \pi} \times \frac{1}{(n-3) j}\left\{e^{j(n-3) \pi}-e^{-j(n-3) \pi}-e^{j(n-3) 0.8 \pi}+e^{-j(n-3) 0.8 \pi}\right\}$

$=\frac{1}{2 \pi} \times \frac{1}{(n-3) j}\left\{\left[e^{j(n-3) \pi}-e^{-j(n-3) \pi}\right]- \left[e^{j(n-3) 0.8 \pi}-e^{-j(n-3) 0.8 \pi}\right]\right\}$

$=\frac{1}{2 \pi} \times \frac{1}{(n-3) j}[2 j \sin (n-3) \pi-2 j \sin (n-3) 0.8 \pi]$

$=\frac{1}{2 j(n-3) \pi} \times 2 j[\sin (n-3) \pi-\sin (n-3) 0.8 \pi] \quad(\mathrm{n} \neq 3)$

Put $\mathrm{n}=3$ in $(1)$

$h_{d}(3)=\frac{1}{2 \pi}\left\{\int_{-\pi}^{-0.8 \pi} e^{0} d \omega+0+\int_{0.8 \pi}^{\pi} e^{0} d \omega\right\}$

$=\frac{1}{2 \pi}\left\{[\omega]_{-\pi}^{-0.8 \pi}+[\omega]_{0.8 \pi}^{\pi}\right\}$

$=\frac{1}{2 \pi}\{[-0.8 \pi-(-\pi)]+[\pi-0.8 \pi]\}$

$=\frac{1}{2 \pi} \times 0.4 \pi$

$=0.2$

$\therefore$ Desired Impulse Response

$h_{d}(n)=\left\{\begin{array}{cc}{\frac{\sin (n-3) \pi-\sin (n-3) 0.8 \pi}{(n-3) \pi}} & {n \neq 3} \\ {0.2} & {n=3}\end{array}\right.\cdots(2)$

$h_{d}(n)$ is of infinite duration. To make if of finite duration we multiply it with Hamming window function

$W(n)=\left\{\begin{array}{cc}{0.54-0.46 \cos \frac{\pi n}{\alpha}} & {0 \leq n \leq N-1} \\ {0} & {\text { otherwise }}\end{array}\right.$

$=\left\{\begin{array}{cc}{0.54-0.46 \cos \frac{\pi n}{3}} & {0 \leq n \leq 6} \\ {0} & {\text { otherwise }}\end{array}\right.\cdots(3)$

$\therefore$ Finite Impulse Response $h(n)=h_{d}(n) \times W(n) \cdots(4)$

For linear phase FIR filters, $h_{d}(n)=h_{d}(N-1-n)$

$=h_{d}(7-1-n)=h_{d}(6-n)$

$\therefore h_{d}(6)=h_{d}(0) ; h_{d}(5)=h_{d}(1) ; h_{d}(4)=h_{d}(2)$

$\therefore$ From $(2),(3) \&(4),$ the filter coefficients are

$\begin{array}{|c|c|c|c|}\hline \mathbf{n} & {h_{d}(n)} & {W(n)} & {h(n)} \\ \hline 0 & {-0.1009} & {0.08} & {-0.0081} \\ \hline 1 & {-0.1514} & {0.31} & {0.0469} \\ \hline 2 & {-0.1871} & {0.77} & {-0.1441} \\ \hline 3 & {0.2000} & {1.00} & {0.2000} \\ \hline 4 & {-0.1871} & {0.77} & {-0.1441} \\ \hline 5 & {0.1514} & {0.31} & {0.0469} \\ \hline 6 & {-0.1009} & {0.08} & {-0.0081} \\ \hline\end{array}$

$\therefore$ Transfer Function of Filter

$H(z)=Z\{h(n)\}=\sum_{n=0}^{7-1} h(n) \cdot z^{-n}$

$=h(0)+h(1) \cdot z^{-1}+h(2) \cdot z^{-2}+h(3) \cdot z^{-3}+h(4) \cdot z^{-4}+h(5) \cdot z^{-5}+h(6) \cdot z^{-6}$

$=-0.0081+0.0469 z^{-1}-0.1441 z^{-2}+0.2 z^{-3}-0.1441 z^{-4}+0.0469 z^{-5}-0.0081 z^{-6}$

$=0.2 z^{-3}-0.1441\left(z^{-2}+z^{-4}\right)+0.0469\left(z^{-1}+z^{-5}\right)-0.0081\left(1+z^{-6}\right)$

since the FIR filter is symmetric and $\mathrm{N}=7$ is odd,

Frequency Response

$H\left(e^{j \omega}\right)=e^{-j \alpha \omega}\left[h(\alpha)+2 \sum_{n=0}^{\alpha-1} h(n) \cos (\alpha-n) \omega\right]$

$=e^{-j 3 \omega}\left[h(3)+2 \sum_{n=0}^{2} h(n) \cos (3-n) \omega\right]$

\begin{aligned}=e^{-j 3 \omega}\{h(3)+2[ & h(0) \cos (3-0) \omega+h(1) \cos (3-1) \omega+h(2) \cos (3-2) \omega]\} \end{aligned}

$=e^{-j 3 \omega}\{0.2+2[-0.0081 \cos 3 \omega+0.0469 \cos 2 \omega-0.1441 \cos \omega]\}$

Phase $=-3 \omega$ and

Amplitude $=0.2-0.016 \mathrm{cos} 3 \omega+0.09328 \cos 2 \omega-0.2881 \mathrm{cos} \omega$