Anda di halaman 1dari 3

CARLETON UNIVERSITY

Department of Systems and Computer Engineering SYSC 4405 Digital Signal Processing Fall Semester, 2013 Assignment #1 Assigned: 18September2013 Due: in drop-box near 4499ME, 2October2013

PROBLEM 1.1: Recall our denition of a discrete-time rectangular pulse given as pN [n] = u[n] u[n N ]. Now consider the following two rectangular discrete-time pulses. x1 [n] = p{N =12} [n] x2 [n] = p{N =8} [n] (a) Use the Matlab function stem() to generate stem plots of x1 [n] and x2 [n] over the range 10 n 40. Consider the following example of a possible pulse implemented in Matlab: x=[zeros(1,10),ones(1,10),zeros(1,10)]; n=-5:1:24; stem(n,x) (b) Using the conv() function in Matlab, evaluate yb [n] = x1 [n] x2 [n] and plot for 10 n 40. Be careful when you make your plot that everything lines up with the appropriate sample index n. How many non-zero samples does yb [n] contain? (c) Now give the Matlab commands to compute yc [n] = x1 [n] x2 [n 3] and generate the stem plot. Comment on the dierences between yc [n] and yb [n]. (d) Now give the Matlab commands to compute yd [n] = x1 [n] x2 [n] [n 3] and generate the stem plot. Comment on the dierences between yd [n] and yc [n]. PROBLEM 1.2: Consider a discrete-time LTI lter given by the dierence equation y [n] = 3x[n] 2x[n 2] + x[n 3] where x[n] is the input and y [n] is the output. (a) Determine the unit impulse response h[n] of the lter. (b) Determine the unit step response of the lter (response when the input is a unit step function u[n]).

1 of 3

(c) Consider now the more complicated input of x[n] = 3 [n 2] + 2u[n 5] 2u[n 7] where [n] is a unit impulse function and u[n] is a unit step function. Using the results from parts (a) and (b) and that the lter is LTI, write the response of the lter to this input. (d) Using Matlabs filter() function, write the Matlab commands that implement the lter using the input from part (c). Compare the results to part (c). (e) Consider now an input of x[n] = {0, 0, 3, 0, 0, 2, 2, 0, 0, 0, 0, 0, 0}. Using discrete-time linear convolution, compute h[n] x[n] where h[n] is the impulse response from part (a). You can implement convolution in Matlab using the conv() function. Compare the result to those from parts (c) and (d). PROBLEM 1.3: Consider a discrete-time lter specied by the following block diagram.

(a) Determine the rst four outputs of the impulse response for this lter (i.e., h[0], h[1], h[2], and h[3]).
2 of 3

(b) Write a dierence equation that describes this lter. (c) Is the lter FIR or IIR? Justify your answer. (d) Using Matlabs filter() function, write a Matlab command that implements this lter. Note: Use help filter for assistance on how to use filter(). (e) With the Matlab command from part (d), use Matlab to compute the impulse response for this lter. You can use the stem() command to display the impulse response. Numerically show that the results obtained for the impulse response with Matlab are the same as those found by hand for part (a). Tip: In Matlab, an example impulse function can be dened as x = [1 zeros(1,20)]. (f) Matlab also has the function impz() for computing the impulse response of a lter (the filter() function is more general and can be used to determine the output for any input and not just an impulse function). Use the impz() function to compute the impulse response and compare the results to part (a) and (e). Note: Use help impz for assistance on how to use impz(). (g) Given initial conditions of y [2] = 3 and y [1] = 1, determine by hand the rst four outputs of the lter when the input is a unit step function u[n]. (h) Give the Matlab commands that result in the same response as for part (g) and demonstrate the command. Tip: Use the ones() function when creating a vector for the unit step function. PROBLEM 1.4: Draw a block diagram realization for each of the lters specied through either a dierence equation, in terms of input x[n] and output y [n], or impulse response h[n]. (a) y [n] = 0.25y [n 1] + 0.1y [n 2] 0.5y [n 4] + 5x[n] + 4x[n 1] (b) h[n] = 3 [n] + 2 [n 1] [n 3] + [n 4]

3 of 3

Anda mungkin juga menyukai