Ch02_handout
Ch02_handout
CRC Press
Taylor & Fran is Group
All Rights Reserved.
Chapter 2
Obje tives
Obje tives
Learn simplifying assumptions made in the analysis of systems. Dis uss the
on epts of linearity and time-invarian e, and their signi an e.
Develop methods for solving dierential equations to ompute the output signal
of a system in response to a spe ied input signal.
Dis uss the signi an e of the impulse response as an alternative des ription form
for linear and time-invariant systems.
Learn how to ompute the output signal for a linear and time-invariant system
using onvolution.
Learn the on epts of ausality and stability as they relate to physi ally realizable
and usable systems.
Chapter 2
Introdu tion
Introdu tion
System
In general, a system is any physi al entity that takes in a set of one or more physi al
signals and, in response, produ es a new set of one or more physi al signals.
Mathemati al modeling
The mathemati al model of a system is a fun tion, formula or algorithm (or a set of
fun tions, formulas, algorithms) to approximately re reate the same ause-ee t
relationship between the mathemati al models of the input and the output signals.
Chapter 2
Introdu tion
x(t) y(t)
t t
Some examples:
y (t) = K x (t)
y (t) = x (t )
y (t) = K [x (t)℄2
Chapter 2
Linearity and Time-Invarian e
Sys fx1 (t) + x2 (t)g = Sys fx1 (t)g + Sys fx2 (t)g
Sys f 1 x1 (t)g = 1 Sys fx1 (t)g
x1 (t), x2 (t): Any two input signals; 1 : Arbitrary onstant gain fa tor.
α1 α1
x1 (t) x1 (t) Sys{..}
Chapter 2
Linearity and Time-Invarian e
α1 α1
x1 (t) Sys{..} y(t) x1 (t) Sys{..} y(t)
α2 α2
x2 (t) x2 (t) Sys{..}
b
≡ b
b b
b b
αN αN
xN (t) xN (t) Sys{..}
Chapter 2
Linearity and Time-Invarian e
Example 2.1
Solution:
Testing linearity of ontinuous-time
systems a.
.
b.
y (t) = 3 [ 1 x1 (t) + 2 x2 (t)℄2
y (t) =5 x (t) + 3 = 3 21 [x1 (t)℄2 + 6 1 2 x1 (t) x2 (t)
=5 1 x1 (t) + 5 2 x2 (t) + 3
+ 3 22 [x2 (t)℄2
Superposition prin iple does not hold
Superposition prin iple does not hold
true. The system in part (b) is not
true. The system in part ( ) is not
linear.
linear.
Chapter 2
Linearity and Time-Invarian e
x(t) y(t)
x(t − τ ) y(t − τ )
Chapter 2
Linearity and Time-Invarian e
Delay x (t − τ )
x (t) System y (t − τ )
(τ )
y (t) Delay
x (t) System y (t − τ )
(τ )
Chapter 2
Linearity and Time-Invarian e
Example 2.2
Three dierent systems are des ribed below. For ea h, determine if the system is
time-invariant or not:
a. y (t) = 5 x (t)
b. y (t) = 3 os (x (t))
. y (t) = 3 os (t) x (t)
Solution:
a. Sysfx (t )g = 5 x (t ) = y (t ) Time-invariant.
b. Sysfx (t )g = 3
os ( x (t ) ) = y (t ) Time-invariant.
Chapter 2
Linearity and Time-Invarian e
Example 2.3
x1 (t) x2 (t)
1 1
1 2
t t
0.5 1.5
−1
x3 (t) x4 (t)
x (t)
1
1.5 2.5
t x (t) Sys{..} y (t)
0.5
−1
Solution:
x (t) = 0:6 x2 (t) + 0:8 x4 (t) ) y (t) = 0:6 y2 (t) + 0:8 y4 (t)
Chapter 2
Dierential Equations for Continuous-Time Systems
iL (t) L iC (t) C
b b b b
+ vL (t) − + vC (t) −
Example 2.4
R
Dierential equation for simple RC b b b
ir uit + +
Solution:
dt
Use KVL to obtain
Chapter 2
Dierential Equations for Continuous-Time Systems
Example 2.5
R1
Another RC ir uit b
+
Find a dierential equation to des ribe
+
x (t) − i1 (t) R2 i2 (t) C y (t)
the input-output relationship for the
−
rst-order RC ir uit shown. b
Solution:
Apply KVL:
x (t) + R1 i1 (t) + R2 [i1 (t) i2 (t)℄ = 0
R2 [i2 (t) i1 (t)℄ + y (t) = 0
dy (t) dy (t) 1
i2 (t) = C ; i1 (t) = C + R2 y (t)
dt dt
dy (t) R1 + R2
x (t) + R1 C y (t) = 0
dt R2
Rearrange terms
dy (t) + R1 + R2 y (t) = 1 x (t)
dt R1 R2 C R1 C
Chapter 2
Dierential Equations for Continuous-Time Systems
Example 2.6
R iL (t) L
Dierential equation for RLC ir uit + v (t) − +
L
Find a dierential equation to des ribe
+
x (t) − i (t) C y (t)
the input-output relationship for the
−
RLC ir uit shown.
Solution:
Apply KVL:
x (t) + R i (t) + vL (t) + y (t) = 0
dt dt
dt dt
Rearrange terms:
Chapter 2
Constant-Coe ient Ordinary Dierential Equations
dM x (t) dM 1 x (t)
bM
dtM
+ bM 1
dtM 1
+ : : : + b1 dxdt(t) + b0 x (t)
N M
X dk y (t) X dk x (t)
ak
dtk
= bk
dtk
k=0 k=0
Initial onditions:
dy (t) dN 1 y (t)
y (t0 ) ; ; :::;
dt t=t0 dtN 1 t=t0
Chapter 2
Constant-Coe ient Ordinary Dierential Equations
Example 2.7
Solution:
Let input signals x1 (t) and x2 (t) produ e the responses y1 (t) and y2 (t) respe tively:
Chapter 2
Constant-Coe ient Ordinary Dierential Equations
0 3 0 3
dt
Is this su ient?
What happens at t = t0 , the time instant at whi h the initial onditions are spe ied?
For linearity: y0 = 0.
Che k for time-invarian e:
dy (t ) + a y (t ) = b x (t )
0 0
dt
The system is time-invariant.
Chapter 2
Constant-Coe ient Ordinary Dierential Equations
N M
ak d y k(t) bk d xk(t)
X k X k
dt
= dt
k=0 k=0
represents a CTLTI system provided that all initial onditions are equal to zero:
Chapter 2
Solving Dierential Equations
Solution of the rst-order dierential equation
Solution of the rst-order dierential equation
Even though this result is only appli able to a rst-order dierential equation, it is also
useful for working with higher order systems through the use of state-spa e models.
Chapter 2
Solving Dierential Equations
Solution of the rst-order dierential equation
Example 2.8
For the RC ir uit shown, assume the initial value of the output at time t = 0 is
y (0) = 0. Determine the response of the system to a unit-step fun tion, i.e.,
x (t) = u (t).
R=1 Ω
b b b
x(t) = u(t)
+ +
1
x (t) C = 1/4 F y (t)
− b b
− t
Solution:
dy (t) + 4 y (t) = 4 u (t)
dt
ˆ t ˆ t
y (t) = e 4( t ) 4 u (t) d = 4e 4 t e4 d =1 e 4t for t 0
0 0
Chapter 2
Solving Dierential Equations
Solution of the rst-order dierential equation
Example 2.8 ( ontinued)
In ompa t form:
replacemen
y (t) = 1 e 4t u (t)
1
0.8
0.6
y(t)
0.4
0.2
0
−0.2
−1 −0.5 0 0.5 1 1.5
t (sec)
Chapter 2
Solving Dierential Equations
Solution of the rst-order dierential equation
Example 2.9
x (t) = A (t=w)
x (t) = A Π (t/w)
R=1Ω
b b b
+ +
− − t
b b −w/2 w/2
Solution:
Dierential equation:
dy (t) + 4 y (t) = 4A (t=w)
dt
Initial value: y ( w=2) = 0.
Chapter 2
Solving Dierential Equations
Solution of the rst-order dierential equation
Example 2.9 ( ontinued)
Output signal:
ˆ t
y (t) = e 4( t ) 4A (=w) d
w=2
w <t w
Case 1:
2 2 ˆ t
y (t) = 4A e 4t e4 d = A 1 e 2w e 4t
w=2
t> w
Case 2:
2 ˆ w=2
y (t) = 4A e 4t e4 d = Ae 4 t e2w e 2w
w=2
Chapter 2
Solving Dierential Equations
Solution of the rst-order dierential equation
Example 2.9 ( ontinued)
Complete response:
8 w w
< A 1 e 2w e 4t ;
2 w< t 2
y (t) =
: A e 4t e2w e 2w ; t>
replacemen
2
The signal y (t) is shown for A = 1 and w = 1.
1
0.8
0.6
y(t)
0.4
0.2
0
−0.2
−1 −0.5 0 0.5 1 1.5
t (sec)
Chapter 2
Solving Dierential Equations
Solution of the rst-order dierential equation
Example 2.10
Rework the problem in Example 2.9 by making use of the unit-step response found in
Example 2.8 along with linearity and time-invarian e properties of the RC ir uit.
Solution: Express the pulse signal as the dieren e of two unit-step signals:
x (t) = A (t=w) = A u t + w Au t w
2 2
A u (t + w/2)
A
(a)
A u (t − w/2)
t
w w
(b) A −
2 2
t
w
2
Chapter 2
Solving Dierential Equations
Solution of the rst-order dierential equation
Example 2.10 ( ontinued)
A A
t t
−w/2 −w/2
(a) (b)
A
A
t t
w/2 w/2
(c) (d)
A A
t t
−w/2 w/2 −w/2 w/2
(e) (f)
Chapter 2
Solving Dierential Equations
Solution of the rst-order dierential equation
Example 2.10 ( ontinued)
Unit-step response:
Sys fu (t)g = 1 e 4t u (t)
Response to the pulse input:
n o n
Sys fx (t)g = A Sys u t+ w A Sys u t w o
2 2
Sys fx (t)g = A 1
e t w=2) u t + w
4( +
A
1 e 4( t w=2) u t w
2 2
MATLAB Exer ise 2.3
Chapter 2
Solving Dierential Equations
Solution of the rst-order dierential equation
Intera tive demo: r _demo1.m
Experiment with the superposition prin iple by varying the ir uit parameters R and C
as well as the pulse width w.
Chapter 2
Solving Dierential Equations
Solution of the general dierential equation
Solution of the general dierential equation
N M
ak d y k(t) bk d xk(t)
X k X k
dt
= dt
k=0 k=0
Initial onditions:
N
ak d y k(t)
X k
dt
=0
k=0
dy (t)
dt
+ y (t) = 0
Solution:
y (t) = e t
The onstant must be determined based on the desired initial value of y (t) at t = t0 .
Chapter 2
Solving Dierential Equations
Finding the natural response of a ontinuous-time system
Example 2.11
Consider the RC ir uit shown. Element values are R=1 and C = 1=4 F. Input
terminals of the ir uit are onne ted to a battery that supplies the ir uit with an
input voltage of 5 V up to the time instant t = 0. The swit h is moved from position
A to position B at t = 0 ensuring that x (t) = 0 for t 0. Find the output signal as a
fun tion of time.
A
b R A
b R
b
+ b
+
+ B b
+ B b
t=0
5V y (t) 5V + y (t)
C i (t) C
− − x (t) = 0
− − −
Solution:
dy (t) + 4 y (t) = 0
dt
Chapter 2
Solving Dierential Equations
Finding the natural response of a ontinuous-time system
Example 2.11 ( ontinued)
Homogeneous solution is of the form:
yh (t) = e st = e 4t ; for t 0
Satisfy initial value:
yh (0) = e 4(0)
= =5
Natural response:
yh (t) = 5 e 4t ; for t 0
In ompa t form:
yh (t) = 5 e 4t u (t)
Chapter 2
Solving Dierential Equations
Finding the natural response of a ontinuous-time system
Example 2.11 ( ontinued)
yh (t) = 5 e 4t u (t)
4
yh (t)
0 0.5 1 1.5
Time (sec)
Chapter 2
Solving Dierential Equations
Finding the natural response of a ontinuous-time system
Example 2.12
Rework the problem in Example 2.11 with one minor hange: The initial value of the
output signal is spe ied at the time instant t= 0:5 se onds instead of at t = 0, and
its value is y ( 0:5) = 10.
A
b R A
b R
b
+ b
+
+ B b
+ B b
t = −0.5
10 V y (t) 10 V + y (t)
C i (t) C
− − x (t) = 0
− − −
Solution:
yh (t) = e 4t
To satisfy yh ( 0:5) = 10:
yh ( 0:5) = e :
4( 0 5)
= e2 = 10 ) = 10
e2
= 1:3534
Chapter 2
Solving Dierential Equations
Finding the natural response of a ontinuous-time system
Example 2.12 ( ontinued)
Homogeneous solution is
10
6
yh (t)
2
1.3534
0
−0.5 0 0.5 1
Time (sec)
Chapter 2
Solving Dierential Equations
Finding the natural response of a ontinuous-time system
Finding the natural response of a ontinuous-time system ( ontinued)
General homogeneous dierential equation:
N
ak d y k(t)
X k
dt
=0
k=0
N
X
ak s k = 0
k=0
dk y (t)
dtk
! sk
Chapter 2
Solving Dierential Equations
Finding the natural response of a ontinuous-time system
Finding the natural response of a ontinuous-time system ( ontinued)
Write the hara teristi equation in open form:
aN sN + aN 1 sN 1
+ : : : + a 1 s + a0 = 0
In fa tored form:
aN (s s1 ) (s s2 ) : : : (s sN ) = 0
Homogeneous solution (assuming roots are distin t):
N
X
yh (t) = 1e
s1 t + 2e
s 2 t + : : : + N es N t = k es k t
k=1
R
Time onstant on ept b b b
+ +
Explore the natural response of the RC
ir uit as a fun tion of ir uit x (t) i (t) C y (t)
parameters and the initial voltage of the − −
b b
apa itor.
Solution:
yh (t)
Dene the time onstant as
= RC , so that V0
Slope = −1/τ
τ t
Chapter 2
Solving Dierential Equations
Finding the natural response of a ontinuous-time system
Intera tive demo: r _demo2.m
Experiment by varying the ir uit parameters R and C as well as the initial voltage V0 .
Chapter 2
Solving Dierential Equations
Finding the natural response of a ontinuous-time system
Example 2.14
s2 + 5s + 6 = 0 ) s1 = 2; s2 = 3
Homogeneous solution:
yh (t) = 1 e 2t + 2 e 3t for t 0
Chapter 2
Solving Dierential Equations
Finding the natural response of a ontinuous-time system
Example 2.14 ( ontinued)
Evaluate yh (t) for t = 0:
yh (0) = 1 e 2(0)
+ 2 e 3(0)
= 1 + 2 = 1:5
Use the initial value of the indu tor urrent:
dyh (t) t
dt t=0
= 2 1e 2t 3 2e 3
= 2 1 3 2 = 12
t=0
2
yh (t)
−1
0 0.5 1 1.5 2 2.5 3
Time (sec)
Chapter 2
Solving Dierential Equations
Finding the natural response of a ontinuous-time system
Roots of hara teristi polynomial
Case 1: All roots are distin t and real-valued.
Homogeneous solution:
N
X
yh (t) = k es k t
k=1
t t
Chapter 2
Solving Dierential Equations
Finding the natural response of a ontinuous-time system
Roots of hara teristi polynomial ( ontinued)
Case 2: Chara teristi polynomial has omplex-valued roots.
Sin e the oe ients of the hara teristi polynomial are real-valued, any omplex
roots must appear in the form of onjugate pairs.
Chapter 2
Solving Dierential Equations
Finding the natural response of a ontinuous-time system
Roots of hara teristi polynomial ( ontinued)
A pair of omplex onjugate roots for the hara teristi polynomial leads to a
solution omponent in the form of a osine signal multiplied by an exponential
signal.
The real part of the omplex roots, 1 , impa ts the amplitude of the solution. If
1 < 0, then the amplitude of the osine signal de ays exponentially over time. In
ontrast, if 1 > 0, the amplitude of the osine signal grows exponentially over
time.
σk < 0 σk > 0
t t
Chapter 2
Solving Dierential Equations
Finding the natural response of a ontinuous-time system
Roots of hara teristi polynomial ( ontinued)
Case 3: Chara teristi polynomial has some multiple roots.
aN (s s1 ) (s s2 ) : : : (s sN ) = 0
What if s2 = s1 ?
yh (t) = 11 es1 t + 12 t es1 t + other terms
Chapter 2
Solving Dierential Equations
Finding the natural response of a ontinuous-time system
Example 2.15
For the RLC ir uit shown, the initial indu tor urrent is i (0) = 0:5 A, and the initial
apa itor voltage is y (0) = 2 V. No external input signal is applied to the ir uit,
therefore x (t) = 0. Determine the output voltage y (t) if
a. the element values are R=2 , L = 1 H and C = 1=26 F,
R iL (t) L
+ v (t) − +
L
+
x (t) − i (t) C y (t)
Solution:
d2 y (t) dy (t)
dt 2
+ 2 dt
+ 26 y (t) = 0
Chara teristi equation:
s2 + 2s + 26 = 0 ) s1 = 1 + j5 ; s2 = 1 j5
Natural response:
yh (t) = d1 e t os (5t) + d2 e t sin(5t)
Impose initial onditions:
yh (0) = d1 = 2
dyh (t)
dt t=0
= d1 + 5d2 = 13 ) d2 = 3
Natural response:
Chapter 2
Solving Dierential Equations
Finding the natural response of a ontinuous-time system
Example 2.15 ( ontinued)
b.
Homogeneous dierential equation:
d2 y (t)
dt2
+ 6 dydt(t) + 9 y (t) = 0
Chara teristi equation:
s2 + 6s + 9 = 0 ) (s + 3)2 = 0
Homogeneous solution:
yh (t) = 11 e 3t + 12 te 3t for t 0
Impose initial onditions:
11 =2
dyh (t)
dt t=0
= 3 11 + 12 = 4:5 ) 12 = 10:5
Natural response:
yh (t) = 2 e 3t + 10:5 te 3t for t 0
Chapter 2
Solving Dierential Equations
Finding the natural response of a ontinuous-time system
Example 2.15 ( ontinued)
Homogeneous solution for part (a):
2
yh (t)
−2
0 0.5 1 1.5 2 2.5 3
t (sec)
2
yh (t)
−2
0 0.5 1 1.5 2 2.5 3
t (sec)
Chapter 2
Solving Dierential Equations
Finding the natural response of a ontinuous-time system
Intera tive demo: nr_demo1.m
Experiment by varying the lo ations of the two roots s1 and s2 on the omplex plane.
Chapter 2
Solving Dierential Equations
Finding the for ed response of a ontinuous-time system
Finding the for ed response of a ontinuous-time system
Choosing a parti ular solution for various input signals
Chapter 2
Solving Dierential Equations
Finding the for ed response of a ontinuous-time system
Example 2.16
+ +
the form
x (t) = A os (!t) x (t) i (t) C y (t)
Solution:
Dierential equation:
dy (t)
dt
+ 4 y (t) = 4 x (t)
Homogeneous solution is in the form
yh (t) = e 4t for t 0
Do not determine yet!
Chapter 2
Solving Dierential Equations
Finding the for ed response of a ontinuous-time system
Example 2.16 ( ontinued)
Parti ular solution is in the form
Chapter 2
Solving Dierential Equations
Finding the for ed response of a ontinuous-time system
Example 2.16 ( ontinued)
Using numeri al values A = 20 and ! = 8 rad/s:
y (t) = e 4t + os (8t) + 2 sin(8t)
Impose the initial ondition y (0) = 5:
y (0) = 5 = + os (0) + 2 sin(0) ) =4
Complete solution:
2
yt (t)
−2
−4
0 0.5 1 1.5 2 2.5 3
Time (sec)
2
yss (t)
−2
−4
0 0.5 1 1.5 2 2.5 3
Time (sec)
Chapter 2
Solving Dierential Equations
Finding the for ed response of a ontinuous-time system
Example 2.16 ( ontinued)
Complete solution:
−2
0 0.5 1 1.5 2 2.5 3
Time (sec)
Chapter 2
Solving Dierential Equations
Finding the for ed response of a ontinuous-time system
Intera tive demo: fr_demo1.m
Experiment by varying the R and C , the radian frequen y ! and
ir uit parameters
the initial value y (0). yt (t), the
Observe the ee ts on transient response
steady-state response yss (t) and the total for ed response y (t) = yt (t) + yss (t).
Chapter 2
Blo k Diagram Representation of Continuous-Time Systems
Constant-gain ampliers
Signal adders
Integrators
Z t
K R
w (t) K w (t) w (t) dt w (t) dt
b t0
+ a2 ddt2y + a1 dy
d3 y + a0 y = b2 ddt2x + b1 dx
2
+b x
2
dt3 dt dt 0
Use an intermediate variable w (t) in pla e of y (t) in the left side of the dierential
equation, and set the result equal to x (t):
d3 w
+ a2 ddtw2 + a1 dw
2
dt3 dt
+ a0 w = x
d3 w
a2 d w2 a1 dw
2
dt3
=x dt dt
a0 w
d3 w d2 w dw
dt3 R dt2 R dt R w (t)
x (t) dt b
dt b
dt b
−a2
−a1
−a0
Chapter 2
Blo k Diagram Representation of Continuous-Time Systems
y = b2 d w + b1 dw
2
dt2 dt
+ b0 w
b2
b1
d3 w d2 w dw
dt3 R dt2 R dt R w (t) b0
x (t) dt b
dt b
dt b
y (t)
−a2
−a1
−a0
Chapter 2
Blo k Diagram Representation of Continuous-Time Systems
b2
2
dw dw b1
dt2 t=t0 dt t=t0 w(t0 )
d3 w
b b b
dt3 R R R b0
x (t) dt b b b
dt b b b
dt b b b
y (t)
t = t0 t = t0 t = t0
−a2
−a1
−a0
Chapter 2
Blo k Diagram Representation of Continuous-Time Systems
Example 2.17
d3 y + 5 d2 y + 17 dy + 13 y = x + 2 dx
dt3 dt2 dt dt
with the input signal x (t) = os (20t) and subje t to initial onditions
y (0) = 1 ; dy d2 y
dt t=0
=2; dt2 t=0
= 4;
Solution:
2
16/45 58/45 −71/45
b b b
R R R 1
x (t) dt b b b
dt b b b
dt b b b
y (t)
t=0 t=0 t=0
−5
−17
−13
Chapter 2
Impulse Response and Convolution
Impulse response
For a CTLTI system: The impulse response also onstitutes a omplete des ription of
the system.
Finding the impulse response of a CTLTI system from the dierential equation
1. Use a unit-step fun tion for the input signal, and ompute the for ed response of
the system, i.e., the unit-step response.
2. Dierentiate the unit-step response of the system to obtain the impulse response,
i.e.,
h (t) = dy (t)
dt
n
Sys fÆ (t)g = Sys du (t) o = d h Sys fu (t)gi
dt dt
Chapter 2
Impulse Response and Convolution
Example 2.18
+ +
rst-order RC ir uit shown. Assume the
system is initially relaxed, that is, there is no x (t) i (t) C y (t)
initial energy stored in the system. (Re all − −
b b
dy (t)
dt
+ 4 y (t) = 4 x (t)
Using the rst-order solution method:
ˆ t
h (t) = e 4( t ) 4 Æ ( ) d
0
h (t) = 4 e 4t u (t)
Chapter 2
Impulse Response and Convolution
h (t) = dy (t)
dt
= dtd 1 e 4t u (t) = 4 e 4t u (t)
s
5
3
h(t)
Example 2.19
R iL (t) L
Impulse response of a se ond-order system
+ v (t) − +
Determine the impulse response of the RLC L
R=2
+
ir uit shown. Use element values , x (t) − i (t) C y(
L = 1 H and C = 1=26 F. −
Solution:
Dierential equation:
d2 y (t) + 2 dy (t) + 26 y (t) = 0
dt2 dt
The homogeneous solution is (see Example 2.15)
yp (t) = k1
Chapter 2
Impulse Response and Convolution
y (0) = d1 + 1 = 0 ) d1 = 1
dyh (t)
dt t=0
=0 ) d1 + 5d2 = 0 ) d2 = 0:2
s Unit-step response is
Impulse response is
dy (t)
h (t) = = 5:2 e t sin(5t) for t 0
dt
Chapter 2
Impulse Response and Convolution
2
h(t)
−2
Chapter 2
Impulse Response and Convolution
Convolution operation for CTLTI systems
Convolution operation for CTLTI systems
The output signal y (t) of a CTLTI system is equal to the onvolution of its impulse
response h (t) with the input signal x (t).
Continuous-time onvolution
1
y (t) =x (t) h (t) = x () h (t ) d
ˆ
1
1
=h (t) x (t) = h () x (t ) d
ˆ
1
Chapter 2
Impulse Response and Convolution
Convolution operation for CTLTI systems
Convolution operation for CTLTI systems ( ontinued)
Chapter 2
Impulse Response and Convolution
Convolution operation for CTLTI systems
Convolution operation for CTLTI systems ( ontinued)
x (t) x (τ )
t→τ
t τ
h (t) h (λ)
t→λ
Name change
t λ
−λ
λ→ l
rsa
eve
i mer
h (−λ) T h (t − λ)
λ→λ−t
Time shift
λ λ
t
Chapter 2
Impulse Response and Convolution
Convolution operation for CTLTI systems
Example 2.20
R
Unit-step response of RC ir uit revisited b b b
+ +
Compute the unit-step response of the
x (t) i (t) C y (t)
simple RC ir uit using the onvolution
− −
operation. b b
Solution:
h (t) =
1 e t=RC u (t)
RC
Output of the system in response to input x (t):
1
y (t) = x () h (t ) d
ˆ
1
Fun tions needed: x () and h (t ).
Chapter 2
Impulse Response and Convolution
Convolution operation for CTLTI systems
Example 2.20 ( ontinued)
λ λ
h (t − λ) h (t − λ)
λ λ
t t
x (λ) h (t − λ) x (λ) h (t − λ)
λ λ
t
Chapter 2
Impulse Response and Convolution
Convolution operation for CTLTI systems
Example 2.20 ( ontinued)
Case 1: t0
Fun tions x () and h (t ) do not overlap anywhere. Therefore
y (t) = 0; for t 0
Case 2: t>0
Fun tions x () and h (t ) overlap for values of in the interval (0; t).
In this interval x () = 1 and h (t ) =
1 e (t )=RC . Therefore
RC
y (t) =
ˆ t
1 e (t )=RC d = 1 e t=RC ; for t > 0
0 RC
Combine the two ases through the use of a unit-step fun tion:
y (t) = 1 e t=RC u (t)
Chapter 2
Impulse Response and Convolution
Convolution operation for CTLTI systems
Intera tive demo: onv_demo1.m
R
Pulse response of RC ir uit revisited b b b
+ +
Using onvolution, determine the response
x (t) i (t) C y (t)
of the RC ir uit to a unit-pulse input signal
x (t) = (t). − b b
−
Solution:
It is useful to sket h the fun tions involved in the onvolution integral, namely x ()
and h (t ). Three distin tly dierent possibilities for the time variable t will be
onsidered.
Chapter 2
Impulse Response and Convolution
Convolution operation for CTLTI systems
Example 2.21 ( ontinued)
1 1 1 1
Case 1: t ≤ − Case 2: − < t ≤ Case 3: t >
2 2 2 2
x (λ) x (λ) x (λ)
λ λ λ
1 1 1 1 1 1
− − −
2 2 2 2 2 2
h (t − λ) h (t − λ) h (t − λ)
λ λ λ
t t t
λ λ λ
1 1 1
− t −
2 2 2
Chapter 2
Impulse Response and Convolution
Convolution operation for CTLTI systems
Example 2.21 ( ontinued)
Case 1: t 1
2
y (t) = 0 ; for t
1
2
Case 2:
1
2
<t 1
2
y (t) =
ˆ t
1 e (t )=RC d = 1
e (t+1=2)=RC ; for
1 <t 1
1 2 = RC 2 2
Case 3: t> 1
2
y (t) =
ˆ 1=2
1 e (t )=RC d = e t=RC e1=2RC
e 1=2RC ; for t > 1
1=2 RC 2
Chapter 2
Impulse Response and Convolution
Convolution operation for CTLTI systems
Example 2.21 ( ontinued)
8
>
<
0; t 1
2
y (t) = 1 e (t+1=2)=RC ; 1
2
<t 1
2
>
:
e t=RC e1=2RC e 1=2RC ; t> 1
2
y (t)
1 − e−1/RC
t
1 1
−
2 2
Chapter 2
Impulse Response and Convolution
Convolution operation for CTLTI systems
Intera tive demo: onv_demo2.m
Chapter 2
Impulse Response and Convolution
Convolution operation for CTLTI systems
Example 2.22
x (λ) h (t − λ)
λ λ
1 2 t−2 t
−1
Chapter 2
Impulse Response and Convolution
Convolution operation for CTLTI systems
Example 2.22 ( ontinued)
1 1 1
2 2 2
λ λ λ
1 1 1
−1 −1 −1
h (t − λ) h (t − λ) h (t − λ)
λ λ λ
t t t−2 t
t
λ λ λ
t
Chapter 2
Impulse Response and Convolution
Convolution operation for CTLTI systems
Example 2.22 ( ontinued)
1 1 1
2 2 2
λ λ λ
1 1 1
−1 −1 −1
h (t − λ) h (t − λ) h (t − λ)
λ λ λ
t−2 t t−2 t−2
t−2
λ λ λ
Chapter 2
Impulse Response and Convolution
Convolution operation for CTLTI systems
Example 2.22 ( ontinued)
Case 1: t0
Fun tions x () and h (t ) do not overlap. Therefore
y (t) = 0 ; for t 0
Case 2: 0<t1
Fun tions x () and h (t ) overlap for 0 < t. Therefore
ˆ t
y (t) = (1) e ( t ) d = 1 e t ; for 0<t1
0
Case 3: 1<t2
Fun tions x () and h (t ) overlap for 0 < t. Therefore
1 ˆ t
y (t) = (1) e t ) d + ( 1) e t ) d
ˆ
( (
0 1
Chapter 2
Impulse Response and Convolution
Convolution operation for CTLTI systems
Example 2.22 ( ontinued)
Case 4: 2<t3
Fun tions x () and h (t ) overlap for t 2 < 2. Therefore
1 2
y (t) = (1) e t ) d + ( 1) e t ) d
ˆ ˆ
( (
t 2 1
Case 6: t>4
Fun tions x () and h (t ) do not overlap. Therefore
y (t)
0.6321
t
1 2 3 4
−0.3996
Chapter 2
Impulse Response and Convolution
Convolution operation for CTLTI systems
Intera tive demo: onv_demo3.m
onvolution
response
RC
using the alternative form of
γ γ
the onvolution integral. t t
h (γ) x (t − γ) h (γ) x (t − γ)
Solution:
ˆ t
y (t) = h ( ) x (t )d
0 γ γ
t
Chapter 2
Impulse Response and Convolution
Convolution operation for CTLTI systems
Example 2.23 ( ontinued)
For t 0 the two fun tions do not overlap. Therefore
y (t) = 0 ; for t 0
For t > 0, the two fun tions h( ) and x (t ) overlap in the interval (0; t).
1
Therefore ˆ t
y (t) = e =RC d =1 e t=RC ; for t > 0
0 RC
In ompa t form:
y (t) = 1 e t=RC u (t)
Chapter 2
Impulse Response and Convolution
Convolution operation for CTLTI systems
Intera tive demo: onv_demo4.m
Chapter 2
Causality in Continuous-Time Systems
Causal system
A system is said to be ausal if the urrent value of the output signal depends only on
urrent and past values of the input signal, but not on its future values.
CTLTI system:
1
y (t) = h (t) x (t) = h () x (t ) d
ˆ
1
For < 0, the term x (t ) refers to future values of the input signal.
For a CTLTI system to be ausal, the impulse response of the system must be equal
to zero for all negative values of its argument.
Stable system
CTLTI system:
1
y (t) = h (t) x (t) = h () x (t ) d
ˆ
For a CTLTI system to be stable, its impulse response must be absolute integrable.
1
h () d < 1
ˆ
Chapter 2
Stability in Continuous-Time Systems
Example 2.24
Evaluate the stability of the rst-order CTLTI system des ribed by the dierential
equation
dy (t) + a y (t) = x (t)
dt
where a is a real-valued onstant.
Solution:
Impulse response:
h (t) = e at u (t)
Che k for stability:
1 ˆ 1
h () d = e a d = 1 provided that a > 0
ˆ
1 0 a
dy (t)
y (t0 + TT) y (t0 ) ;
dy (t)
y (t0 +T ) Approx.
dt
dt t=t0 y (t0 ) t=t0
Chapter 2
Approximate Numeri al Solution of a Dierential Equation
y (t0 + T ) y (t0 )
T
g [t0 ; y (t0 )℄ ) y (t0 + T ) y (t0 ) + T g [t0 ; y (t0 )℄
y (2T ) y (T ) + T g [T; y (T )℄
h
= y (T ) + T 1 y (T ) + 1 x (T )i
RC RC
This is known as the Euler method. More sophisti ated methods exist with better
a ura y.
MATLAB Exer ise 2.4 MATLAB Exer ise 2.5
Chapter 2
MATLAB Exer ises
Simulate the four systems onsidered in Example 2.1, and test them using signals
generated in MATLAB.
Solution:
If a system is linear
Chapter 2
MATLAB Exer ises
>> t = [0:0.01:5];
>> x1 = cos(2*pi*5*t);
>> x2 = exp( 0.5*t);
1 % Script: matex_2_1.m
2 %
3 t = [0:0.01:4]; % Create a time vector.
4 x1 = cos(2*pi*5*t); % Test signal 1.
5 x2 = exp( 0.5*t); % Test signal 2.
6 alpha1 = 2; % Set parameters alpha1
7 alpha2 = 1.25; % and alpha2.
8 x = alpha1*x1+alpha2*x2; % Combined signal.
9 % Define anonymous functions for the systems in Example 2.1.
10 sys_a = @(x) 5*x;
11 sys_b = @(x) 5*x+3;
12 sys_c = @(x) 3*x.*x;
13 sys_d = @(x) cos(x);
14 % Test the system in part (a) of Example 2.1.
15 y1 = sys_a(x1);
16 y2 = sys_a(x2);
17 y_exp = alpha1*y1+alpha2*y2; % Expected response for a linear system.
18 y_act = sys_a(x); % Actual response.
19 clf; % Clear figure.
Chapter 2
MATLAB Exer ises
20 subplot(1,2,1);
21 plot(t,y_exp); % Graph expected response.
22 title('y_{exp} = \alpha_1 y_1 + \alpha_2 y_2')
23 xlabel('t (sec)'); ylabel('Amplitude');
24 subplot(1,2,2);
25 plot(t,y_act); % Graph actual response.
26 title('y_{act} = Sys_a\{\alpha_1 x_1 + \alpha_2 x_2\}')
27 xlabel('t (sec)'); ylabel('Amplitude');
Example 2.1
yexp = α1 y1 + α2 y2 yact = Sysa {α1 x1 + α2 x2 }
20 20
15 15
10 10
Amplitude
Amplitude
5 5
0 0
−5 −5
−10 −10
0 1 2 3 4 0 1 2 3 4
t (sec) t (sec)
Chapter 2
MATLAB Exer ises
Simulate the three systems onsidered in Example 2.2, and test them using signals
generated in MATLAB.
Solution:
Chapter 2
MATLAB Exer ises
Complete s ript:
1 % Script matex_2_2.m
2 %
3 t = [0:0.01:10]; % Create a time vector.
4 x = @(t) exp( 0.5*t).*(t>=0); % Anonymous function for test signal.
5 % Define anonymous functions for the systems in Example 2 2.
6 sys_a = @(x) 5*x;
7 sys_b = @(x) 3*cos(x);
8 sys_c = @(x) 3*cos(t).*x;
9 % Test the system in part (c) of Example 2.2.
10 y1 = sys_c(x(t));
11 y2 = sys_c(x(t 2));
Chapter 2
MATLAB Exer ises
1 Example 2.2
0
−1
−2
0 1 2 3 4 5 6 7 8 9 10
t (sec)
Chapter 2
MATLAB Exer ises
The response of the simple RC ir uit to a unit-step signal was found in Example 2.8
to be
yu (t) = Sys fu (t)g = 1 e 4t u (t)
Using superposition, ompute and graph the response of the ir uit to the signal x2 (t)
shown.
R=1 Ω x2 (t)
b b b
+ + 1
x (t) C = 1/4 F y (t)
t
1 2
− b b
−
−1
Solution:
x2 (t) = u (t) 2 u (t 1) + u (t 2)
Complete s ript:
1 % Script: matex_2_3b.m
2 %
3 % Anonymous function for unit step response.
4 yu = @(t) (1 exp( 4*t)).*(t>=0);
5 t = [ 5:0.01:5]; % Vector of time instants.
6 y2 = yu(t) 2*yu(t 1)+yu(t 2); % Compute response to x2(t)].
7 plot(t,y2);
Example 2.10
Chapter 2
MATLAB Exer ises
Use the Euler method to nd an approximate numeri al solution for the RC ir uit
problem of Example 2.8, and ompare it to the exa t solution that was found.
R=1 Ω
b b b
x(t) = u(t)
+ +
1
x (t) C = 1/4 F y (t)
− b b
− t
Solution:
For the spe ied input signal, the dierential equation of the ir uit is
dy (t)
dt
+ 4 y (t) = 4 u (t)
With y (0) = 0, the exa t solution for the output signal is
y (t) = 1 e 4t u (t)
Chapter 2
MATLAB Exer ises
dy (t)
= g (t; y (t)) ; g (t; y (t)) = 4 y (t) + 4 u (t)
dt
The Euler method approximation y ^ (t) is
y^ ( (k + 1) Ts ) =^y (kTs ) + Ts g (kTs ; y^ (kTs ))
=^y (kTs ) + Ts ( 4 y^ (kTs ) + 4 u (kTs ))
y^ (kTs ) y (kTs )
Per ent error:
Chapter 2
MATLAB Exer ises
1 % Script: matex_2_4.m
2 %
3 Ts = 0.1; % Time increment
4 t = [0:Ts:1]; % Vector of time instants
5 % Compute the exact solution.
6 y = 1 exp( 4*t); % Eqn.(2.186)
7 % Compute the approximate solution using Euler method.
8 yhat = zeros(size(t));
9 yhat(1) = 0; % Initial value.
10 for k = 1:length(yhat) 1,
11 g = 4*yhat(k)+4; % Eqn.(2.188)
12 yhat(k+1) = yhat(k)+Ts*g; % Eqn.(2.189)
13 end;
14 % Graph exact and approximate solutions.
15 clf;
16 subplot(211);
17 plot(t,y,' ',t,yhat,'ro'); grid;
18 title('Exact and approximate solutions for RC circuit');
Chapter 2
MATLAB Exer ises
19 xlabel('Time (sec)');
20 ylabel('Amplitude');
21 legend('Exact solution','Approximate solution','Location','SouthEast');
22 % Compute and graph the percent approximation error.
23 err_pct = (yhat y)./y*100;
24 subplot(212);
25 plot(t(2:length(t)),err_pct(2:length(t)),'ro'); grid
26 title('Percent approximation error');
27 xlabel('Time (sec)');
28 ylabel('Error (%)');
Chapter 2
MATLAB Exer ises
0.8
Amplitude
0.6
0.4
Exact solution
0.2
Approximate solution
0
0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1
Time (sec)
Percent approximation error
25
20
Percent error
15
10
0
0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1
Time (sec)
Chapter 2
MATLAB Exer ises
0.8
Amplitude
0.6
0.4
Exact solution
0.2
Approximate solution
0
0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1
Time (sec)
Percent approximation error
5
4
Percent error
0
0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1
Time (sec)
Chapter 2
MATLAB Exer ises
Solve the approximation problem of MATLAB Exer ise 2.4 using fun tion ode45(..)
Solution:
Start by developing a fun tion rc1(..) to ompute the right side g [t; y (t)℄ of the
dierential equation.
1 % Script: matex_2_5a.m
2 %
3 t = [0:0.1:1]; % Vector of time instants
4 % Compute the exact solution.
5 y = 1 exp( 4*t); % Eqn.(2.187)
6 % Compute the approximate solution using ode45().
7 [t,yhat] = ode45(@rc1,t,0);
8 % Graph exact and approximate solutions.
9 clf;
10 subplot(211);
11 plot(t,y,' ',t,yhat,'ro'); grid;
12 title('Exact and approximate solutions for RC circuit');
13 xlabel('Time (sec)');
14 ylabel('Amplitude');
15 legend('Exact solution','Approximate solution','Location','SouthEast');
16 % Compute and graph the percent approximation error.
17 err_pct = (yhat y')./y'*100;
18 subplot(212);
19 plot(t(2:max(size(t))),err_pct(2:max(size(t))),'ro'); grid
Chapter 2
MATLAB Exer ises
0.8
Amplitude
0.6
0.4
Exact solution
0.2
Approximate solution
0
0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1
Time (sec)
×10−4 Percent approximation error
20
15
Percent error
10
−5
0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1
Time (sec)
Chapter 2
MATLAB Exer ises
1 % Script: matex_2_5b.m
2 %
3 t = [0:0.1:1]; % Vector of time instants
4 % Compute the exact solution.
5 y = 1 exp( 4*t); % Eqn.(2.187)
6 % Compute the approximate solution using ode45().
7 rc2 = @(t,y) 4*y+4;
8 [t,yhat] = ode45(rc2,t,0);
9 % Graph exact and approximate solutions.
10 clf;
11 subplot(211);
12 plot(t,y,' ',t,yhat,'ro'); grid;
13 title('Exact and approximate solutions for RC circuit');
14 xlabel('Time (sec)');
15 ylabel('Amplitude');
16 legend('Exact solution','Approximate solution','Location','SouthEast');
17 % Compute and graph the percent approximation error.
18 err_pct = (yhat y')./y'*100;
Chapter 2
MATLAB Exer ises
19 subplot(212);
20 plot(t(2:max(size(t))),err_pct(2:max(size(t))),'ro'); grid
21 title('Percent approximation error');
22 xlabel('Time (sec)');
23 ylabel('Percent error');