ECE 381: Laboratory 9 |
Winter 2006 |
Discrete-time system response by recursion |
March 28 |
|
|
|
Preparatory
notes | Assignment |
|
Download the following files to the local directory - dtsim, dtplot, sysresp1, axesn, randist
1.
A
relaxed discrete-time system is described by the following difference equation:
y[n] - 0.64y[n-2] = 2x[n] + x[n-1].
Obtain the impulse response
2.
Another
relaxed discrete-time system is described by the following difference equation:
2y[n] - 1.28y[n-2] = x[n].
Obtain the impulse response
3.
Explain
the relationship between
4. This exercise is about filtering out the noise from a discrete-time signal corrupted by a zero-mean white noise process.
a.
First,
construct a MATLAB vector for the noise-free signal
b.
n = 0:60; sn = 0.1*n +
sin(0.1*n*pi);
Next, construct a vector, the same size as for
wn = rand(size(sn)); % rand(M,N) returns an M-by-N matrix of pseudo-
% random numbers uniformly distributed over the
% interval [0,1)
wn = wn - 0.5; % subtract 0.5 to make zero-mean noise
wn = a*wn; % multiply by a to make noise stronger (a > 1)
% or weaker (0 < a < 1)
xn = sn + wn;
Now, plot the original noise-free signal and its noisy version in one figure on the same axis. Do not use stem plots, but instead, use the regular plot function. Also compute the SNR (signal-to-noise ratio) and write it in the figure title:
plot(n,sn,'- .',n,xn,'-');
snr = sum((sn-0.1*n).^2); % pure sinusoidal power in the signal
snr = 10*log10(snr/sum((xn-sn).^2)); % divide by noise power
title(['Lab06Ex4a: Original noisy signal (SNR = ' ...
num2str(snr) ' dB)']);
c.
Now
consider the 4-point moving average filter
y[n] = 0.25x[n] + 0.25x[n-1] + 0.25x[n-2] + 0.25x[n-3].
Filter
the noisy signal
d.
Repeat
part b using the 4-point weighted moving average filter
y[n] = 0.4x[n] + 0.3x[n-1] + 0.2x[n-2] + 0.1x[n-3].
e.
Repeat
part b using the recursive exponential averaging filter
y[n] - 0.6y[n-1] = 0.4x[n].
Comment on the results. In particular:
Turn in all plots, MATLAB scripts and/or functions. Include your comments and answers to questions.
School of Computing and Engineering |
Last updated: March 27, 2006 |