02 Discrete Convolution Demo
02 Discrete Convolution Demo
Pre-Lab and Warm-Up: You should read at least the Pre-Lab and Warm-up sections of this mini project and go over all exercises in the Pre-Lab section before coming to class. Verication: The Warm-up section of the mini project must be completed during class and the steps marked Instructor Verication must also be signed off during class. The instructor must verify the appropriate steps by signing on the Instructor Verication line. When you have completed a step that requires verication, simply demonstrate the step to the instructor. Memo: Turn in a one page (or so) memo on Section 4 with graphs and explanations. You are asked to label the axes of your plots and include a title for every plot. In order to keep track of plots, include your plot inlined within your memo. If you are unsure about what is expected, ask.
Introduction
t h k n
CD-ROM Chap 5 Demos dconvdemo
This mini project concentrates on the use of dconvdemo a GUI for discrete-time convolution. This is exactly the same as the M ATLAB functions conv() and firfilt() used to implement FIR lters. This demo illustrates an important point about the behavior of a linear, time-invariant (LTI) system. It also provide a convenient way to visualize the output of a LTI system.
The rst objective of this mini project is to demonstrate usage of the convolution GUI. First, load the demo by going to the CD-ROM and clicking on Getting Started. At the bottom of this page are instructions on how to load the sprst M ATLAB toolbox. Install the toolbox. In the M ATLAB command window enter sprst to set up the correct M ATLAB paths, then enter dconvdemo to run the demo.
2.1
In this demo, you can select an input signal x[n], as well as the impulse response of the lter h[n]. Then the demo shows the ipping and shifting used when a convolution is computed. This corresponds to the sliding window of the FIR lter. Figure 1 shows the interface for the dconvdemo GUI. In the pre-Lab, you should perform the following steps with the dconvdemo GUI. (a) Set the input to a nite-length pulse: x[n] = 2 {u[n] u[n 10]}. (b) Set the lters impulse response to obtain a ve-point averager. (c) Use the GUI to produce the output signal. (d) When you move the mouse pointer over the index n below the signal plot and do a click-hold, you will get a hand tool that allows you to move the n-pointer. By moving the pointer horizontally you can observe the sliding window action of convolution. You can even move the index beyond the limits of the window and the plot will scroll over to align with n. (e) Set the lters impulse response to a length-10 averager, i.e., h[n] = 0.1{u[n] u[n 10]}. Use the GUI to produce the output signal.
McClellan, Schafer, and Yoder, Signal Processing First, ISBN 0-13-065562-7. Prentice Hall, Upper Saddle River, NJ 07458. c 2003 Pearson Education, Inc.
Figure 1: Interface for discrete-time convolution GUI. (f) Set the lters impulse response to a shifted impulse, i.e., h[n] = [n 3]. Use the GUI to produce the output signal. (g) Compare the outputs from parts (c), (e) and (f). Notice the different shapes (triangle, rectangle or trapezoid), the maximum values, and the different lengths of the outputs.
McClellan, Schafer, and Yoder, Signal Processing First, ISBN 0-13-065562-7. Prentice Hall, Upper Saddle River, NJ 07458. c 2003 Pearson Education, Inc.
The objective of the warm-up in this mini project is to use the convolution GUI to solve problems (some of which may be assigned homework problems).
3.1
In the warm-up, you should perform the following steps with the dconvdemo GUI. (a) Set the input to a nite-length sinusoid: x[n] = 2 cos(2(n 2)/3) (u[n 2] u[n 12]). (b) Set the lters impulse response to obtain a 3-point averager. (c) Use the GUI to produce the output signal. (d) Explain why the output has ve different regions and why the output is zero in three of the ve. Instructor Verication (separate page)
In each of the following exercises, you should make a screen shot of the nal picture produced by the GUI to validate that you were able to do the implementation. In all cases, you will have to do some mathematical calculations to verify that the M ATLAB GUI result is correct.
4.1
Discrete-Time Convolution
Use the discrete-time convolution GUI, dconvdemo, to do the following: (a) Find the output of a digital lter whose impulse response is h[n] = u[n + 3] u[n] when the input is x[n] = 2 cos(2(n 2)/3){u[n 2] u[n 12]} (b) Use the GUI to determine the length of the output signal and notice that you can see ve regions. Label the ve regions. Note: the regions of partial overlap would be called transient regions while the region of complete overlap would be the steady-state region. (c) Use numerical convolution to get the exact values of the output signal for each of the ve regions. Thus, you will verify that the GUI is correct. Also verify that the duration of the output signal is correct.
McClellan, Schafer, and Yoder, Signal Processing First, ISBN 0-13-065562-7. Prentice Hall, Upper Saddle River, NJ 07458. c 2003 Pearson Education, Inc.
Name:
Part 3.1: Demonstrate that you can run the discrete-time convolution demo. Explain why the output is zero in three of the ve regions identied for the output signal. Veried: Date/Time:
McClellan, Schafer, and Yoder, Signal Processing First, ISBN 0-13-065562-7. Prentice Hall, Upper Saddle River, NJ 07458. c 2003 Pearson Education, Inc.