Fourier analysis Dynamic System Identification – Part 1, Lecture 6
Fourier analysisDynamic System Identification – Part 1, Lecture 6
Signal typesA signal is a real function of time
2Scandella Matteo - Dynamical System Identification course
𝑠 ∶ ℝ → ℝ 𝑠 ∶ ℤ → ℝ
Continuous signal Discrete signal
Sampling
Reconstruction
The reconstruction is possible only in certain cases.
Continuous signalA signal is a real function in real variable:
𝑠 ∶ ℝ → ℝ
3Scandella Matteo - Dynamical System Identification course
Example: Step
4Scandella Matteo - Dynamical System Identification course
𝑠𝑡𝑒𝑝 𝑡 = ቊ1, 𝑡 ≥ 00, 𝑡 < 0
Example: Ramp
5Scandella Matteo - Dynamical System Identification course
𝑟𝑎𝑚𝑝 𝑡 = ቊ𝑡, 𝑡 ≥ 00, 𝑡 < 0
Example: Dirac delta
6Scandella Matteo - Dynamical System Identification course
𝛿 𝑡 = ቊ∞, 𝑡 = 00, 𝑡 ≠ 0
න−∞
+∞
𝛿 𝑡 𝑑𝑡 = 1with
Periodic signal
7Scandella Matteo - Dynamical System Identification course
A signal 𝑠 is called periodic if and only if ∃𝑇 ∈ ℝ+, called period, such that:
∀𝑘 ∈ ℤ, 𝑠 𝑡 = 𝑠 𝑡 + 𝑘 ⋅ 𝑇0
𝑇
Example: Sine wave
8Scandella Matteo - Dynamical System Identification course
𝑠 𝑡 = 𝐴 ⋅ sin 2 ⋅ 𝜋 ⋅𝑡
𝑇+ 𝜑
𝐴: Amplitude
𝑇: Period
𝜑: Phase
sin−1 𝜑
Remark on periodic signal
9Scandella Matteo - Dynamical System Identification course
A periodic signal is defined by the behavior
inside one period:
𝑠𝑝 ∶ (0, 𝑇] → ℝ
Because:
𝑠 𝑡 =
𝑘=−∞
𝑘=∞
𝑠𝑝 𝑡 + 𝑘𝑇
It’s also possible to note that every section of the
function domain with length 𝑇 can be used. For
example:
𝑠𝑝2 ∶ −𝑇
2,𝑇
2→ ℝ
Remark on the period • The period value 𝑇 is not uniquely define
• If a signal is periodic with period 𝑇 then it’s also periodic with period 𝑘 ⋅ 𝑇 where 𝑘 is a positive natural number.
• The smallest possible period (greater than zero) will be denoted with 𝑇0 and 𝑇𝑘 = 𝑘 ⋅ 𝑇0
10Scandella Matteo - Dynamical System Identification course
𝑇0𝑇2 = 2𝑇0
𝑇3 = 3𝑇0
Frequency
Given a periodic signal 𝑠 𝑡 with period 𝑇0 we define its frequency 𝑓0 as the number of time that the function repeats itself in one unit of time:
𝑓0 =1
𝑇0The frequency is measured in:
𝐻𝑧 =1
𝑠
11Scandella Matteo - Dynamical System Identification course
𝑓0 ↑ 𝑇0 ↓
Fourier seriesThe Fourier series is a way to approximate a periodic signal as a sum of sine waves.
Consider the periodic signal 𝑠 𝑡 with period 𝑇0:
𝑆𝑛 𝑠 𝑡 =𝑎02+
𝑘=1
𝑛
𝑎𝑘 ⋅ cos2𝜋𝑘𝑡
𝑇0+ 𝑏𝑘 ⋅ sin
2𝜋𝑘𝑡
𝑇0
12Scandella Matteo - Dynamical System Identification course
𝑎𝑘 =2
𝑇0⋅ න
0
𝑇0
𝑠 𝑡 ⋅ cos2𝜋𝑘𝑡
𝑇0𝑑𝑡 , 𝑘 = 0,1,⋯ , 𝑛
𝑏𝑘 =2
𝑇0⋅ න
0
𝑇0
𝑠 𝑡 ⋅ sin2𝜋𝑘𝑡
𝑇0𝑑𝑡 , 𝑘 = 1,⋯ , 𝑛
lim𝑛→∞
𝑆𝑛 𝑠 𝑡 = 𝑠 𝑡
With some assumptions
Example: square wave
13Scandella Matteo - Dynamical System Identification course
𝑠𝑝 𝑥 =𝐴 0 ≤ 𝑡 <
𝑇02
−𝐴𝑇02≤ 𝑡 < 𝑇
𝑎𝑘 = 0
𝑏𝑘 = ቐ0 if 𝑘 is even4𝐴
𝜋𝑘if 𝑘 is 𝑜𝑑𝑑
𝑆1 𝑠 𝑡
𝑠 𝑡
Example: square wave
14Scandella Matteo - Dynamical System Identification course
𝑠𝑝 𝑥 =𝐴 0 ≤ 𝑡 <
𝑇02
−𝐴𝑇02≤ 𝑡 < 𝑇
𝑎𝑘 = 0
𝑏𝑘 = ቐ0 if 𝑘 is even4𝐴
𝜋𝑘if 𝑘 is 𝑜𝑑𝑑
𝑆3 𝑠 𝑡
𝑠 𝑡
3-th sine wave
Example: square wave
15Scandella Matteo - Dynamical System Identification course
𝑠𝑝 𝑥 =𝐴 0 ≤ 𝑡 <
𝑇02
−𝐴𝑇02≤ 𝑡 < 𝑇
𝑎𝑘 = 0
𝑏𝑘 = ቐ0 if 𝑘 is even4𝐴
𝜋𝑘if 𝑘 is 𝑜𝑑𝑑
𝑆5 𝑠 𝑡
𝑠 𝑡
5-th sine wave
Example: square wave
16Scandella Matteo - Dynamical System Identification course
𝑠𝑝 𝑥 =𝐴 0 ≤ 𝑡 <
𝑇02
−𝐴𝑇02≤ 𝑡 < 𝑇
𝑎𝑘 = 0
𝑏𝑘 = ቐ0 if 𝑘 is even4𝐴
𝜋𝑘if 𝑘 is 𝑜𝑑𝑑
𝑆23 𝑠 𝑡
𝑠 𝑡
23-th sine
wave
Harmonics• The Fourier series decomposes a periodic signal in
a sum of sine waves called harmonics.
• The 𝑘-th harmonics has the period:
• The first harmonics are called fundamental harmonic and its period is equal to 𝑇0
• All the other harmonics have frequency multiple of 𝑇0
17Scandella Matteo - Dynamical System Identification course
𝑇𝑘 =𝑇0𝑘
𝑓𝑘 =1
𝑇𝑘=
𝑘
𝑇0= 𝑘 ⋅ 𝑓0
Angular velocityGiven a sine wave:
𝑠 𝑡 = 𝐴 ⋅ sin 2 ⋅ 𝜋 ⋅𝑡
𝑇0+ 𝜑
The angular velocity 𝜔0 is defined by number of radiants of the sin argument that change in the time unit.
The angle is:
𝜃 = 2 ⋅ 𝜋 ⋅𝑡
𝑇0+ 𝜑
And the velocity
𝜔0 =𝑑𝜃
𝑑𝑡=2 ⋅ 𝜋
𝑇0= 2 ⋅ 𝜋 ⋅ 𝑓0
The angular velocity of the harmonics of a generic periodic signal are the angular velocity of the generic signal.
18Scandella Matteo - Dynamical System Identification course
𝜔𝑘 =2𝜋
𝑇𝑘= 2𝜋𝑓0
Constant componentRecalling the Fourier series:
𝑆𝑛 𝑠 𝑡 =𝑎02+
𝑘=1
𝑛
𝑎𝑘 ⋅ cos2𝜋𝑘𝑡
𝑇0+ 𝑏𝑘 ⋅ sin
2𝜋𝑘𝑡
𝑇0
The term 𝑎0
2is called offset of the signal or constant component.
19Scandella Matteo - Dynamical System Identification course
𝑎0 = 0 𝑎0 ≠ 0
𝑎02
Complex formRecalling the Euler’s formula:
𝑒𝑗𝑥 = cos 𝑥 + 𝑗 ⋅ sin 𝑥
It’s possible to write:
𝑆𝑛 𝑠 𝑡 =𝑎02+
𝑘=1
𝑛
𝑎𝑘 ⋅ cos2𝜋𝑘𝑡
𝑇0+ 𝑏𝑘 ⋅ sin
2𝜋𝑘𝑡
𝑇0
=
𝑘=−𝑛
𝑛
𝑐𝑘 ⋅ 𝑒𝑗⋅2𝜋𝑘𝑡𝑇0
where:
𝑐𝑘 =1
𝑇0⋅ න
0
𝑇0
𝑠 𝑡 ⋅ 𝑒−𝑗⋅
2𝜋𝑘𝑡𝑇0 𝑑𝑡 , 𝑘 = −𝑛,⋯ ,−1,0,1,⋯ , 𝑛
The coefficients 𝑐 are a complex sequence 𝑐: ℤ → ℂ that define the amplitude of the harmonics that compose the signal.
In the complex form, the constant component is 𝑐0 =𝑎0
2∈ ℝ.
20Scandella Matteo - Dynamical System Identification course
𝑘-th complex harmonic
Amplitude of the 𝑘-th complex harmonic
Properties of 𝑐𝑘
21Scandella Matteo - Dynamical System Identification course
𝑠 is even 𝑠 𝑡 = 𝑠 −𝑡 𝑐−𝑘 = 𝑐𝑘 𝑐 is even
𝑠 is odd 𝑠 𝑡 = −𝑠 −𝑡 𝑐−𝑘 = −𝑐𝑘 𝑐 is odd
𝑠 𝑡 ∈ ℝ 𝑐−𝑘 = 𝑐𝑘∗
Re 𝑐 is even
Im 𝑐 is odd
Re 𝑐−𝑘 = Re 𝑐𝑘
Im 𝑐−𝑘 = −Im 𝑐𝑘
For us this property is always valid, we won’t look into
complex signals
𝑐−𝑘 = 𝑐𝑘
∠𝑐−𝑘 = −∠𝑐𝑘
𝑐𝑘 is even
∠𝑐𝑘 is odd
LinearityGiven two signal and their Fourier coefficient:
𝑠𝐴 𝑡 ⇆ 𝑐𝐴,𝑘𝑠𝐵 𝑡 ⇆ 𝑐𝐵,𝑘
the signal𝑠 𝑡 = 𝛼𝑠𝐴 𝑡 + 𝛽𝑠𝐵 𝑡
has coefficients:
𝑐𝑘 =2
𝑇0⋅ න
0
𝑇0
𝑠 𝑡 ⋅ 𝑒−𝑗⋅
2𝜋𝑘𝑡𝑇0 𝑑𝑡
=2
𝑇0⋅ න
0
𝑇0
𝛼𝑠𝐴 𝑡 + 𝛽𝑠𝐵 𝑡 ⋅ 𝑒−𝑗⋅
2𝜋𝑘𝑡𝑇0 𝑑𝑡
= 𝛼2
𝑇0⋅ න
0
𝑇0
𝑠𝐴 𝑡 ⋅ 𝑒−𝑗⋅
2𝜋𝑘𝑡𝑇0 𝑑𝑡 + 𝛽
2
𝑇0⋅ න
0
𝑇0
𝑠𝐵 𝑡 ⋅ 𝑒−𝑗⋅
2𝜋𝑘𝑡𝑇0 𝑑𝑡
= 𝛼𝑐𝐴,𝑘 + 𝛽𝑐𝐵,𝑘
22Scandella Matteo - Dynamical System Identification course
23Scandella Matteo - Dynamical System Identification course
Uniqueness
Given a periodic signal 𝑠 𝑡 its Fourier coefficients are unique
and it’s the only signal with such Fourier coefficients.
𝑠 𝑡 ⇄ 𝑐𝑘
𝒄𝟎 is the mean of the signal
Given a periodic signal 𝑠 𝑡 its first Fourier coefficient is:
𝑐0 =1
𝑇0⋅ න
0
𝑇0
𝑠 𝑡 ⋅ 𝑒−𝑗⋅
2𝜋⋅0⋅𝑡𝑇0 𝑑𝑡 =
1
𝑇0⋅ න
0
𝑇0
𝑠 𝑡 ⋅ 𝑑𝑡
𝑐0 ∈ ℝ
Interpretation for real signals
24Scandella Matteo - Dynamical System Identification course
𝑆𝑛 𝑠 𝑡 =
𝑘=−𝑛
𝑛
𝑐𝑘 ⋅ 𝑒𝑗⋅2𝜋𝑘𝑡𝑇0
=
𝑘=−𝑛
−1
𝑐𝑘 ⋅ 𝑒𝑗⋅2𝜋𝑘𝑡𝑇0 + 𝑐0𝑒
𝑗⋅2𝜋⋅0⋅𝑡𝑇0 +
𝑘=1
𝑛
𝑐𝑘 ⋅ 𝑒𝑗⋅2𝜋𝑘𝑡𝑇0
=
𝑘=−𝑛
−1
𝑐−𝑘 ⋅ 𝑒𝑗⋅2𝜋𝑘𝑡𝑇0 + 𝑐0 +
𝑘=1
𝑛
𝑐𝑘 ⋅ 𝑒𝑗⋅2𝜋𝑘𝑡𝑇0
=
𝑥=1
𝑛
𝑐𝑥 ⋅ 𝑒−𝑗⋅
2𝜋𝑥𝑡𝑇0 + 𝑐0 +
𝑘=1
𝑛
𝑐𝑘 ⋅ 𝑒𝑗⋅2𝜋𝑘𝑡𝑇0
= 𝑐0 +
𝑘=1
𝑛
𝜌𝑘 ⋅ 𝑒−𝑗⋅𝜙𝑘 ⋅ 𝑒
−𝑗⋅2𝜋𝑥𝑡𝑇0 + 𝜌𝑘 ⋅ 𝑒
𝑗⋅𝜙𝑘 ⋅ 𝑒𝑗⋅2𝜋𝑘𝑡𝑇0
= 𝑐0 +
𝑘=1
𝑛
𝜌𝑘 ⋅ 𝑒−𝑗⋅
2𝜋𝑘𝑡𝑇0
+𝜙𝑘 + 𝑒𝑗⋅
2𝜋𝑥𝑡𝑇0
+𝜙𝑘
= 𝜌0 +
𝑘=1
𝑛
2𝜌𝑘 ⋅ cos2𝜋𝑘𝑡
𝑇0+ 𝜙𝑘
𝑐𝑘 = 𝜌𝑘 ⋅ 𝑒𝑗⋅𝜙𝑘
For a real signal, the couple
of the harmonics 𝑘 and −𝑘correspond to a cosine
Since 𝑐0 is real:
𝑐0 = 𝜌0
Spectral componentsThe succession 𝑐𝑘 contains information on how much the signal varies in the period.
25Scandella Matteo - Dynamical System Identification course
The signal is varying slowly
Higher low
frequency
cosines
Spectral componentsThe succession 𝑐𝑘 contains information on how much the signal varies in the period.
26Scandella Matteo - Dynamical System Identification course
The signal is varying quickly
Higher high
frequency
cosines
Example: square wave
27Scandella Matteo - Dynamical System Identification course
𝑠𝑝 𝑥 =𝐴 0 ≤ 𝑡 <
𝑇02
−𝐴𝑇02≤ 𝑡 < 𝑇
𝑐𝑘 = ቐ0 If 𝑘 is even
−𝑗 ⋅2𝐴
𝜋𝑘If 𝑘 is odd
Example: triangle wave
28Scandella Matteo - Dynamical System Identification course
𝑠𝑝 𝑥 =2 ⋅ 𝐴
𝑇0⋅ 𝑡 𝑐𝑘 =
0 If 𝑘 ≠ 0 and it is even
−2𝐴
𝜋2𝑘2If 𝑘 is odd
𝑇0𝐴
2if 𝑘 = 0
Fourier transformGiven the non-periodical signal 𝑠 its Fourier transform is:
𝑆 𝑓 = ℱ 𝑠 𝑓 = න
−∞
+∞
𝑠 𝑡 ⋅ 𝑒−𝑗⋅2𝜋𝑓𝑡𝑑𝑡
The Fourier transform can be seen as a generalization of the Fourier series for non-periodical signal.
• Since 𝑇0 → ∞ and 𝑓0 → 0, the harmonics have an infinitesimal distance between them and therefore the coefficient succession 𝑐𝑘 becomes a function 𝑆 𝑓
• Since 𝑇0 → ∞ the integration over the period becomes the integration over the complete domain
29Scandella Matteo - Dynamical System Identification course
Fourier transform properties
30Scandella Matteo - Dynamical System Identification course
𝑠 is even 𝑠 𝑡 = 𝑠 −𝑡 𝑆 𝑓 = 𝑆 −𝑓 𝑆 is even
𝑠 is odd 𝑠 𝑡 = −𝑠 −𝑡 𝑆 𝑓 = −𝑆 −𝑓 𝑆 is odd
𝑠 𝑡 ∈ ℝ
𝑆 −𝑓 = 𝑆 𝑓 ∗
Re 𝑆 𝑓 is even
Im 𝑆 𝑓 is odd
Re 𝑆 −𝑓 = Re 𝑆 𝑓
Im 𝑆 −𝑓 = −Im 𝑆 𝑓
For us this property is always valid, we won’t look into
complex signals
𝑆 −𝑓 = 𝑆 𝑓
∠𝑆 −𝑓 = −∠𝑆 𝑓
𝑆 𝑓 is even
∠𝑆 𝑓 is odd
LinearityGiven two signal and their Fourier coefficient:
𝑠𝐴 𝑡 ⇆ 𝑆𝐴 𝑓𝑠𝐵 𝑡 ⇆ 𝑆𝐵 𝑓
the signal𝑠 𝑡 = 𝛼𝑠𝐴 𝑡 + 𝛽𝑠𝐵 𝑡
has coefficients:
ℱ 𝑠 𝑓 = න0
𝑇0
𝑠 𝑡 ⋅ 𝑒−𝑗⋅2𝜋𝑓𝑡𝑑𝑡
= න0
𝑇0
𝛼𝑠𝐴 𝑡 + 𝛽𝑠𝐵 𝑡 ⋅ 𝑒−𝑗⋅2𝜋𝑓𝑡𝑑𝑡
= 𝛼න0
𝑇0
𝑠𝐴 𝑡 ⋅ 𝑒−𝑗⋅2𝜋𝑓𝑡𝑑𝑡 + 𝛽න0
𝑇0
𝑠𝐵 𝑡 ⋅ 𝑒−𝑗⋅2𝜋𝑓𝑡𝑑𝑡
= 𝛼𝑆𝐴 𝑓 + 𝛽𝑆𝐵 𝑓
31Scandella Matteo - Dynamical System Identification course
Fourier anti-transformGiven a signal 𝑠 𝑡 and its transformation 𝑆 𝑓 =ℱ 𝑠 𝑓 we have:
𝑠 𝑡 = න
−∞
+∞
𝑆 𝑓 ⋅ 𝑒𝑗⋅2𝜋𝑓𝑡𝑑𝑓
32Scandella Matteo - Dynamical System Identification course
Given a signal 𝑠 𝑡 its Fourier transform is unique and it’s the only signal with such Fourier transform.
𝑠 𝑡 ⇄ 𝑆 𝑓
Spectra of a signal• The graph of the Fourier transform is called
spectra of the signal.
• The information contained in the spectra is similar to the one shown with Fourier coefficient for periodic signals.
• Since we are working with real signal we can show only the positive part of the spectra.
33Scandella Matteo - Dynamical System Identification course
Example: Dirac delta
34Scandella Matteo - Dynamical System Identification course
𝛿 𝑡 = ቊ∞, 𝑡 = 00, 𝑡 ≠ 0
න−∞
+∞
𝑓 𝑡 𝛿 𝑡 𝑑𝑡 = 𝑓 0
ℱ 𝛿 𝑓 = න
−∞
+∞
𝛿 𝑡 ⋅ 𝑒−𝑗⋅2𝜋𝑓𝑡𝑑𝑡
= 𝑒−𝑗⋅2𝜋𝑓0
= 1
Example: step
35Scandella Matteo - Dynamical System Identification course
ℱ 𝑠𝑡𝑒𝑝 𝑓 = න
−∞
+∞
𝑠𝑡𝑒𝑝 𝑡 ⋅ 𝑒−𝑗⋅2𝜋𝑓𝑡𝑑𝑡
= න
−∞
0
0𝑑𝑡 + න
0
+∞
𝑒−𝑗⋅2𝜋𝑓𝑡𝑑𝑡
=𝑒−𝑗⋅2𝜋𝑓𝑡
−𝑗 ⋅ 2𝜋𝑓0
+∞
= 0 −1
−𝑗 ⋅ 2𝜋𝑓=
1
𝑗 ⋅ 2𝜋𝑓
𝑠𝑡𝑒𝑝 𝑡 = ቊ1, 𝑡 ≥ 00, 𝑡 < 0
Periodic signal transformGiven a periodic signal 𝑠𝑝 𝑡 and its Fourier coefficient 𝑐𝑘, we have:
ℱ 𝑠𝑝 𝑓 =
𝑘=−∞
+∞
𝑐𝑘 ⋅ 𝛿 𝑓 − 𝑓0 ⋅ 𝑘
Therefore the Fourier transform of a periodic signal is a weighted sum of Dirac deltas.
36Scandella Matteo - Dynamical System Identification course
Example: Sine wave
37Scandella Matteo - Dynamical System Identification course
𝑠 𝑡 = 𝐴 ⋅ cos 2 ⋅ 𝜋 ⋅𝑡
𝑇0
𝑐𝑘 = ቐ
𝐴
2𝑘 = 1
0 𝑘 ≠ 1
ℱ 𝑠𝑝 𝑓 =
𝑘=−∞
+∞
𝑐𝑘 ⋅ 𝛿 𝑓 − 𝑓0 ⋅ 𝑘
=𝐴
2𝛿 𝑓 − 𝑓0 +
𝐴
2𝛿 𝑓 + 𝑓0
Band limited signalsA band limited signal is a signal 𝑠 𝑡 such that ∃𝑓𝑚𝑎𝑥 ∈ ℝ such that:
ℱ 𝑠𝑝 𝑓 = 0, ∀𝑓 > 𝑓𝑚𝑎𝑥
38Scandella Matteo - Dynamical System Identification course
Examples:
• The sine wave is a band limited signal
• The square wave is not a band limited signal