16 Breader
16 Breader
EE16B NOTES
SPRING’17
2 murat arcak
State variables are a set of variables that fully represent the state of a
dynamical system at a given time, e.g., capacitor voltages and induc-
tor currents in a circuit, or positions and velocities in a mechanical
system. We denote by ~x (t) the vector of these state variables and
refer to it as the state vector.
Continuous-Time Systems
d
~x (t) = f (~x (t)) (1)
dt
where f (~x (t)) is an n-vector that dictates the derivatives of each state
variable according to the current value of the states. The form of f
depends on the system we are modeling as we will see in examples.
If the system has input variables we can manipulate (e.g. voltage
and current sources in a circuit, or force and torque delivered to a
mechanical system), we represent the system as
d
~x (t) = f (~x (t), ~u(t))
dt
where we refer to ~u(t) as the control input, since we can manipulate
this input to influence the behavior of the system. Most of our exam-
ples will contain a single control input, but we write ~u(t) as a vector
to allow for multiple control inputs.
Finally, we denote by w ~ (t) other inputs that are not under our con-
trol, e.g. wind force in a flight control system, and add it to our
model:
d
~x (t) = f (~x (t), ~u(t), w
~ (t)).
dt
4 murat arcak
`
d2 θ ( t ) dθ (t)
m` 2
= −k` − mg sin θ (t) (2)
dt dt
where the left hand side is mass×accelaration in the tangential direc-
mg sin θ
tion and the right hand side is total force acting in that direction.
To bring this second order differential equation to state space form mg
Discrete-Time Systems
Linear Systems
~ ) ∈ Rn is linear in ~x ∈ Rn , ~u ∈ Rm , w
When f (~x, ~u, w ~ ∈ Rd , we can
rewrite it in the form
f (~x, ~u, w
~ ) = A~x + Bu~u + Bw w
~
6 murat arcak
~z , T~x, (8)
note that
~z(t + 1) = T~x (t + 1) = TA~x (t) + TB~u(t)
and substitute ~x = T −1~z in the right hand side to obtain:
Linearization
x̃ (t + 1) ≈ A x̃ (t).
We first study a system with a single state variable x (t) that obeys
The first term at x (0) represents the effect of the initial condition and
the second term ∑tk− 1 t −1− k
=0 a bu(k) represents the effect of the input
sequence u(0), u(1), . . . , u(t − 1).
Definition. We say that a system is stable if its state x (t) remains
bounded for any initial condition and any bounded input sequence.
Conversely, we say it is unstable if we can find an initial condition and
a bounded input sequence such that | x (t)| → ∞ as t → ∞.
z i ( t + 1 ) = λ i z i ( t ) + bi u ( t ) , i = 1, . . . , n (21)
where we denote by bi the i-th entry of Bnew . Then, the results for the
scalar case above imply stability when |λi | < 1 and instability when
|λi | > 1.
For the whole system to be stable each subsystem must be stable,
therefore we need |λi | < 1 for each i = 1, . . . , n. If there exists at least
one eigenvalue λi with |λi | > 1 then we conclude instability because
we can drive the corresponding state zi (t) unbounded.
z n ( t + 1 ) = λ n z n ( t ) + bn u ( t ) (23)
where we can treat the last two terms in brackets as a bounded input
since we have already shown that zn (t) is bounded. If |λn−1 | < 1 we
conclude zn−1 (t) is itself bounded and proceed to the equation:
zn−2 (t + 1) = λn−2 zn−2 (t) + [? zn−1 (t) + ? zn (t) + bn−2 u(t)]. (25)
12 murat arcak
d
x (t) = ax (t) + bu(t) (26)
dt
is given by
Z t
x (t) = e at x (0) + b e a(t−s) u(s)ds. (27)
0
It follows that this system is stable when a < 0 (in which case e at → 0
as t → ∞) and unstable when a > 0 (in which case e at → ∞).
Using a diagonalization argument as in the discrete-time case, we
conclude that the vector continuous-time system
d
~x (t) = A~x (t) + B~u(t) (28)
dt
is stable if Re{λi } < 0 for each eigenvalue λ1 , . . . , λn of A, and
unstable if Re{λi } > 0 for some eigenvalue λi .
The figures below highlight the regions of the complex plane where
the eigenvalues must lie for stability of a discrete-time (left) and
continuous-time (right) system.
Im(λ) Im(λ)
1 Re(λ)
and obtained:
" # " #
0 1 0 1
Adown = Aup = . (29)
− g` −k
m
g
`
−k
m
g
The eigenvalues of Adown are the roots of λ2 + mk λ + ` , which can
be shown to have strictly negative real parts when k > 0. Thus the
downward position is stable.
g
The eigenvalues of Aup are the roots of λ2 + mk λ − ` , which are given
by:
s s
2 2
k 1 k g k 1 k g
λ1 = − − + 4 , λ2 = − + +4 .
2m 2 m ` 2m 2 m `
Figure 2 depicts the real part of eλt for various values of λ. Note that
the envelope evt decays when v = Re(λ) < 0 as in our stability
condition.
14 murat arcak
2
values of λ in the complex plane. It
grows unbounded when |λ| > 1, decays
0.8
0.6
1
0.4
0.2
0
0
to zero when |λ| < 1, and has constant
-0.2
-0.4 -1
amplitude when λ is on the unit circle
-0.6
-0.8
0 5 10 15 20 25
-2
(|λ| = 1).
4 -3
0 5 10 15 20 25
3
Im(λ) 3.5
2 3
2.5
1
2
0
1.5
-1
1
-2
0.5
-3
0
0 5 10 15 20 25
-4
0 5 10 15 20 25
Re(λ)
2
1.5
1.5
1
0.5
0
0.5
-0.5
-1 0
-1.5
-0.5
0 5 10 15 20 25
-2
0 5 10 15 20 25
2
1
0.9
0.8
1.5 0.7
0.6
0.5
1 0.4
0.3
0.5
0.2
0.1
0
0 5 10 15 20 25
-0.5
-1
-1.5
-2
0 5 10 15 20 25
2
values of λ in the complex plane.
1.5
1
Note that eλt is oscillatory when λ has
1
0.8
0.6
0.8
0.6
1
1
0
an imaginary component. It grows
0.5
0.2 0.2
0 0
0 -1
-0.4 -0.4
-0.5
-0.6 -0.6
-2
-0.8
-0.8
-1
0 1 2 3 4 5 6 7 8 9 10 -1
0 1 2 3 4 5 6 7 8 9 10
-1
-1.5
-3
0 1 2 3 4 5 6 7 8 9 10
amplitude when Re{λ} = 0.
0 1 2 3 4 5 6 7 8 9 10
1.5
1 2
1
1
0.8
0.8
0.6
0.6
1
0.4 0.5
0.4
0.2
0.2
0
0
0 0
-0.2
-0.2
-0.4
-0.4
-0.5
-1
-0.6
-0.6
-0.8 -0.8
-1 -1
-1
0 1 2 3 4 5 6 7 8 9 10 0 1 2 3 4 5 6 7 8 9 10 -2
-1.5
0 1 2 3 4 5 6 7 8 9 10
-3
0 1 2 3 4 5 6 7 8 9 10
2
2.8
1.8
2.6
1.6
2.4
1.4
2.2
1.2
2
1
1 1
0.9
0.9
1.8
0.8 0.8
0.8
0.7
1.6
0.6 0.7 0.6
0.5
0.6
0.4 1.4
0.4
0.5
0.3
0.2 1.2
0.4
0.2
0.1
0 1 2 3 4 5 6 7 8 9 10
0.3
0 1 2 3 4 5 6 7 8 9 10 0 1
0 1 2 3 4 5 6 7 8 9 10 0 1 2 3 4 5 6 7 8 9 10
Re(λ)
ee16b notes spring’17 15
dx1 (t) 1
= x2 ( t )
dt C
dx2 (t) 1
= (− x1 (t) − Rx2 (t) + u(t))
dt L
where x1 = vC and x2 = i. Since this model is linear we can rewrite it
in the form (28), with " #
1
0 C + vR - + vL - + vC -
A= .
− L1 − RL
R L C i
Then the roots of
R 1
det(λI − A) = λ2 + λ+
L LC + u -
give the eigenvalues:
R 1
q
λ1,2 = −α ∓ α2 − ω02 where α, , ω0 , √ .
2L LC
For α > ω0 we have two real, negative eigenvalues which indicate a
damped response. For α < ω0 , we get the complex eigenvalues
q
λ1,2 = −α ∓ jω where ω , ω02 − α2 ,
Controllability
or, equivalently,
u (0)
u (1)
i
..
h
~x (t) − At~x (0) = At−1 B A t −2 B · · ·
AB B . (31)
.
}
u ( t − 2)
| {z
, Rt
u ( t − 1)
Can we find an input sequence u(0), u(1), . . . , u(t − 1) that brings the
state from ~x (0) to a desired value ~x (t) = ~xtarget ? The answer is yes
16 murat arcak
if ~xtarget − At~x (0) lies in the range space of Rt because, then we can
find appropriate values for u(0), u(1), . . . , u(t − 1), i.e. an appropriate
linear combination of the columns of Rt , so that the right hand side
of (31) is ~xtarget − At~x (0) and, thus, ~x (t) = ~xtarget .
Now, if we want to be able to reach any ~xtarget from any initial ~x (0)
– a property we henceforth refer to as controllability – then the range
of Rt must be the whole n-dimensional space, that is Rt must have n
linearly independent columns for some t.
Since increasing t amounts to adding more columns to Rt , it may ap-
pear that we may eventually have n independent columns. However,
this is not so: if we don’t have n independent columns in Rt at t = n, we
never will for t > n. This is a consequence of a result3 in linear algebra 3
This result is known as the Cayley-
which states that, if A is n × n, then An can be written as a linear Hamilton Theorem and its details are
beyond the scope of this course. You
combination of An−1 , . . . , A, I: can consult the Wikipedia article if you
are interested.
A n = α n −1 A n −1 + · · · + α 1 A + α 0 I for some α n −1 , . . . , α 1 , α 0 .
x2 (t + 1) = 2x2 (t).
The right hand side doesn’t depend on u(t) or x1 (t), which means
that x2 (t) evolves independently and can be influenced neither di-
rectly by input u(t), nor indirectly through the other state x1 (t).
ee16b notes spring’17 17
Controllability in Continuous-Time
Example 10: For the circuit depicted on the right we treat the current
source as the control u(t), and the inductor currents i1 (t) and i2 (t) as
the state variables. i1 i2 iR
u
Since the voltage across each capacitor is the same as the voltage
L1 L2 R
across the resistor, we have
di1 (t)
L1 = Ri R (t)
dt (34)
di2 (t)
L2 = Ri R (t).
dt
Substituting i R = u − i1 − i2 from KCL and dividing the equations by
L1 and L2 respectively, we get
di1 (t)
" # " #" # " #
dt
− LR1 − LR1 i1 (t) R
L1
di2 (t) = + R u ( t ).
dt
− LR2 − LR2 i2 (t) L2
| {z } | {z }
A B
Note that
− LR1R
+ R
R R
AB = L1 L2
=− + B
− LR2 LR1 + R
L2
L1 L2
di L (t)
1 1 R
= + Ri R (t) = (−i L (t) + u(t))
dt L1 L2 L
−1 iL iR
where L , L1 + L12 . Note that this is the governing equation for u
1
the circuit on the right where the two inductors are lumped into one. L R
ee16b notes spring’17 19
u ( t ) = k 1 x1 ( t ) + k 2 x2 ( t ) + · · · + k n x n ( t ) (36)
u(t)
~x (t + 1) = A~x (t) + Bu(t)
x1 ( t )
k1
+ .. ..
. .
+ xn (t)
kn
det(λI − A) = λ2 − a2 λ − a1 .
λ2 − ( a2 + k 2 ) λ − ( a1 + k 1 ).
(λ − λ1 )(λ − λ2 ) = λ2 − (λ1 + λ2 )λ + λ1 λ2 ,
that is,
a2 + k 2 = λ1 + λ2 and a1 + k 1 = − λ1 λ2 .
and, because this matrix is upper diagonal, its eigenvalues are the
diagonal entries:
λ1 = 1 + k1 and λ2 = 2.
Note that we can move λ1 with the choice of k1 , but we have no con-
trol over λ2 . In fact, since |λ2 | > 1, the closed-loop system remains
unstable no matter what control we apply.
This is a consequence of the uncontrollability of this system, which
was shown in Example 8. The second state equation
x2 (t + 1) = 2x2 (t)
d
~x (t) = A~x (t) + Bu(t), u(t) ∈ R.
dt
22 murat arcak
d
~x (t) = ( A + BK )~x (t).
dt
The only difference from discrete-time is the stability criterion: we
must choose K such that Re{λi ( A + BK )} < 0 for each eigenvalue λi .
Example 13: Consider the inverted pendulum system depicted be-
low.
m
θ `
u
M
m 1
ÿ = − gθ + u
M M (39)
M+m 1
θ̈ = gθ − u.
M` M`
We write (39) in state space form as
θ (t) 0 1 0 θ (t) 0
d
θ̇ (t) = MM+`m g 0 0 θ̇ (t) + − M1 ` u(t),
dt
ẏ(t) − m g 0 0 ẏ(t) 1
| M {z } M
| {z }
A B
where we have omitted y(t) from the state vector because we are
interested in stabilizing the point θ = 0, θ̇ = 0, ẏ = 0, and we are not
concerned about the final value of the position y(t). If it is of interest
to bring y(t) to a specific position the state equations above can be
augmented with y(t), leading to a fourth order model.
ee16b notes spring’17 23
(λ − λ1 )(λ − λ2 )(λ − λ3 )
where λ1 , λ2 , λ3 are desired closed-loop eigenvalues.
λ2 − ( a2 + k 2 ) λ − ( a1 + k 1 )
(λ − λ1 )(λ − λ2 ) = λ2 − (λ1 + λ2 )λ + λ1 λ2 .
The first benefit of this structure is the simple form of the polynomial
det(λI − ( A + BK )) = λn − ( an + k n )λn−1 · · · − ( a2 + k2 )λ − ( a1 + k1 )
(λ − λ1 )(λ − λ2 ) · · · (λ − λn ). (42)
det(λI − ( A + BK )) = λ3 − (3 + k3 )λ2 − (2 + k2 )λ − (1 + k1 )
K̃ = KT (45)
ee16b notes spring’17 25
How can we find a matrix T that satisfies (44)? Recall the matrix we
use for checking controllability:
h i
Rn = An−1 B · · · AB B . (46)
? ··· ? 1
that has rank n regardless of the values of the entries marked as ’?’.
Then T = Rn R̃− 1
n is itself invertible, thus a viable choice for (44).
Summary
pf
pl
x1 , p l − p f − δ x2 , v l − v f u , ul − u f , (50)
and obtain from (48) and (49) the following model that describes the
relative motion of the two vehicles:
d
x ( t ) = x2 ( t )
dt 1 (51)
d
x2 ( t ) = u ( t ).
dt
Then the task is to stabilize the equilibrium x1 = 0, x2 = 0 which
means pl − p f = δ and vl = v f . This is accomplished with
u ( t ) = k 1 x1 ( t ) + k 2 x2 ( t )
using range sensors to obtain pl (t) − p f (t) and vl (t) − v f (t). In this
implementation the lead vehicle chooses its own input ul (t) without
regard to the follower, and the follower applies the controller (52) to
automatically follow the leader with constant relative distance δ.
C
CA
Observability ⇔ .. = n.
rank
.
CAn−1
h i
y(t) = x1 (t) = 1 0 ~x (t) (57) ~x (2)
| {z }
C
we get
" # " #
C 1 0
=
CA cos θ − sin θ
Observers
AT + C T LT . (61)
(λ − λ1 )(λ − λ2 ) = λ2 − (λ1 + λ2 )λ + λ1 λ2 .
C = [1 0].
σ1 ≥ σ2 ≥ · · · ≥ σr > 0.
with respect to this attribute, and the entries of ~ui evaluate how much
each viewer cares about this particular attribute. Then truncating
the SVD as in (64) amounts to identifying a few key attributes that
underlie the ratings. This is useful, for example, in making movie
recommendations as you will see in a homework problem.
Finding a SVD
√
3. Let σi = λi and obtain ~ui from
To see why σi , ~ui , ~vi resulting from the procedure above satisfy (63),
rewrite (66) in matrix form as:
σ
h i h i 1
A ~v1 · · ·~vr = ~u1 · · · ~ur ..
.
.
| {z }
σr
, V1
and note that the right hand side is indeed the decomposition in
(63). We conclude by showing
h i hand side is equal to A.
that the left
To this end define V2 = ~vr+1 · · · ~vn whose columns are the
remaining
h orthonormal
i eigenvectors for λr+1 = · · · = λn = 0. Then
V = V1 V2 is an orthonormal matrix and, thus,
" #
h i VT
VV T = V1 V2 1 = V1 V1T + V2 V2T = I.
V2T
√
3. Let σi = λi and obtain ~vi from
We calculate
" #" # " #
4 4 4 −3 32 0
AA T = =
−3 3 4 3 0 18
A = U1 SV1T (78)
h i h i
where U1 = ~u1 · · · ~ur is m × r, V1 = ~v1 · · ·~vr is n × r, and S is the
r × r diagonal matrix with entries σ1 , . . . , σr .
Next we form the m × m orthonormal matrix
U = [U1 U2 ]
V = [V1 V2 ].
Then we write
" #
S 0r×(n−r)
A=U VT (79)
0(m−r)×r 0(m−r)×(n−r)
| {z }
,Σ
A= U Σ VT
σ1~u1
σ2 ~v2
σ2~u2 σ1
~v1
For ~x = ~v1 we get k A~x k = σ1 with equality because V T~v1 is the first
unit vector which, when multiplied by Σ, gets stretched by σ1 .
Symmetric Matrices
Q = QT .
Qx = λx, (80)
Q x̄ = λ̄ x̄ (81)
x̄ T Q = λ̄ x̄ T . (82)
Now multiply (80) from the left by x̄ T and (82) from the right by x:
x̄ T Qx = λ x̄ T x
(83)
x̄ T Qx = λ̄ x̄ T x
Since the left hand sides are the same we have λ x̄ T x = λ̄ x̄ T x, and
since x̄ T x 6= 0, we conclude λ = λ̄. This means a + jb = a − jb which
proves that b = 0.
Now that we know the eigenvalues are real we can conclude the
eigenvectors are also real, because they are obtained from the equa-
tion ( Q − λI ) x = 0 where Q − λI is real.
We will prove this for the case where the eigenvalues are distinct al-
though the statement is true also without this restriction6 . Orthonor- 6
A further fact is that a symmetric
mality of the eigenvectors means they are orthogonal and each has matrix admits a complete set of eigen-
vectors even in the case of repeated
unit length. Since we can easily normalize the length to one, we need eigenvalues and is thus diagonalizable.
only to show that the eigenvectors are orthogonal.
Pick two eigenvalue-eigenvector pairs: Qx1 = λ1 x1 , Qx2 = λ2 x2 ,
λ1 6= λ2 . Multiply Qx1 = λ1 x1 from the left by x2T , and Qx2 = λ2 x2
by x1T :
Note that x2T Qx1 is a scalar, therefore its transpose is equal to itself:
x1T Qx2 = x2T Qx1 . This means that the left hand sides of the two
equations above are identical, hence
λ1 x2T x1 = λ2 x1T x2 .
40 murat arcak
The final property below proves our earlier assertion that AA T and
A T A have nonnegative eigenvalues. (Substitute R = A T below for the
former, and R = A for the latter.)
R T Rxi = λi xi .
the test scores. Each data point corresponds to a student and those
in the first quadrant (both midterms ≥ 0) are those students who
scored above average in each midterm. You can see that there were
students who scored below average in the first and above average in
the second, and vice versa.
50
40
30 ~v1 direction
20
10
Midterm 2 0
-10
-20
-30
-40
-50
-50 -40 -30 -20 -10 0 10 20 30 40 50
Midterm 1
y y
regression interpolation
x x
Polynomial Interpolation
a0 + a1 x1 = y1 , a0 + a1 x2 = y2 .
1 x1 x12 x13
a0 y1
1 x x 2 x 3 a y
2 2 2 1 = 2 . (87)
1 x3 x32 x33 a2 y3
1 x4 x42 x43 a3 y4
We will see below that the matrices in the two equations above are
invertible if xi 6= x j when i 6= j, that is if the xi values are distinct.
The results of this procedure are illustrated in the figure below for
three data points (left) and four data points (right).
6 8
1 0
0 -2
0 1 2 3 4 0 1 2 3 4 5
ee16b notes spring’17 45
x12 x1n−1
1 x1 ··· a0 y1
1
x2 x22 ··· x2n−1 a1 y2
1 x3 x32 ··· x3n−1 a2 = y3 .
(88)
.. .. .. .. .. .. ..
. . . . . . .
1 xn xn2 ··· xnn − 1 a n −1 y n −1
| {z }
V
det(V ) = ∏ ( x j − x i ), (89)
1≤ i < j ≤ n
1 2 4 8 a3 2
| {z }
V
By inverting the matrix V we obtain
a0 0 12 0 0 1 0
a
1 1 −4
−6 12 −2
0 1/3
= = .
a2 12 6 −12
6 0 1 1
a3 −2 6 −6 2 2 −1/3
| {z }
V −1
2 2
1 1
0 0
-1 0 1 2 -1 0 1 2
1 −1 1 1
1 a0
0 0 0
a1 =
1 1 1 1
a2
1 2 4 2
| {z }
S
1
a0 0 0.3
T −1 T
a1 = (S S) S = −0.1 .
1
a2 0.5
2
80
20
-20
-40
-60
-80
0 2 4 6 8 10 12 14
y= ∑ yk φk (x). (91)
k
y
y2 φ2 ( x )
y3 φ3 ( x )
y4 φ4 ( x )
y1 φ1 ( x )
x
x1 x2 x3 x4
y = ∑k yk φk ( x )
x
x1 x2 x3 x4
48 murat arcak
Linear Interpolation
When (
1 x ∈ [0, ∆)
φ( x ) = x
0 otherwise
0 ∆
as depicted on the right, the interpolation (91) keeps y constant be-
tween the data points:
y
y2
y3
y4
y1
x
x1 x2 x3 x4
Sinc Interpolation
sinc( x )
1
x
-3 -2 -1 1 2 3
φ( x ) = sinc( x/∆).
y2
y3
y1
x
∆ 2∆ 3∆
x
∆ 2∆ 3∆
1
Z π
sinc( x ) = cos(ωx )dω (94)
π 0
which you can verify by evaluating the integral. Viewing this integral
as an infinite sum of cosine functions, we see that the fastest varying
component has frequency ω = π. Thus the sinc function can’t exhibit
variations faster than this component.
Functions that involve frequencies smaller than some constant are
called “band-limited." This notion is made precise in EE 120 with
continuous Fourier Transforms. For 16B it is sufficient to think of a
band-limited signal as one that can be written as a sum or integral of
sinusoidal components whose frequencies lie in a finite band, which
is [0, π ] for the sinc function in (94).
50 murat arcak
Sampling Theorem
yi = f ( xi ) i = 1, 2, 3, . . .
xi = ∆i, i = 1, 2, 3, . . .
and obtain
yi = f (∆i ) i = 1, 2, 3, . . .
Then sinc interpolation between these data points gives:
where
φ( x ) = sinc( x/∆),
which is band-limited by π/∆ from (94). This means that fˆ( x ) in (95)
contains frequencies ranging from 0 to π/∆.
Now if f ( x ) involves frequencies smaller than π/∆, then it is reason-
able to expect that it can be recovered from (95) which varies as fast
as f ( x ). In fact the shifted sinc functions φ( x − ∆i ) form a basis for
the space of functions8 that are band-limited by π/∆ and the formula 8
for technical reasons this space is also
(95) is simply the representation of f ( x ) with respect to this basis. restricted to square integrable functions
which states that the function must be sampled faster than twice its
maximum frequency. The Sampling Theorem was proven by Claude
Shannon in the 1940s and was implicit in an earlier result by Harry
Nyquist. Both were researchers at the Bell Labs.
1 2 x
3
Harry Nyquist (1889-1976)
With ωmax = 4π 3 and ∆ = 1, the criterion (96) fails. To see that the
result of the sinc interpolation fˆ( x ) is now different from f ( x ), note
that this time we take 3 samples every two periods of the cosine func-
tion, as shown below. These samples are identical to the 3 samples
collected in one period of the function in Example 2 above. Therefore,
sinc interpolation gives the same result it did in Example 2:
2π
fˆ( x ) = cos x
3
fˆ( x )
f (x)
1 2 x
3
52 murat arcak
yi = cos (ωi + φ) .
Using the identity cos(2πi − θ ) = cos(θ ) which holds for any integer
i, and substituting θ = ωi + φ. we get
f ( x ) = sin (1.9πx )
as evident from the samples in the figure. Note that the negative sign
of − sin (0.1πx ) is a result of the phase reversal discussed above.
ee16b notes spring’17 53
0.8
0.6
0.4
0.2
f (x) 0
-0.2
-0.4
-0.6
-0.8
-1
0 2 4 6 8 10 12 14 16 18 20
x
Example 5: Note that the inequality in (96) is strict. To see that the
Sampling Theorem does not hold when ωmax = π ∆ suppose f ( x ) =
sin(πx ) and ∆ = 1. Then the samples are
yi = sin(πi ) = 0, i = 1, 2, 3, . . .
fˆ( x ) = 0
yd (k) = y(kT )
where the subscript “d" stands for discrete-time. The control se-
quence generated in discrete time is denoted ud (k) and is interpo-
lated by the zero order hold block to the continuous-time input
discrete-time
control
d
~x (t) = A~x (t) + Bu(t)
dt (101)
y(t) = C~x (t)
where ~xd (k) is the value of the state ~x (t) at time t = kT. It follows
that Cd = C because
Since u(s) is constant in the interval s ∈ [0, T ) and equal to ud (0), the
solution at t = T is
e aT − 1
x ( T ) = e aT x (0) + b u d (0)
| {z } |{z} a
x d (1) x d (0)
e aT − 1
xd (k + 1) = e aT xd (k) + b u d ( k ).
a
ee16b notes spring’17 55
λ = v + jω
maps to an eigenvalue of Ad at
whose magnitude is
|λd | = evT .
Thus, if λ satisfies the continuous-time stability criterion
Re(λ) = v < 0
Im(λ) Im(eλT )
eλT
Re(λ) Re(eλT )
1 1
0 0
-1 -1
0 2 4 6 0 2 4 6
1 1
0 0
-1 -1
0 2 4 6 0 2 4 6
1 1
0 0
-1 -1
0 2 4 6 0 2 4 6
1 1
0 0
-1 -1
0 2 4 6 0 2 4 6
r r
1 2 πk
v0 ( t ) = , vk (t) = cos (2t + 1) k = 1, · · · , N − 1,
N N 2N
The following identity, whose proof is omitted, shows that the basis
signals defined above are orthonormal:
N −1 N
if k = m = 0
πk πm
∑ cos
2N
( 2t + 1 ) cos
2N
( 2t + 1 ) = N
2 if k = m 6= 0
t =0
0 if k 6= m.
ee16b notes spring’17 59
v0 ( t ) v1 ( t )
0.4 0.4
0.2 0.2
0 0
-0.2 -0.2
-0.4 -0.4
0 5 10 15 0 5 10 15
v2 ( t ) v3 ( t )
0.4 0.4
0.2 0.2
0 0
-0.2 -0.2
-0.4 -0.4
0 5 10 15 0 5 10 15
αk = ~vkT~x.
x ( t ) = α 0 v 0 ( t ) + · · · + α N −1 v N −1 ( t ) t = 0, 1, . . . , N − 1
~x ∗~y
~x ∗~x = k~x k2
1
uk (t) , √ e jkωt , k = 0, 1, . . . , N − 1 where ω= 2π
N (107)
N
1 1
uk (t) = √ cos(kωt) + j √ sin(kωt).
N N
N −1
x (t) = ∑ X ( k ) u k ( t ). (108)
k =0
x (0) = 2, x (1) = 3.
~x = X (0)~u0 + X (1)~u1
similar to (104). Since ~u0 and ~u1 are real and orthonormal, that is
~u0T~u1 = 0 and ~u0T~u0 = ~u1T~u1 = 1, we get
5 1
X (0) = ~u0T~x = √ X (1) = ~u1T~x = − √ .
2 2
2π
Example 3 (N = 4): When the duration is N = 4 we have ω = N =
π
2:
1 j0t 1
u0 ( t ) = e =
2 2
1 jπt 1
u1 ( t ) = e 2 = ( j ) t
2 2
1 π 1
u2 (t) = e j2 2 t = (−1)t
2 2
1 j3 π t 1
u3 (t) = e 2 = (− j)t .
2 2
We view u0 (t), . . . , u3 (t) as length-four vectors whose entries are the
values that each sequence takes at t = 0, 1, 2, 3:
1 1 1 1
1 1 1 j 1 −1 1 −j
~u0 = ~u1 = ~u2 = ~u3 = .
2 1 2 −1 2 1 2 −1
1 −j −1 j
62 murat arcak
we will again use the orthonormality of the basis vectors ~u0 , . . . , ~u3 .
You can indeed show that
(
0 k 6= m
~u∗k ~um =
1 k = m.
x (3)
and combine this equation for k = 0, 1, 2, 3 into
X (0) 1 1 1 1 x (0)
X (1) 1 1 −j −1 j x (1)
=
X (2) 2 −1 −1 x (2)
1 1
X (3) 1 j −1 −j x (3)
where the first row of is ~u0∗ , the second row is ~u1∗ , and so on.
As an illustration, for the sequence x (0) = 1, x (1) = x (2) = x (3) = 0,
we find
1
X (0) = X (1) = X (2) = X (3) = .
2
The summation of u0 (t), . . . , u3 (t) with these weights indeed recovers
x (t) as shown in the figure below.
1
2 u0 ( t )
1
2 u1 ( t )
1
2 u2 ( t )
1
2 u3 ( t )
+
x (t) 1
Im
and rewrite (107) as Wk
1
uk (t) , √ Wkt , k = 0, 1, . . . , N − 1,
N
k 2π
N 1
Re
or as the vector
1
Wk
1 Wk 2
~uk = √ .
N ..
.
( N −1)
Wk
To see that these vectors form an orthonormal basis, note that
N −1 N −1 N −1
1 1 2π 1
~u∗k ~um =
N ∑ (Wkt )∗ Wmt =
N ∑ e j(m−k) N t =
N ∑ Wmt −k
t =0 t =0 t =0
2π 2π
where the second equality follows from (Wkt )∗ = (e jk N t )∗ = e− jk N t .
2π
Now, if m = k, e j(m−k) N t = 1 and the summation gives N. If m 6= k
the summation gives zero because the numbers Wmt −k , t = 0, . . . , N −
1 are spread evenly around the unit circle and add up to zero, as
illustrated on the right for m − k = 1 and N = 6. Thus, W12 W1
(
∗ 0 k 6= m
~uk ~um = (110)
1 k = m.
W13 W10
~u0∗
X (0) x (0)
X (1)
~u1∗
x (1)
X (2) ~u2∗ x (2)
= (112)
.. .. ..
. . .
X ( N − 1) ~u∗N −1 x ( N − 1)
and call it the "synthesis equation" since it synthesizes x (t) from the
basis signals.
We refer to the N × N matrix F as the Fourier Matrix. Note that the
matrix in the analysis equation (112) corresponds to F ∗ , because its
rows are conjugate transposes of the columns of F. Since the analysis
equation ~
X = F ∗~x and synthesis equation ~x = F ~
X are inverses of each
other, we conclude
F −1 = F ∗
which means that F is a unitary matrix:
F ∗ F = FF ∗ = I.
Thus, for N = 4,
1 1 1 1 1 1 1 1
1 1
j −1 −j 1 1
−j −1 j
F= F∗ = . (113)
2 1 −1 −1 2 1 −1 −1
1 1
1 −j −1 j 1 j −1 −j
k~x k2 = ~x ∗~x = ~X ∗ F ∗ F ~X = ~X ∗ ~X = k ~X k2 .
4) Conjugate symmetry:
When x (t) is real-valued, the DFT coefficients satisfy
X ( N − k ) = X (k )∗ k = 1, . . . , N − 1. (114)
Since x (t) is real, we have x (t)∗ = x (t); thus taking the conjugate of
both sides gives
N −1
X (k )∗ = ∑ (WNt −k )∗ x(t) = ~u∗N −k~x = X ( N − k).
t =0
ee16b notes spring’17 67
2π
ω0 = k 0 for some integer k0 ∈ {0, 1, . . . , N − 1} (115)
N
then x (t) is identical to the k0 -th basis function, except for the nor-
√
malization factor N:
√
x (t) = Nuko (t).
This means that x (t) is recovered from the k0 -th basis function alone:
( √
N if k = k0
X (k) =
0 otherwise.
1 jω0 t 1 − jω0 t
x (t) = e + e
2 2
1 jω0 t 1 j(2π −ω0 )t
= e + e
2 2
1 jk0 2π t 1 j( N −k0 ) 2π t
= e N + e N
2√ 2 √
N N
= uk0 (t) + u (t)
2 2 N −k0
we conclude
( √
N
2 if k = k0 or k = N − k0
X (k) = (116)
0 otherwise.
As an illustration, for
To illustrate what happens when (115) does not hold, we next take
N = 101 and plot the real and imaginary parts of the resulting DFT.
As expected, X (k) peaks near k = 10 and k = 90.
0 k
-1
0 10 20 30 40 50 60 70 80 90 100
0
k
-1
0 10 20 30 40 50 60 70 80 90 100
ee16b notes spring’17 69
1.5
0.5
0 k
-0.5
-1
-1.5
-2
0 10 20 30 40 50 60 70 80 90 100
Note that the real part of X (k) is even symmetric and the imaginary
part is odd symmetric about the midpoint, N/2, of the k axis. This is
a result of the conjugate symmetry property X ( N − k) = X (k )∗ . The
plot of | X (k)|, shown below, is also even symmetric.
4.5
3.5
2.5
1.5
0.5
0
0 10 20 30 40 50 60 70 80 90 100 k
increasing frequency
1 N 2π 1 1
u N/2 (t) = √ e j 2 N t = √ e jπt = √ (−1)t ,
N N N
which varies faster than all other basis signals.
Therefore, the critical part of a DFT plot is the left half where lower
values of k represent low frequencies and higher values approaching
N/2 represent high frequencies.
u(t)
x(t) y(t)
y(t)
u1 ( t ) + u2 ( t ) → y1 ( t ) + y2 ( t ). (119)
u ( t − T ) → y ( t − T ). (120)
This means that the system reacts the same way to an input applied
later as it would have reacted if the input was applied now.
Example 7: Consider the discrete-time state space model
Systems that are both linear and time invariant possess many use-
ful properties. One such property is that, if we know the system’s
response to the unit impulse sequence
(
1 if t = 0
δ(t) ,
0 otherwise, δ(t)
1
depicted on the right, we can predict its response to any other input.
t
We denote the impulse response by h(t), that is δ(t) → h(t). To
see how we can use h(t) to predict the system’s response to another
input u(t), rewrite u(t) as
y(t) = ∑ u ( k ) h ( t − k ). (123)
k
u ( t ) + u ( t − 1)
y(t) =
2
which includes three copies of the transmitted signal u(t), each with
delay Ti and gain αi , i = 1, 2, 3. In a discrete-time model Ti should
be interpreted as the nearest number of sample periods. This in-
put/output relationship is linear; it is also time invariant if we as-
sume that αi and Ti , i = 1, 2, 3 do not change over time. The impulse
response is obtained by substituting the unit impulse for the input,
α2
and is depicted on the right.
α3
t
T1 T2 T3
Finite Impulse Response (FIR) Systems
h(t) = 0 when t ∈
/ {0, 1, . . . , M } (124)
L −1
y(t) = ∑ u(k)h(t − k) (125)
k =0
y(t) = 0 when t ∈
/ {0, 1, . . . , M + L − 1}.
ee16b notes spring’17 73
u (0) 1
u (1) 0
.. = ..
. .
u ( L − 1) 0
y (0)
h (0)
h (1)
y (1)
..
..
.
.
.. = h( M)
.
0
..
.
..
.
y ( M + L − 1) 0
T
We now use this property to derive a relation between the input and
output of a LTI system in the DFT basis. Multiplying both sides of
(128) from the left with F ∗ we write:
F ∗~y = F ∗ H~u = F ∗ HFF ∗~u
ee16b notes spring’17 75
~Y = F ∗ HFU.
~
We can then reconstruct y(t) from its DFT Y (k). This method is
preferable to the convolution sum performed in (128) since DFT is
computed efficiently with FFT algorithms.
Summary: In the DFT basis a LTI system simply scales the DFT
coefficients of the input. Each frequency component k is scaled by
a factor H (k) that comes from the DFT of the impulse response.
To find the output y(t), we pad three zeros to the input and take the
DFT of the resulting length 103 sequence. Likewise we pad 99 zeros
to the length four impulse response and calculate its DFT. The figure
√
below shows |U (k )| (top) and 103 | H (k)| (middle), as well as their
product (bottom) which gives |Y (k )| from (131).
76 murat arcak
6
|U (k)|
4
0
0 10 20 30 40 50 60 70 80 90 100
1
√
103 | H (k)|
0.5
0
0 10 20 30 40 50 60 70 80 90 100
|Y (k)|
4
0
0 10 20 30 40 50 60 70 80 90 100
u(t)
1.5
0.5
-0.5
-1
-1.5
0 10 20 30 40 50 60 70 80 90 100
1.5
1 y(t)
0.5
-0.5
-1
-1.5
0 10 20 30 40 50 60 70 80 90 100
Proof of (130)
C = c 0 I + c 1 S + c 2 S 2 + · · · c N −1 S N −1 (132)
ee16b notes spring’17 77
1 h i
~u∗k = √ 1 Wk∗ · · · (Wk∗ ) N −1
N
1 h ∗ i 1 h ∗ i
~u∗k S = √ Wk · · · (Wk∗ ) N −1 1 = √ Wk · · · (Wk∗ ) N −1 (Wk∗ ) N
N N
N −1 N −1 √
~u∗k C = ∑ ct~u∗k St = ∑ ct (Wkt )∗~u∗k = NC (k)~u∗k (134)
t =0 t =0
~u0∗ ~u0∗
C (0)
~u1∗ ~u1∗
√ C (1)
~u2∗ ~u2∗
C = N .
..
.. . ..
. .
C ( N − 1)
~u∗N −1 ~u∗N −1
| {z } | {z }
F∗ F∗
Multiplying both sides from the right by F and substituting F ∗ F = I
on the right hand side, we obtain (130).