ECE 381: Laboratory 9

Winter 2006

Discrete-time system response by recursion

March 28


    Part II. Assignment

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 h1[n] of this system for 0 ≤ n ≤ 20. Use the function dtsim as explained in the preparatory notes. Make a stem plot of h1[n] versus n. (You can use stem or dtplot for that.)

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 h2[n] of this system for 0 ≤ n ≤ 20 using dtsim as in Exercise 1, and similarly, make a stem plot of h2[n] versus n.

3.      Explain the relationship between h1[n] and h2[n] obtained in Exercises 1 and 2, respectively. In particular, can you express h1[n] in terms of h2[n]? Verify your answer numerically.

      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 s[n] = 0.1n + sin(0.1nπ), 0 ≤ n ≤ 60:

b.      n = 0:60; sn = 0.1*n + sin(0.1*n*pi);

Next, construct a vector, the same size as for s[n], of zero-mean uniformly-distributed noise samples. Call this noise signal w[n]. Add w[n] to s[n] to obtain the noisy signal. Call the noisy signal x[n]:

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 x[n] of part a using this filter. That is, obtain the system response using dtsim. Assume zero initial state. Plot the filtered signal y[n] on the same axis with the original signal s[n], as done in part a, with the SNR written in the figure title.

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:

  1. Based on the results obtained, evaluate the above filters in terms of their noise suppression capabilities.
  2. Suggest an extended experiment to test (prove or disprove) your conclusions in i.
  3. Can you identify other measures of performance for these noise suppression filters? (Trying small values for parameter a would be helpful.)

Turn in all plots, MATLAB scripts and/or functions. Include your comments and answers to questions.


School of Computing and Engineering
University of Missouri - Kansas City

Last updated: March 27, 2006