6.7: Numerical Experiment (Frequency Response of First-Order Filter)
Consider the exponential moving average filter
\(x_{n}=\sum_{k=0}^{\infty} a^{k} u_{n-k ;} \quad a=0.98\)
- Write out a few terms of the sum to show how the filter works.
- Write \(x_n\) as a recursion and discuss the computer memory required to implement the filter.
- Compute the complex frequency response \(H(e^{j\theta})\) for the filter
- Write a MATLAB program to plot the magnitude and phase of the complex frequency response \(H(e^{j\theta})\) versus \(\theta\) for \(\theta =−\pi\) to \(+\pi\) in steps of \(\frac{2\pi}{64}\) Do this for two values of \(a\), namely, \(a=0.98\) and \(a=-0.98\). Explain your findings.
-
Write a MATLAB program to pass the following signals through the filter when \(a=0.98\):
- \(u_{n}=\delta_{n}\)
- \(u_{n}=\xi_{n}\)
- \(u_{n}=\xi_{n} \cos \frac{2 \pi}{64} n\)
- \(u_{n}=\xi_{n} \cos \frac{2 \pi}{32} n\)
- \(u_{n}=\xi_{n} \cos \frac{2 \pi}{16} n\)
- \(u_{n}=\xi_{n} \cos \frac{2 \pi}{8} n\)
- \(u_{n}=\xi_{n} \cos \frac{2 \pi}{4} n\)
- \(u_{n}=\xi_{n} \cos \frac{2 \pi}{2} n\)
Plot the outputs for each case and interpret your findings in terms of the complex frequency response \(H(e^{j\theta})\). Repeat step 5 for \(a=-0.98\). Interpret your findings.