1. A digital filter is described by
y(n) − 2.56y(n − 1) + 2.22y(n − 2) − 0.65y(n − 3) = x(n) + x(n − 3)
where x(n) is the input and y(n) is the output. Assume all zero initial conditions
(a) Generate the input signal x(n), which is a sinusoid of frequency 500 Hz sampled at 6 kHz.
(b) Compute the first four cycles of the output by directly implementing the above difference equation.
Plot the input and output on the same graph.
(c) Implement the above filter by using MATLAB “filter” function. Compare your results with part(b).
Comment on your result.
(d) Plot the impulse response of the filter by using MATLAB “impz” function. Comment on the results.
>> x=[1 -2 1];
>> y=filter([0.5 -0.5],[1 -0.25],x)
y =
0.50000 -1.37500(y(1)) 1.15625
Comments
Leave a comment