ELEC 264 - Assignment 1
ELEC 264 - Assignment 1
PURPOSE: This assignment will give you the opportunity to learn more about DT and
CT signals and systems, LTI systems, impulse and step response, and convolution.
Question #1 [10%]
Clearly sketch by hand the following signals (hand in your sketches):
1. x(t ) u (t ) u (t 1) 2u (t 2)
1
2. x(t ) rect(t ) tri t
2
3. x(t ) ramp(t ) u (t 2)
2t t
4. x(t ) 2tri 3rect
3 3
5
5. x[n] k [ n k ]
k 5
Solution:
1. x(t ) u (t ) u (t 1) 2u (t 2)
1.5
0.5
0
-1 -0.5 0 0.5 1 1.5 2 2.5 3
0.8
0.6
0.4
0.2
0
-2 -1.5 -1 -0.5 0 0.5 1 1.5 2
3. x(t ) ramp(t ) u (t 2)
-1
-2
-3
-4
-5
-5 0 5
2t t
4. x(t ) 2tri 3rect
3 3
0
-3 -2 -1 0 1 2 3
-5
-5 0 5
0.5
-0.5
-5 0 5
.
0.8
0.6
0.4
0.2
0
-5 0 5
3. Evaluate the integral 3e t (t 2)dt
Answer: 3e t (t 2)dt 3e 2 (shifting property)
1 n
4. Evaluate the sum 1 [ n 3]
2
n
1 n
1 n 7
Answer: 1 [n 3] 1 (shifting property)
2
n 2 n 3 8
k
31
5. Evaluate the sum u[k ] u[n k ]
k 4 4
Answer:
k k k n 1
31
31 3 n 1 3 1 (1/ 4) n 1 1
u[ k ] u[ n k ] u
k 4 4
[ k ] u[ n k ]
k 4 4 1, k 0
4 k 0 4 4 1 1/ 4
1
4
, n0
1, k n
Determine if each of the following properties are satisfied and justify your answer:
Solution:
1. Linear, time invariant, causal, not memoryless, stable.
Linearity:
x1[n] y1[n] ( x1[n] x1[n 1] x1[n 2]) / 3
x2 [n] y2 [n] ( x2 [n] x2 [ n 1] x2 [ n 2]) / 3
For x[n] x1[n] x2 [n] , we have
y[n] ( x[n] x[n 1] x[n 2]) / 3
( x1[ n] x2 [ n] x1[n 1] x2 [n 1] x1[n 2] x2 [n 2]) / 3
( x1[n] x1[n 1] x1[ n 2]) / 3 ( x2 [n] x2 [n 1] x2 [ n 2]) / 3
y1 [ n ] y2 [ n ]
y1[n] y2 [n]
Hence, the system is linear
Time invariance:
y[n n0 ] is given by y[n n0 ] ( x[n n0 ] x[n n0 1] x[n n0 2]) / 3
and if X [n] x[n n0 ] , then
Y [n] ( X [n] X [n 1] X [n 2]) / 3 ( x[ n n0 ] x[ n n0 1] x[ n n0 2]) / 3 y[ n n0 ]
Hence, the system is time invariant.
Causality: the output at time n depends on the inputs at times n , n 1 , and n 2 . That is, the output
does not depend on the future values of the input. Thus, the system is causal.
Memory: The output depends on the past and the present values of the input. The system is not
memoryless. y[0] ( x[0] x[1] x[2]) / 3 .
1
Stability: assume that | x[n] | B, n . Thus, | y[n] | ( B B B ) B . The system is stable.
3
2. Linear, not time invariant, noncausal, not memoryless, not stable.
Linearity:
x1 (t ) y1 (t ) (t 2) x1 (t 2)
x2 (t ) y2 (t ) (t 2) x2 (t 2)
For x(t ) x1 (t ) x2 (t ) , we have
y (t ) (t 2) x(t 2) (t 2) x1 (t 2) x2 (t 2)
(t 2) x1 (t 2) (t 2) x2 (t 2) y1 (t ) y2 (t )
y1 ( t ) y2 ( t )
Time invariance:
y (t t0 ) is given by y (t t0 ) | t t0 | x (t t0 )
and if X (t ) x(t t0 ) , then Y (t ) | t | X (t ) | t | x (t t0 ) y (t t0 )
The system is not time invariant.
Causality: The output depends only on the present input and does not depend on the future values of
the input. Thus, the system is causal.
Memory: The output depends only on the present values of the input. The system is memoryless.
Stability: as t , y (t ) for most bounded inputs due to the | t | multiplicative factor. Hence,
the system is not stable.
i(t) +
+
x(t) y(t)
-
-
2. By definition of the step response, we have s(t ) T [u (t )] . So we need to solve the ODE:
ds (t ) 1 1
y (t ) u (t ) . Recall that the solution to the general ODE: y ay bx is given by
dt 2 2
t
y (t ) e y (0) be a (t ) x( )d
at
0
1 t
In our case, we have a 12 , b 21 , and y (0) 0 . Thus, s (t ) e (t ) / 2u ( )d 1 e t / 2 u (t )
2 0
Step reponse
1
0.8
0.6
s(t)
0.4
0.2
0
0 2 4 6 8 10
t
3. The impulse response is the derivative of the step response h(t ) s '(t ) . Thus,
h(t ) s '(t ) 1 e t / 2 u (t ) ' u (t ) e t / 2u (t ) ' (t ) e t / 2 (t ) 12 e t / 2u (t )
0.4
0.3
h(t)
0.2
0.1
0
0 2 4 6 8 10
t
1. After 5 years, how much money does the investor have, assuming constant 8% interest rate?
2. After 40 years, how much does the investor have?
Hint: Think of the initial investment as an impulse 5000 [n] which has a response (1.08)n 5000 . The next
investment looks like 5000 [n 1] , and the final investment is another impulse at n 2.
Solution:
5000
4500
4000
3500
3000
x[n]
2500
2000
1500
1000
500
0
2009 2010 2011
n
Calculate the convolution y (t ) xi (t ) h(t ) for the impulse response h(t ) and each of the signals
xi (t ) shown in the figure below. Sketch by hand each response.
Solution:
Recall that the equation of a line passing through two points ( x1 , y1 ) and ( x2 , y2 ) is given by:
y y x y x y
y 2 1 t 2 1 1 2
x2 x1 x2 x1
From the plot, we may express h(t ) in terms of unit step functions u (t ) as follows:
Also recall the sifting property of the unit impulse function: x(t ) * (t a ) (t a ) * x(t ) x (t a )
a) y (t ) xa (t ) * h(t ) [ (t ) (t 6)]* h(t ) (t ) * h(t ) (t 6) * h(t ) h(t ) h(t 6)
1.5
y(t) = h(t)+h(t-6)
0.5
0
-2 -1 0 1 2 3 4 5 6 7 8 9 10
1.5
y(t) = h(t)+h(t-2)
0.5
0
-2 -1 0 1 2 3 4 5 6
4
y(t) = h(t)+2h(t-1)
0
-2 -1 0 1 2 3 4 5 6
Answer:
y[n] 0 n 1 2 n 3
y[3] 1 y[1] 1 1 2 0 4
y[2] 1 1 0 y[2] 1 2 3
y[1] 1 1 1 1 y[3] 2
y[0] 1 1 1 2 3 y[n] 0 n 2 1 n 3
4
3
v[n]=x[n]*h[n]
-1
-6 -5 -4 -3 -2 -1 0 1 2 3 4 5 6
n 1
1
Therefore, h[ n] u[n 1] .
2
ELEC 264 – Winter 2013 Page 11 of 13 Assignment 1
Question #9: [20%]
Let y[n] 0.5 y[n 1] x[n] be a discrete-time filter whose impulse response is given by
{1,1/ 2,1/ 4,1/ 8,1/16,...} . For this question, we will use only the first five elements, that is
h[n] {1,1/ 2,1/ 4,1/ 8,1/16} .
1. Let x[n] {4, 4,8, 8,8, 4} be the input to the filter. Clearly sketch by hand x[n] and h[n] .
2. Find and sketch by hand the product r[n] x[n] h[n]
3. Find and sketch by hand the convolution v[n] x[n] h[n]
4. Using MATLAB, find and plot the convolution v[n] x[n] h[n]
5. Using MATLAB, find and plot the convolution w[n] x[n] h[n] when the input is
x[n] {0, 0, 0,8, 8,16, 16,16, 8, 4, 4,8, 8,8, 4} .
Solution:
n
1
1. Note that h[ n] {1,1/ 2,1/ 4,1/ 8,1/16} u[ n]
2
0.8
0.6
h[n]
0.4
0.2
0
0 1 2 3 4
2
x[n]
-2
-4
-6
-8
0 1 2 3 4 5
2
r[n]=x[n]h[n]
-1
-2
0 1 2 3 4 5
3. and 4. v[n] x[n] h[n] {4, -2, 7, -9/2, 23/4, -5/4, -1/2, -1/2, 0, -1/4}
4
v[n]=x[n]*h[n]
-2
-4
1 2 3 4 5 6 7 8 9
n
5. w[n] x[n] h[n] {0, 0,0,8, 4,14, 9,11.5, 2.5,3, 3, 7, 5,5.75, 1.25, 0.5, 0.5, 0, 0.25}
15
10
w[n]=x[n]*h[n]
-5
-10
0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18
n