Problem Set 5: MAS160: Signals, Systems & Information For Media Technology
Problem Set 5: MAS160: Signals, Systems & Information For Media Technology
Problem Set 5
DUE: November 3, 2003
Instructors: V. Michael Bove, Jr. and Rosalind Picard T.A. Jim McBride
1.5
0.5
-0.5 -4
-3
-2
-1
1
n
1.5
0.5
-0.5 -4
-3
-2
-1
1 n
(0.5)nk u[n k ]
k =0
1
3 8
2
7 16
3
15 32
4
15 64
5
15 128
6
15 256
7
15 512
8
15 1024
9
15 2048
10
15 4096
PS 5-1
(d) 1 y [n] = L
ak =
k =max{0,nL+1}
The max operator simply means that we take the argument of largest value. So in this case, it is either 0 or n L + 1, whichever is larger (which will depend on the values of n and L).
Problem 2: Convolution
For each of the following sets of signals, compute their convolution (1) graphically by hand, (2) with MATLAB (you may use the conv function), and (3) by expressing the signals in terms of [n] and computing the convolution sum. In matlab, plot your results with stem, but be sure to x the n-axis appropriately (use stem(n,y) where n is a vector of the appropriate range). (a)
(b)
1 For each of the following of signals, compute their convolution with x[n] = cos(2 ( 16 )n) using matlab (you may use the conv function). Use stem to plot your result over the range [0:99], assuming the sinusoid exists for all time. Compare each convolution with x[n]. 1 (c) h[n] = 1 2 [n] + 2 [n 1] (d) h[n] = [n] [n 1]
PS 5-2
SOLUTION : For the graphically by hand portions of this problem, I intended for you to break down the x[n] into separate scaled and shifted impulses, convolve them separately, and then sum the results. Some people interpreted this to mean to solve the convolution by hand in tabular form (which really amounts to the same thing), which I also accepted. (a) The graphical solution is demonstrated in the gure below. Obviously, the matlab solution is identical to the nal summation.
[n] 2 1 0 -1 -2 -2 -1 0 1 2[n-1] 2 1 0 -1 -2 -2 -1 0 1 [n-2] 2 1 0 -1 -2 -2 -1 0 1 2 3 4 2 1 0 -1 -2 -2 2 1 0 -1 -1 0 1 n 2 3 4 -2 -2 -1 0 1 n 2 3 4 -1 0 1 2 3 4 2 3 4 2 1 0 -1 -2 -2 -1 0 1 [n-2] * h[n] 2 3 4 2 3 4 2 1 0 -1 -2 -2 -1 0 1 2 3 4 [n] * h[n]
2[n-1] * h[n]
Figure 2: Pointwise Convolution for (a) Here is the solution expressed in tabular form, this time breaking down h[n] into separate scaled and shifted impulses:
PS 5-3
-2 0 0 0 0
-1 0 0 0 0 0
0 1 1 1 0 1
1 2 -1 2 -1 1
2 1 0 1 -2 -1
3 0 0 0 -1 -1
0 0
Below is the convolution sum performed by expressing the signals in terms of [n]: x[n] = [x] + 2 [n 1] + [n 2] h[n] = [x] [n 1]
2
y [0] =
k =0 2
y [1] =
k =0 2
y [2] =
k =0 2
y [3] =
k =0
y [n] = [n] + [n 1] [n 2] [n 3]
(b) Again, the graphical solution is demonstrated in the gure below. The solution expressed in tabular form: n x[n] h[n] h[0]x[n 0] h[1]x[n 1] h[2]x[n 2] x[n] h[n] -2 0 0 0 -1 1 0 1 0 1 0 1 1 1 -1 0 0 1 1 -1 1 -1 1 1 2 1 1 1 -1 1 1 3 0 0 0 -1 1 0 4 5
0 1 1
0 0
PS 5-4
[n+1] 2 1 0 -1 -2 -2 2 1 0 -1 -2 -2
[n+1] * h[n]
-1
1 [n]
-1
[n] * h[n] 2 1 0 -1 -2 -2
2 1 0 -1 -2 -2
-1
-1
[n-1] 2 1 0 -1 -2 -2 2 1 0 -1 -2 -2
[n-1] * h[n]
-1
-1
[n-2] 2 1 0 -1 -2 -2 2 1 0 -1 -2 -2
[n-2] * h[n]
-1
-1
-1
1 n
Figure 3: Pointwise Convolution for (b) The convolution sum is achieved mathematically as follows: x[n] = [n + 1] + [n] + [n 1] + [n 2] h[n] = [n] [n 1] + [n 2]
2
y [1] =
k =1 2
y [0] =
k =1 2
y [1] =
k =1
y [2] = x[0]h[2] + x[1]h[1] + x[2]h[0] = (1)(1) + (1)(1) + (1)(1) = 1 y [3] = x[1]h[2] + x[2]h[1] = (1)(1) + (1)(1) = 0 y [4] = x[2]h[2] = (1)(1) = 1 y [n] = [n + 1] + [n 1] + [n 2] + [n 4] PS 5-5
0.5
-0.5
-1
10
20
30
40
50
60
70
80
90
100
0.5
-0.5
-1
10
20
30
40
50 n
60
70
80
90
100
Figure 4: (c) A Low Pass Filter (d) A High Pass Filter (c) (d) The lter in part (c) is an averaging (low-pass) lter. Since x[n] is of fairly low frequency, the signal doesnt change much. In part (d), the lter is a dierence (generally high-pass) lter, which does aect the amplitude substantially.
b0 3
b1 7
b2 13
b3 9
b4 5
y [n] =
k =0
bk x[n k ]
= 13x[n] 13x[n 1] + 13x[n 2] But since x[n] = We see that x[n] = x[n 2]. Therefore: y [n] = 26x[n] 13x[n 1] = 13, for n even 26, for n odd PS 5-6 0, 1, for n even for n odd
y[n]
(a) Express the overall impulse response, h[n], in terms of h 1 [n], h2 [n], h3 [n] and h4 [n]. (b) Determine h[n] when
1 1 h1 [n] = { 1 2, 4, 2} h2 [n] = h3 [n] = (n + 1)u[n] h4 [n] = [n 2]
SOLUTION :
(a) The combined impulse response of a cascade of two LTI systems is simply the convolution of the two impulse responses. The impulse response of an addition (or subtraction) of two LTI systems is simply the sum (or dierence) of the two impulse responses. Thus, for the overall system impulse response, we obtain: h[n] = h1 [n] {h2 [n] (h3 [n] h4 [n])}
PS 5-7
=
k =
[k 2](n k + 1)u[n k ]
= (n 1)u[n 2] h5 [n] h2 [n] (h3 [n] h4 [n]) = (n + 1)u[n] (n 1)u[n 2] 0, n > 0 = 1, n = 0 2, n > 0 h[n] = h1 [n] h5 [n] 1 1 1 = h5 [n] + h5 [n] + h5 [n] 2 4 2 0, n < 0 1 2, n = 0 5 = 4 , n=1 2, n = 2 5 2, n > 2
Unit Delay 2
Unit Delay 4
Unit Delay
Unit Delay 1
y[n] +
x[n]
Unit Delay
4 Unit Delay
2 Unit Delay
+ Unit Delay
y[n] +
Figure 5: System Diagram in Direct Form (above) and Transposed Direct Form (below)
PS 5-8
Using systems of equations, compute the impulse response given the following system descriptions and input-output pairs (a) (b) (c) (d) FIR and single delay, x[n] = [n], y [0] = 2, y [1] = 2 FIR and double delay, x[n] = [n], y [0] = 3, y [1] = 4, y [2] = 3/2 FIR and double delay, x[n] = 4 [n] + [n 1], y [0] = 2, y [1] = 2, y [2] = 1 Calculate y [3] for each of the preceding systems.
SOLUTION :
(a) Since the input x[n] is an impulse, we could simply get the impulse response h[n] by inspection. But just to show the math well do this one the long way: y [n] = ax[n] + bx[n 1] y [0] = ax[0] + bx[1] 2 = a(1) + b(0) a=2 y [1] = 2x[1] + bx[0] 2 = 2(0) + b(1) b = 2 y [n] = 2x[n] 2x[n 1] h[n] = 2 [n] 2 [n 1] (b) This one also has an impulse input, so this time we can simply obtain the impulse response by inspection: 3 h[n] = 3 [n] 4 [n 1] + [n 2] 2
PS 5-9
(c) Since the input is not just an impulse, we actually have to perform a deconvolution using a system of equations to get our answer. x[n] = 4 [n] + [n 1] 4, n = 0 = 1, n = 1 0, otherwise
y [n] = ax[n] + bx[n 1] + cx[n 2] y [0] = ax[0] + bx[1] + cx[2] 2 = a(4) + b(0) + c(0) 1 a= 2 y [1] = ax[1] + bx[0] + cx[1] 1 2 = (1) + b(4) + c(0) 2 3 b= 8 y [2] = ax[2] + bx[1] + cx[0] 3 1 1 = (0) + (1) + c(4) 2 8 11 c= 32
1 3 11 y [n] = x[n] + x[n 1] x[n 2] 2 8 32 1 3 11 h[n] = [n] + [n 1] [n 2] 2 8 32 (d) Using the coecients above, it is simple to calculate y [3]: y [3] = 2x[3] 2x[2] = 2(0) 2(0) = 0 3 3 y [3] = 3x[3] 4x[2] + x[1] = 3(0) 4(0) + (0) = 0 2 2 1 3 11 1 3 11 11 y [3] = x[3] + x[2] x[1] = (0) + (0) (1) = 2 8 32 2 8 32 32 (a) (b) (c)
PS 5-10