You are on page 1of 41

METU Computer Engineering

Ceng 384– Spring 2013


Week 5a
Signals and Systems
for Computer Engineers
Some slides, figures
and partial text are borrowed
from Lathi’s “Signal Processing &
Linear Systems” and Oppenheim &
Willsky’s “Signals and Systems”.

April 14 F. Y. Vural & S. Kalkan - CEng 384 1


Functions in terms of ‘simple’
functions
METU Computer Engineering

x(t) = sin(t) +
0.2cos(2t) +
0.1sin(5t)

April 14 F. Y. Vural & S. Kalkan - CEng 384 2


The Analytic Theory of Heat
METU Computer Engineering

 Fourier wrote a book on the flow of heat at


molecule level (inspired from Newton).
 In this book, Fourier claimed that a periodic
function of a variable (continuous or
discontinuous) can be expanded in a series of
sines.
 This claim turned out not to be true for all
functions.
The Analytic Theory of heat,
 But, in any case, writing functions in terms of a 1822.
series of sine functions turned out to be very
influential.
 Johann Dirichlet later demonstrated the
convergence properties of Fourier series.
April 14 F. Y. Vural & S. Kalkan - CEng 384 3
REMEMBER?
Example-1
METU Computer Engineering

 𝑥 𝑡 = 𝛼1 sin 2𝜋𝑡 + 𝛼2 cos 𝜋𝑡


𝑒 𝑗2𝜋𝑡 −𝑒 −𝑗2𝜋𝑡 𝑒 𝑗𝜋𝑡 +𝑒 −𝑗𝜋𝑡
= 𝛼1 + 𝛼2
2𝑗 2

 In general:

𝑥 𝑡 = 𝑎𝑘 𝑒 𝑗𝑘𝑤0 𝑡
𝑘=−∞

𝛼1 𝛼2
𝑘 = −2 ⇒ 𝑎−2 = − 𝑘=1 ⇒ 𝑎1 =
2𝑗 2
𝛼2 𝛼1
𝑘 = −1 ⇒ 𝑎−1 = 𝑘=2 ⇒ 𝑎2 =
2 2𝑗

April 14 F. Y. Vural & S. Kalkan - CEng 384 4


Example-2
METU Computer Engineering

 Find Fourier Series representation of:


 𝑥 𝑡 = 1 + cos(𝜔0 𝑡)
 In other words: Find 𝑎𝑘 in

𝑥 𝑡 = 𝑎𝑘 𝑒 𝑗𝑘𝜔0𝑡
𝑘=−∞

1 𝑗𝜔0 𝑡 −𝑗𝜔0 𝑡
 𝑥 𝑡 = 1 + cos 𝑤0 𝑡 = 1 + 2 (𝑒 +𝑒 )

1 1
 𝑎0 = 1 𝑎1 = 2 𝑎−1 = 2

𝑎𝑘 = 0 for 𝑘 ≠ ∓1,0

April 14 F. Y. Vural & S. Kalkan - CEng 384 5


Example-3
METU Computer Engineering

 Find Fourier Series representation of:


 𝑥 𝑡 = 1 + cos 𝑤0 𝑡 + sin(𝑤0 𝑡)

𝑥 𝑡 = 1 + cos 𝑤0 𝑡 + sin(𝑤0 𝑡)
1 𝑗𝑤0 𝑡 −𝑗𝑤0 𝑡 1 𝑗𝑤0 𝑡 −𝑗𝑤0 𝑡
=1+ 𝑒 +𝑒 + (𝑒 −𝑒 )
2 2𝑗
1
1 𝑗𝑤0 𝑡 1 −𝑗𝑤0 𝑡 (𝑗 = −𝑗)
=1+ 1−𝑗 𝑒 + (1 + 𝑗)𝑒
2 2
1 1
 𝑎0 = 1 𝑎1 = (1 − 𝑗) 𝑎−1 = (1 + 𝑗)
2 2

Magnitude: 1, 2/2, 2/2 Gives us magnitude and phase


𝜋 𝜋 spectrums.
Phase/Orientation: 0, − 4 , 4
April 14 F. Y. Vural & S. Kalkan - CEng 384 6
METU Computer Engineering

 Theorem: A periodic function can be represented


as the superposition of sines and cosines or
superposition of complex exponentials (provided
that certain conditions are met).
∞ ∞
𝑥 𝑡 = 𝑎𝑘 𝑒 𝑗𝑘𝑤0 𝑡 𝑥 𝑡 = [𝐵𝑘 cos 𝑘𝑤0 𝑡 − 𝐶𝑘 sin 𝑘𝑤0 𝑡 ]
𝑘=−∞ 𝑘=1

1 𝑇 −𝑗𝑘𝑤0 𝑡
=> 𝑎𝑘 = 𝑥 𝑡 𝑒 𝑑𝑡
𝑇 0

April 14 F. Y. Vural & S. Kalkan - CEng 384 7


Why is Fourier Series important?
as far as LTI systems are concerned…
METU Computer Engineering

 (basis) signals fk(t) have the property that:


x(t) = fk(t) y(t) = lkfk(t)
System

 i.e. the output signal is the same as the input signal, multiplied by the
constant “gain” lk (which may be complex)

 For CT LTI systems, we also have that


x(t) = Sk akfk(t) LTI y(t) = Sk aklkfk(t)
System

April 14 F. Y. Vural & S.8/16


Kalkan - CEng 384
Response of LTI to Complex
Exponential
METU Computer Engineering

Continuous Time Discrete Time


 𝑒 𝑠𝑡 → 𝐻 𝑠 𝑒 𝑠𝑡  𝑧𝑛 → 𝐻 𝑧 𝑧𝑛
 𝑠: a complex number.  z: a complex number

𝑦 𝑡 = 𝑒 𝑠𝑡 ∗ℎ 𝑡
∞ y[𝑛] = ℎ 𝑘 𝑥[𝑛 − 𝑘]
= ℎ 𝜏 𝑥 𝑡 − 𝜏 𝑑𝜏 𝑘=−∞

−∞

= ℎ 𝑘 𝑧 𝑛−𝑘
= ℎ 𝜏 𝑒𝑠 𝑡−𝜏 𝑑𝜏
𝑘=−∞
−∞ ∞

= 𝑒 𝑠𝑡 ℎ 𝜏 𝑒 −𝑠𝜏 𝑑𝜏 = 𝑧𝑛 ℎ 𝑘 𝑧 −𝑘
−∞ 𝐻 𝑠 𝑘=−∞ 𝐻 𝑧

April 14 F. Y. Vural & S. Kalkan - CEng 384 9


In general…
METU Computer Engineering

Continuous Time Discrete Time


𝑠𝑘 𝑡 𝑛
 If 𝑥 𝑡 = 𝑘 𝑎𝑘 𝑒 then,  If 𝑥[𝑛] = 𝑎 𝑧
𝑘 𝑘 𝑘 then,
 then:  then:
𝑠𝑘 𝑡  𝑦[𝑛] = 𝑘 𝑎𝑘 𝐻 𝑧𝑘 𝑧𝑘𝑛
 𝑦𝑡 = 𝑘 𝑎𝑘 𝐻 𝑠𝑘 𝑒

 e𝑠𝑘𝑡  Eigenfunctions.
 𝐻(𝑠𝑘 )  Eigenvalues

April 14 F. Y. Vural & S. Kalkan - CEng 384 10


Determining Fourier Series Representation
of CT Periodic Signals
METU Computer Engineering

 Given that a signal has a Fourier series representation, we have to


find {ak}. Multiplying by e jn0t

x(t )e  jn0t
  k e
a e
k  
jk0t  jn0t

 k
T T
 dt  
 jn0t j ( k  n )0 t T is the fundamental
x(t )e a e dt
0 0
k   period of x(t)


T
 ak  e j ( k  n )0t dt
0
k  

 Using Euler’s formula for the complex exponential integral


T T T
 dt   cos((k  n)0t )dt  j  sin((k  n)0t )dt
j ( k  n )0t
e
0 0 0

 It can be shown that


T j ( k  n ) t T k n
0 e 0
dt  
0 kn
April 14 F. Y. Vural & S.11/16
Kalkan - CEng 384
Determining Fourier Series Representation
of CT Periodic Signals
METU Computer Engineering

 Therefore
T
an  1
T 0  x(t )e jn0t dt

 which allows us to determine the coefficients. Also note that this


result is the same if we integrate over any interval of length T (not just
[0,T]), denoted by
an  T1  x(t )e  jn0t dt
T

 To summarise, if x(t) has a Fourier series representation, then the pair


of equations that defines the Fourier series of a periodic, continuous-
time signal:  
x(t )   ak e jk0t
  ak e jk ( 2 / T )t
k   k  

ak  T1  x(t )e  jk0t dt  T1  x(t )e  jk ( 2 / T )t dt


T T

April 14 F. Y. Vural & S.12/16


Kalkan - CEng 384
METU Computer Engineering

 {𝑎𝑘 }  Fourier series coefficients or spectral coefficients of


𝑥(𝑡).
1 𝑇
 𝑎0 = 𝑥 𝑡 𝑑𝑡
𝑇 0
  dc or constant component of x(t)
 i.e., it is the average value of x(t) over one period!

April 14 F. Y. Vural & S. Kalkan - CEng 384 13


Example 1: Fourier Series sin(0t)
 The fundamental period of sin(0t) is 0
METU Computer Engineering

 By inspection we can write:


sin(0t )  1
2j e j0t  21j e  j0t
 So a1 = 1/2j, a-1 = -1/2j and ak = 0 otherwise
 The magnitude and angle of the Fourier coefficients
are:

April 14 F. Y. Vural & S.14/16


Kalkan - CEng 384
Exercise
METU Computer Engineering

 Find Fourier Series representation of:


 𝑥 𝑡 = 1 + cos 𝜔0 𝑡 + sin(𝜔0 𝑡)

 USE: an  T1  x(t )e  jn0t dt


T

 Hint: check 𝑎0 , 𝑎1 , 𝑎−1 specifically and 𝑎𝑛 in general.

April 14 F. Y. Vural & S. Kalkan - CEng 384 15


Example: Periodic Step Signal
 Consider the periodic square wave, illustrated by:
METU Computer Engineering

 and is defined over one period as:


1 | t | T1
x(t )  
0 T1 | t | T / 2
 Fourier coefficients:
T1 T1

e
2T1  jk0t  jk0t T1
a0   1dt 
1 ak  1
T dt   1
jk0T e
T T1
T1
T T1

2  e jk0T1  e  jk0T1 
  
k0T  2j  these
coefficients
 2 sin(k0T1 ) / k0T
are real
April 14
 sin(k T ) / k
F. Y. Vural & S. Kalkan0- CEng
1 384 16
Example 3: Periodic Step Signal
 For this example, instead of plotting both the magnitude and
METU Computer Engineering

the angle of the complex coefficients, we only need to plot


the value of the coefficients.
 Note we have an infinite series of non-zero coefficients

T=4T1

T=8T1

T=16T1

April 14 F. Y. Vural & S.17/16


Kalkan - CEng 384
Today
METU Computer Engineering

 Convergence of Fourier Series


 Properties of Fourier coefficients

April 14 F. Y. Vural & S. Kalkan - CEng 384 18


Convergence of Fourier Series
METU Computer Engineering

 Error of approximation:
 Approx. to 𝑥(𝑡): 𝑥𝑁 𝑡 = 𝑁
𝑎
𝑘=−𝑁 𝑘 𝑒 𝑗𝑘𝑤0 𝑡

 𝑒𝑁 𝑡 = 𝑥 𝑡 − 𝑥𝑁 (𝑡)
 𝐸𝑁 = 𝑇 𝑒𝑁 𝑡 2 𝑑𝑡
 The coefficients that minimize 𝐸𝑁 are given by:
1 𝑇 −𝑗𝑘𝑤0 𝑡
 𝑎𝑘 = 𝑇 0
𝑥 𝑡 𝑒 𝑑𝑡
 If N ↑, then 𝐸𝑁 ↓ (if 𝑥(𝑡) has a Fourier S. Repr.)

April 14 F. Y. Vural & S.19/16


Kalkan - CEng 384
Convergence of Fourier Series
 Fourier Series
METU Computer Engineering

 𝑥𝑁 𝑡 = 𝑁 𝑎
𝑘=−𝑁 𝑘 𝑒 𝑗𝑘𝑤0 𝑡

1 𝑇 −𝑗𝑘𝑤0 𝑡
 𝑎𝑘 = 𝑇 0
𝑥 𝑡 𝑒 𝑑𝑡
 Problems in convergence:
 𝑎𝑘 may not be bounded.
 Even if 𝑎𝑘 are bounded, their combination might not be
bounded.
 Luckily, every continuous periodic signal has a
Fourier series representation.
 i.e., when 𝑁 → ∞ , 𝐸𝑁 → 0.
 This is also true for many discontinuous signals.
April 14 F. Y. Vural & S.20/16
Kalkan - CEng 384
Convergence of Fourier Series
 Not every periodic signal can be represented as an
METU Computer Engineering

infinite Fourier series, however just about all


interesting signals can be (note that the step signal is
discontinuous)
 The Dirichlet conditions are necessary and sufficient
conditions on the signal.
 Condition 1. Over any period, 𝑥(𝑡) must be
absolutely integrable

T
x(t ) dt  

Guarantees that the coefficients are finite!

April 14 F. Y. Vural & S. Kalkan - CEng 384


Convergence of Fourier Series
METU Computer Engineering

 Example for condition-1:


1
𝑥 𝑡 = 𝑡
, 0<𝑡≤1

April 14 F. Y. Vural & S. Kalkan - CEng 384 22


Convergence of Fourier Series
METU Computer Engineering

 Condition 2.

 In any finite interval, 𝑥(𝑡) has bounded variation

 i.e., there is no more than a finite number of


maxima and minima during any single period of the
signal

Example:

which satisfies the 1st condition.


April 14 F. Y. Vural & S. Kalkan - CEng 384 23
Convergence of Fourier Series
METU Computer Engineering

 Condition 3.

 In any finite interval of time, there are only a finite


number of finite discontinuities.

Example:

April 14 F. Y. Vural & S.24/16


Kalkan - CEng 384
Gibbs Phenomenon
METU Computer Engineering

At a discontinuity,
 there is ripple whose
magnitude does not
change no matter what N
becomes.
 The width of the ripple
shrinks with N.

April 14 F. Y. Vural & S. Kalkan - CEng 384 25


Properties of CT Fourier Series
METU Computer Engineering

 Linearity:
 Given two signals 𝑥(𝑡) and 𝑦(𝑡) with:
ℱ𝒮
𝑥 𝑡 𝑎𝑘
ℱ𝒮
y 𝑡 𝑏𝑘
 The linear combination of the signals:
ℱ𝒮
𝑧 𝑡 = 𝐴𝑥 𝑡 + 𝐵𝑦 𝑡 𝑐𝑘
where 𝑐𝑘 = 𝐴𝑎𝑘 +𝐵𝑏𝑘

 Time-Shifting:
ℱ𝒮
𝑥 𝑡 − 𝑡0 𝑒 −𝑗𝑘𝑤0 𝑡0 𝑎𝑘

April 14 F. Y. Vural & S. Kalkan - CEng 384 26


Properties of CT Fourier Series
METU Computer Engineering

 Time Reversal:
 What happens to the coefficients when we reverse time?
 i.e., what is the relation bw the coefficients of 𝑥(−𝑡) and
𝑥(𝑡)?
∞ −𝑗𝑘𝑤0 𝑡 = ∞ 𝑗𝑚𝑤0 𝑡
𝑥 −𝑡 = 𝑘=−∞ 𝑎𝑘 𝑒 𝑚=−∞ 𝑎−𝑚 𝑒

ℱ𝒮 ℱ𝒮
𝑥 𝑡 𝑎𝑘 𝑥 −𝑡 𝑎−𝑘

 In fact:
 If x(t) is even: 𝑎−𝑘 = 𝑎𝑘
 If x(t) is odd: 𝑎−𝑘 = −𝑎𝑘
April 14 F. Y. Vural & S. Kalkan - CEng 384 27
Properties of CT Fourier Series
METU Computer Engineering

 Time Scaling:
 What happens to the coefficients when we scale time?
 i.e., what is the relation bw the coefficients of 𝑥(𝛼𝑡) and
𝑥(𝑡)?

𝑥 𝛼𝑡 = 𝑎𝑘 𝑒 𝑗𝑘(𝛼𝑤0)𝑡
𝑘=−∞

 The coefficients don’t change but the representation does


since the fundamental frequency has changed.

April 14 F. Y. Vural & S. Kalkan - CEng 384 28


Properties of CT Fourier Series
METU Computer Engineering

 Multiplication:
 Given two signals 𝑥(𝑡) and 𝑦(𝑡) with:
ℱ𝒮
𝑥 𝑡 𝑎𝑘
ℱ𝒮
𝑦 𝑡 𝑏𝑘

 The multiplication of the signals:



ℱ𝒮
𝑥 𝑡 𝑦 𝑡 𝑐𝑘 = 𝑎𝑙 𝑏𝑘−𝑙
𝑙=−∞

April 14 F. Y. Vural & S. Kalkan - CEng 384 29


Properties of CT Fourier Series
METU Computer Engineering

 Derivative
 Given two signals 𝑥(𝑡) with:
ℱ𝒮
𝑥 𝑡 𝑎𝑘
 Then:
𝑑𝑥 𝑡 ℱ𝒮
𝑗𝑘𝜔0 𝑎𝑘
𝑑𝑡

April 14 F. Y. Vural & S. Kalkan - CEng 384 30


Properties of CT Fourier Series
METU Computer Engineering

 Avg. Power & Parseval’s relation:


1 2 𝑑𝑡 2
𝑥 𝑡 = 𝑎𝑘
𝑇 𝑇 𝑘=−∞

April 14 F. Y. Vural & S. Kalkan - CEng 384 31


DT Fourier Series
METU Computer Engineering

 Similar to the CT case:


 Write 𝑥[𝑛] in terms of 𝑒 𝑗𝑘𝑤0𝑛 :
2𝜋
𝑗𝑘( 𝑁 )𝑛
𝑥𝑛 = 𝑎𝑘 𝑒 𝑗𝑘𝑤0 𝑛 = 𝑎𝑘 𝑒
𝑘 𝑘
 However, after some k value, the harmonic
components repeat themselves.
 Remember: in the CT case, they were all different.
 Therefore, we have the following:
𝑥𝑛 = 𝑎𝑘 𝑒 𝑗𝑘𝑤0 𝑛
𝑘=<𝑁>
April 14 F. Y. Vural & S. Kalkan - CEng 384 33
METU Computer Engineering

𝑥 𝑛 = 𝑎0 𝜙0 𝑛 + ⋯ + 𝑎𝑁−1 𝜙𝑁−1 [𝑛]

𝑥 𝑛 = 𝑎1 𝜙1 𝑛 + ⋯ +𝑎𝑁 𝜙𝑁 [𝑛]

𝑥 𝑛 = 𝑎2 𝜙2 𝑛 + ⋯ +𝑎𝑁+1 𝜙𝑁+1 [𝑛]

April 14 F. Y. Vural & S. Kalkan - CEng 384 34


DT Fourier Series
METU Computer Engineering

 Similar to the CT case:


 We can derive an expression for the coefficients:
1 2𝜋
−𝑗𝑘( 𝑁 )𝑛
𝑎𝑘 = 𝑥[𝑛]𝑒
𝑁
𝑛=<𝑁>

Fourier coefficients
Spectral coefficients

April 14 F. Y. Vural & S. Kalkan - CEng 384 35


DT Fourier Series Representation
METU Computer Engineering

Synthesis equation:
𝑥𝑛 = 𝑎𝑘 𝑒 𝑗𝑘𝑤0𝑛
𝑘=<𝑁>

Analysis equation:
1 2𝜋
−𝑗𝑘( )𝑛
𝑎𝑘 = 𝑥[𝑛]𝑒 𝑁
𝑁
𝑛=<𝑁>

April 14 F. Y. Vural & S. Kalkan - CEng 384 36


Example
METU Computer Engineering

 Find Fourier coefficients of 𝑥[𝑛] = sin(𝑤0 𝑛).

 Hint: Use the following:


𝑛−1 𝑛
1 − 𝑎
𝑎𝑘 =
1−𝑎
𝑘=0

April 14 F. Y. Vural & S. Kalkan - CEng 384 37


Properties of DT Fourier Series
METU Computer Engineering

 Linearity:
 Given two DT signals 𝑥[𝑛] and 𝑦[𝑛] with:
ℱ𝒮
𝑥[𝑛] 𝑎𝑘
ℱ𝒮
𝑦[n] 𝑏𝑘
 The linear combination of the signals:
ℱ𝒮
𝑧[𝑛] = 𝐴𝑥[𝑛] + 𝐵𝑦[𝑛] 𝑐𝑘
where 𝑐𝑘 = 𝐴𝑎𝑘 +𝐵𝑏𝑘

 Time-Shifting:
ℱ𝒮
𝑥[𝑛 − 𝑛0 ] 𝑒 −𝑗𝑘𝑤0 𝑛0 𝑎𝑘

April 14 F. Y. Vural & S. Kalkan - CEng 384 38


Properties of DT Fourier Series
METU Computer Engineering

 Multiplication:
 Given two DT signals 𝑥[𝑛] and 𝑦[𝑛] with:
ℱ𝒮
𝑥[𝑛] 𝑎𝑘
ℱ𝒮
𝑦[n] 𝑏𝑘

 The multiplication of the signals:


ℱ𝒮
𝑥𝑛𝑦𝑛 𝑐𝑘 = 𝑎𝑙 𝑏𝑘−𝑙
𝑙=<𝑁>

April 14 F. Y. Vural & S. Kalkan - CEng 384 39


Properties of DT Fourier Series
METU Computer Engineering

 First Difference:
 Given a DT 𝑥[𝑛] with:
ℱ𝒮
𝑥[𝑛] 𝑎𝑘

 The first difference:


ℱ𝒮 2𝜋
−𝑗𝑘
𝑥 𝑛 −𝑥 𝑛−1 1−𝑒 𝑁 𝑎𝑘

Why? Hint: apply time-shifting.

April 14 F. Y. Vural & S. Kalkan - CEng 384 40


Properties of DT Fourier Series
METU Computer Engineering

 Avg. Power & Parseval’s relation:

1 2 2
𝑥𝑛 = 𝑎𝑘
𝑁
𝑛=<𝑁> 𝑛=<𝑁>

April 14 F. Y. Vural & S. Kalkan - CEng 384 41


A DT Example
METU Computer Engineering

 Find the signal 𝑥[𝑛] that satisfy the


following:

1. 𝑥[𝑛] is periodic with period N=6.


2. 5𝑛=0 𝑥 𝑛 = 2
3. 7𝑛=2 −1 𝑛 𝑥 𝑛 = 1
4. 𝑥[𝑛] has the minimum avg. power per period
among the alternatives satisfying 1-3.

April 14 F. Y. Vural & S. Kalkan - CEng 384 42

You might also like