Concordia University
ELEC 264 --- Winter 2013
Signals and Systems I
Assignment 1 --- Due February 15, 2013
Solutions
______________________________________________________________________________
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.
TEAMS: The assignment must be done individually.
PREPARATION: Parts of this assignment require knowledge of concepts from chapters
1 and 2 of your textbook.
______________________________________________________________________________
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
ELEC 264 – Winter 2013 Page 1 of 13 Assignment 1
1
2. x(t ) rect(t ) tri t
2
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
ELEC 264 – Winter 2013 Page 2 of 13 Assignment 1
5
5. x[n] k [ n k ]
k 5
-5
-5 0 5
Question #2: [4%]
Using MATLAB, plot the following signals (hand in your MATLAB plots):
2 t
1. x(t ) e sin 10t u (t ), | t | 5
5
n
2
2. x[n] u[n], n 5,...,5
3
Solution:
1. x(t ) e 2t sin 10t u (t ), | t | 5
5
1
0.5
-0.5
-5 0 5
.
ELEC 264 – Winter 2013 Page 3 of 13 Assignment 1
n
2
2. x[n] u[n], n 5,...,5
3
1
0.8
0.6
0.4
0.2
0
-5 0 5
Question #3: [6%]
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
Question #4: [20%]
Consider the systems described by the following input-output relations x[n] y[n] or x(t ) y (t ) :
1. y[n] ( x[n] x[n 1] x[n 2]) / 3
2. y (t ) (t 2) x (t 2)
3. y (t ) | t | x(t )
4. y (t ) x(t )2 x (t 1)
Determine if each of the following properties are satisfied and justify your answer:
ELEC 264 – Winter 2013 Page 4 of 13 Assignment 1
Linearity
Time Invariance
Causality
Memory
Stability.
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 )
Hence, the system is linear.
ELEC 264 – Winter 2013 Page 5 of 13 Assignment 1
Time invariance:
y (t t0 ) is given by y (t t0 ) (t t0 2) x(t t0 2)
and if X (t ) x(t t0 ) , then Y (t ) (t 2) X (t 2) (t 2) x (t t0 2) y (t t0 )
Hence, the system is not time invariant.
Causality: the output at time t depends on the input at time t 2 . That is, the output depends on the
future values of the input. Thus, the system is not causal.
Memory: memoryless causal. Hence, not causal not memoryless.
Stability: as t , y (t ) for most bounded inputs due to the (t 2) multiplicative factor.
Hence, the system is not stable.
3. Linear, not time invariant, causal, memoryless, not stable.
Linearity:
x1 (t ) y1 (t ) | t | x1 (t )
x2 (t ) y2 (t ) | t | x2 (t )
For x(t ) x1 (t ) x2 (t ) , we have
y (t ) | t | x(t ) | t | x1 (t ) x2 (t ) | t | x1 (t ) | t | x2 (t ) y1 (t ) y2 (t ) . The system is linear.
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.
4. Not linear, time invariant, causal, not memoryless, stable.
Linearity: the system is not linear due to the nonlinearity of the square term.
Time invariance:
2
y (t t0 ) is given by y (t t0 ) x (t t0 ) x(t t0 1)
2
and if X (t ) x(t t0 ) , then Y (t ) ( X (t )) 2 X (t 1) x(t t0 ) x (t t0 1) y (t t0 )
The system is time invariant.
Causality: the output at time t depends on the inputs at times t and t 1 . 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.
Stability: the system is stable since | x (t ) | B | y (t ) | B( B 1) .
ELEC 264 – Winter 2013 Page 6 of 13 Assignment 1
Question #5: [20%]
Consider the circuit shown below:
L=2 R=1
i(t) +
+
x(t) y(t)
-
-
1. Find the differential equation relating x(t ) and y (t ) .
2. Find the step response s (t ) of this circuit, i.e., solve the differential equation for x(t ) u (t ) and zero
initial conditions. Using MATLAB, plot the step response s (t ) .
3. Using the step response found in (2), find the impulse response h(t ) for this circuit. Using MATLAB,
plot the impulse response h(t ) .
Solution:
di (t ) 1
1. Summing voltages, x(t ) L Ri (t ) . But output y (t ) Ri(t ) . Thus, i (t ) y (t ) . Therefore,
dt R
L dy (t ) dy (t ) R R dy (t ) 1 1
x (t ) y (t ) or y (t ) x (t ) y (t ) x (t )
R dt dt L L dt 2 2
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 )
ELEC 264 – Winter 2013 Page 7 of 13 Assignment 1
Using the sampling property: x(t ) (t ) x(0) (t ) e t / 2 (t ) e 0 / 2 (t ) (t )
Therefore, h(t ) 12 e t / 2u (t )
Impulse reponse
0.5
0.4
0.3
h(t)
0.2
0.1
0
0 2 4 6 8 10
t
Question #6: [10%]
A recent Concordia’s engineering graduate is now at age 25 and has started to invest money for an
eventual early retirement. On May 1, 2009, the graduate invested $5000 in a Tax Free Saving Account.
On average, the money earns 8% per year (compounded annually). This investment strategy can be
modeled as y[n 1] (1 i) y[n] , where y[n] is the balance in the nth year, and i is the interest rate.
On May 1, 2010, the investor will have (1.08)*5000=5400. At that time, another $5000 is invested. This will
also be repeated on May 1, 2011. After that, there will be no further investment.
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
ELEC 264 – Winter 2013 Page 8 of 13 Assignment 1
x[n] 5000 [n] 5000 [n 1] 5000 [n 2]
The response to [n] is h[n] (1.08) n .
The response to x[n] is y[n] x[n]* h[n] 5000 (1.08)n (1.08)n1 (1.08)n 2 .
1. n 5, y[5] 5000 (1.08) (1.08) (1.08) 20447.65
5 4 3
2. n 40, y[40] 5000 (1.08) (1.08) (1.08) 302325.47
40 39 38
Question #7: [5%]
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:
h(t ) (2t 2)[u (t 1) u (t )] (t 2)[u (t ) u (t 2)]
2(t 1)u (t 1) 3tu (t ) (t 2)u (t 2)
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)
ELEC 264 – Winter 2013 Page 9 of 13 Assignment 1
2
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
b) y (t ) xb (t ) * h(t ) [ (t ) (t 2)]* h(t ) h(t ) h(t 2)
1.5
y(t) = h(t)+h(t-2)
0.5
0
-2 -1 0 1 2 3 4 5 6
c) y (t ) xc (t ) * h(t ) [ (t ) 2 (t 1)]* h(t ) h(t ) 2h(t 1)
4
y(t) = h(t)+2h(t-1)
0
-2 -1 0 1 2 3 4 5 6
ELEC 264 – Winter 2013 Page 10 of 13 Assignment 1
Question #8: [5%]
1. Convolve the following digital signals
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
2. Determine the impulse response of the system: y[n] 12 y[n 1] x[n 1]
Answer: The impulse response h[n] corresponds to x[n] [n] , that is
h[n] 12 h[n 1] [n 1], with initial condition h[1] 0
....
n0 h[0] 12 h[0 1] [0 1] h[0] 12 h[ 1] [ 1] 0 0 0
n 1 h[1] 12 h[1 1] [1 1] h[1] 12 y[0] [0] 0 1 1
n2 h[2] 12 h[2 1] [2 1] h[2] 12 h[1] [1] 12 0 1
2
n3 h[3] 12 h[3 1] [3 1] h[3] 12 h[2] [2] 14 0 1
4
n4 h[4] 12 h[4 1] [4 1] h[4] 12 h[3] [3] 18 0 18
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
ELEC 264 – Winter 2013 Page 12 of 13 Assignment 1
2. The product is given by: r[n] x[n] h[n] {4, 2, 2, 1,1/ 2, 0}
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
ELEC 264 – Winter 2013 Page 13 of 13 Assignment 1