Sale!

Digital Signal Processing Home Assignment 2 Solved

Original price was: $35.00.Current price is: $30.00. $25.50

Description

5/5 - (3 votes)

Filter Implementation
Moving Average Filter
The general form of a Finite Impulse Response Filter (FIR) is described by,
y [n] =
M
X−1
k=0
h [k] x [n − k]
if the filter impulses (the h [k]’s) are set to constant coefficients divided by the tap number M, the
equation becomes the well-known Moving Average Filter given by
y [n] = 1
M
M
X−1
k=0
x [n − k]
for instance we have
M = 2 : y [n] = 1
2
x [n] + 1
2
x [n − 1]
M = 3 : y [n] = 1
3
x [n] + 1
3
x [n − 1] + 1
3
x [n − 2]
M = 4 : y [n] = 1
4
x [n] + 1
4
x [n − 1] + 1
4
x [n − 2] + 1
4
x [n − 3]
an so on. Consider the moving average filter for M = 3,
• compute its system function H, plot its poles and zeros in the complex plane.
• compute the magnitude |H(z)|, the argument arg (H(z)) of your system function, and plot both in
the frequency domain.
• implement the moving average filter for any given M. Sample 30 points of the signal
x(t) = cos(1
2
πt)
and test your implementation for M = 3, 6, 9.
The Window Method
Recall that oscillations tend to appear when we abruptly truncate any signal. Windows help to considerably reduce these spurious oscillations providing a cleaner output after truncation. Implement the
following window functions for any number of points M,
• the Bartlett window
• the Blackman window
• the Hamming window
• the Hann window
test your implementation versus the one in the signal.windows library by displaying them vis-`a-vis,
then visualize the frequency response, i.e. apply the Fourier transform to your window, then shift the
spectrum to the center and take its absolute value. For better visualizations apply logarithm to your final
computation and plot it in the frequency domain.
2