Unit 3 - Signals and Systems
Unit 3 - Signals and Systems
Fourier Series
1
Contents
• Transform
• Basis functions
• Orthogonality
• Dirichlet conditions for existence of FS
• Trigonometric Fourier series
• Exponential Fourier Series
• Symmetry Properties
• Amplitude and phase spectrum,
• Gibbs phenomenon.
2
Session Objectives
• Understand, and resolve the signals in
frequency domain using Fourier series
3
Session Outcomes
• Analyze and resolve the signals in
frequency domain using Fourier series
4
Recap of Unit 1 and 2
• Any Signal can be represented as a linear
combination of some basis signals.
5
What is a Transform and Why do We Need ?
Transform: A mathematical operation that takes a
function or sequence and maps it into another one
Why we need transform?
– To get additional /hidden information about the original
function, which may not be available /obvious otherwise
– The transform of an equation may be easier to solve than
the original equation
– The transform of a function/sequence may require less
storage, hence provide data compression / reduction
– An operation may be easier to apply on the transformed
function, rather than the original function (recall
convolution)
General Scheme using Transforms
Equation Solution
Problem Result
of the problem of the equation
Transformation
= HARD
Inverse
transformation
Transformed Solution of the
equation transformed equation
= EASY
Properties of Transforms
f Fi K i j Fi K ij f j (
i j
f (x) K (x, )F (
F ( )
10
What Transforms are Available?
Fourier series
1
F () f (t)e jt dt
Laplace transform
1
F (s) f (t)e dtst
n0 2 k 0
Z-transform
N 1
1 N 1
F[z] H.R.
f[n]e zn
f[n] F[z]e zn
n0
Pourreza 2 z0
Revision: Complex exponential Notation
• Euler’s formula eix cos(x) i sin( x)
Phasor notation:
x iy z ei
where z x 2
y 2
z z
( x iy )( x iy )
tan 1 y
and
x
12
Euler’s formula
• Taylor series expansions
x2 x3 x4
e x 1 x ...
2! 3! 4!
• Even function ( f(x) = f(-x) )
x2 x4 x6 x8
cos(x) 1 ...
2! 4! 6! 8!
• Odd function ( f(x) = -f(-x) )3
x x5 x7 x9
sin( x) x ...
3! 5! 7! 9!
x2 ix 3 x 4
ix 5 x 6
ix 7
eix 1 ix ...
2! 3! 4! 5! 6! 7!
cos(x) i sin( x)
13
Sine and cosine waveform
14
Standard values
21 January 2021 15
Orthogonal Functions
• Call a set of functions {k} orthogonal
on an interval a < t < b if it satisfies
0 m n
b
m (t ) n (t)dt
a
rn m n
16
Orthogonal set of Sinusoidal Functions
Define 0=2/T.
T/2 T /2
T /2
cos(m0t)dt 0, m 0
T /2
sin( m 0t)dt 0, m 0
T /2 0 m n
T /2 cos(m0t) cos(n0t)dt T / 2 m n We now prove this one
T /2 0
T /2
sin( m 0t) sin( nt
T /2
21 January
T /2 2021
sin( m 0 t) cos(n 0 t)dt 0, for all m and n 17
Proof
1
cos cos [cos( ) cos( )]
2
T /2
T /2
cos(m0t) cos(n 0t)dt mn
1 T /2 1 T /2
cos[(m n)0 t]dt cos[(m n)0t]dt
2 T /2 2 T /2
1 1 1 1
sin[( m n)0t]
T /2
2 (m n)
1 1 1 1
2sin[( m n)]
2 (m n)
0
0
0
21 January 2021 18
Proof
1
cos [1
2
T /2
T /2
cos(m0t) cos(n 0t)dt m=n
1 T /2
cos (m0t)dt T /2 [1 cos 2m0t]dt
T /2
2
T /2 2
T /2 T /2
1 1
t sin 2m 0t]
2 T /2 4m0 T /2
0
T /2 0 m n
T
T /2 cos(m0t) cos(n0t)dt T / 2 m n
2
19
Orthogonal set of Sinusoidal Functions
1,
cos0t,cos20t,cos30t,
sin t,sin 2t,sin 3t,
0 0 0
Define 0=2/T.
T /2 T /2
T /2
cos(m0t)dt 0, m 0
T /2
sin( m 0t)dt 0, m 0
T /2 0 m n
T /2 cos(m0t) cos(n0 t)dt T / 2 m n
T /2 0 m n
T /2 sin( m0t) sin( n0t)dt T / 2 m n
T /2
T / 2
sin( m 0 t) cos(n 0 t)dt 0, for all m and n 20
Continuous Discrete
Time Time
Periodic
Discrete Time
Continuous
Fourier
Aperiodic
Time Fourier
Transform
Transform (CTFT)
(DTFT)
21
The Fourier Series
Joseph Fourier
1768 to 1830
22
The Fourier Series
Fourier proposed in 1807
23
Periodic Functions
A function xt is periodic
if it is defined for all real
and if there is some positive number,
24
f f
0 0
T
T
f
0
25
How Does FT Work Anyway?
x( F X 2 ()
x3 (t) F X 3 ()
Dirichlet conditions for existence of FS
2. The integral
29
FS Synthesis equation
2nt 2nt
x(t) a 0 an cos bn sin
n1 T n1 T
Let 0=2/T.
x(t) ao an cos(n0t) bn sin( n0t)
30
n1 n1
FS Decomposition equation
1 t0 T
a0
T
t0
x(t)dt
2 t 0T
an
T t0
x(t) cos n 0tdt n 1,2,
2 t 0 T
bn
T t0
x(t) sinn 0tdt n 1,2,
31
P1: Find the Fourier series of the following periodic
function.
f
A
0
-A
f A when 0
A when 2
f 2 f
32
1 t0 T
a0
T
t0
x(t)dt
1 2
2 0
a0 f d
1
2
2
0
f d
f d
1 2
2
0
Ad
A d
0 33
2
f cos n d
1
an
0
1 2
Acos n d Acos n d
0
2
1 sinn 1 sinn
A A 0
n 0 n
34
2
f sinn d
1
bn
0
1 2
A sinn d Asinn d
0
2
1 cos n 1 cos n
A A
n 0 n
A
cos n cos 0 cos 2n cos n
n
35
bn
A
cos n cos 0 cos 2n c
n
A
1 1 1 1
n
4A
bn
A
cos n cos 0 cos 2n cos n
n
A
1 1 1 1
n
21 Janu 2021 when n is even
ary0 36
Therefore, the corresponding Fourier series is
x(t) ao an cos(n0t) bn sin( n0 t)
n1 n1
4 A 1 1 1
x(t) sin sin 3
How how many terms to consider?
37
When we consider 4 terms as shown in the
previous slide, the function looks like the
following.
1.5
0.5
f( ) 0
0.5
1.5
21 January 2021 38
When we consider 6 terms, the function looks
like the following.
1.5
0.5
f ( ) 0
0.5
1.5
39
When we consider 8 terms, the function looks
like the following.
1.5
0.5
f() 0
0.5
1.5
40
When we consider 12 terms, the function looks
like the following.
1.5
0.5
f( ) 0
0.5
1.5
41
The red curve was drawn with 12 terms and
the blue curve was drawn with 4 terms.
1.5
0.5
0.5
1.5
21 January 2021 42
The red curve was drawn with 12 terms and
the blue curve was drawn with 4 terms.
1.5
0.5
0.5
1.5
0 2 4 6 8 10
43
The red curve was drawn with 20 terms and
the blue curve was drawn with 4 terms.
1.5
0.5
0.5
1.5
0 2 4 6 8 10
21 January 2021 44
21 January 2021 45
Gibbs Phenomenon
1.5
0.5
0.5
1.5 0 2 4 6 8 10
21 January 2021 46
MATLAB Code for Synthesis of FS
4 A 1 1 1
s in s in 3 s in 5 s in 7
3 5 7
21 January 2021 47
% Square wave ****************
clc;
clear all;
)*
t=0:0.0001:0.1; 4A 1
n=1001; x(t) (
sum=0;
for i=1:2:n
y1=(1/i*sin(i*t));
sum=y1+sum;
end
y1=(4/pi)*sum;
plot(t,y1);title('n=1001');xlabel('Time');ylabel('Amplitude');
Mag1=abs(fft(y,2048));
for j=1:1024
f(j)=j*10000/(2*1024); %fs/2
end
plot(f,Mag1(1:1024)); xlabel('Frequency in Hz'); ylabel('Magnitude');
plot(angle(y));%xlabel('Frequency in Hz') ;ylabel(‘phase’)
%***********************************************
4 A 1 1 1
s in s in 3 s in 5 s in 7
21 January 2021
3 5 7 48
Fourier series: example 1
21 January 2021 49
Fourier series: example 2
21 January 2021 50
• Compare the plots of the partial sums with
the original function:
N 3
N 1
N 5 N 11
21 January 2021 51
P2: Find TFS of Square Wave
f(t)
1
2
a0 1dt 1/ 2
0
2 1
an cos ntdt sin nt 0
0 n 1,2,
2 0 n
2 1 1 2 / n n 1,3,5,
bn
2
0
sin ntdt
n
cos nt 0
n
(cos n 1)
0 n 2,4,6,
21 January 2021 52
1 2 1 1
f (t) sin t sin 3t sin 5t
2 3 5
f(t)
1
2
a0 1dt 1/ 2
0
2 1
an
2 0
cos ntdt
n
sin nt 0 0 n 1,2,
1 1 1 2 / n n 1,3,5,
bn
2 0
sin ntdt
n
cos nt 0
n
(cos n 1)
0 n 2,4,6,
21 January 2021 53
f(t)
1
2
11dt0a
02
1.5
1 1 2
,
21
,n
0s
n
i c
os ntdt nt
a 0.5
2
n 0 0n
b
/20
)1
-0.5
0
n 0n2 n0ncos(1
ncos
1
1
ntsin
ntdt n 1,3,5,
n 2,4,6,
21 January 2021 54
1 2 1 1
f (t) s i n t sin 3t sin 5 t
2 3 5
clc;
clear all;
t=0:0.0001:30;
f=2*pi;
x=sin(t);
%plot(t,x)
y= sin(t)+ 1/3*sin(3*t)+ 1/5*sin(5*t)+1/7*sin(7*t)+1/9*sin(9*t);
y=1/2+(2/pi)*y;
plot(t,y)
n=1000;
sum=0;
for i=1:2:n
z=1/i*sin(i*t);
sum=sum+z;
end
sum=1/2+(2/pi)*sum;
plot(t,sum);axis([0 30 0 1]);
21 January 2021 55
Symmetry Properties
Even Functions
xt xt
21 January 2021 56
Odd Functions
x t x t
21 January 2021 57
Even functions can solely be represented by cosine waves
because, cosine waves are even functions. A sum of even
functions is another even function.
5
10 0 10
21 January 2021 58
Odd functions can solely be represented by sine waves
because, sine waves are odd functions. A sum of odd
functions is another odd function.
10 0 10
21 January 2021 59
Properties – Symmetry
2 t 0T
an
T t0
x(t) cos n 0tdt n 1,2,
2 t 0 T
bn
T t0
x(t) sinn 0tdt n 1,2,
21 January 2021 60
Properties – Half Wave Symmetry
• If the function is half-wave symmetric, then only odd
harmonics exist
-
A
-1 1 2
21 January 2021 61
Properties – Discontinuities
• If the function has
– Discontinuities: the coefficients will be proportional to 1/n
– No discontinuities: the coefficients will be proportional to 1/n2
-1 1 2
A
-2 -1 0 1 2
21 January 2021 62
Example
P3: Without any calculations, predict the general form of
the Fourier series of:
-
A
-1 1 2
zero for
1 n even
an 2 2At cos(n t)dt
4A
1 cos(n )
0 n
2 2
8A
an ...n 1,3,5...
n
2 2
21 January 2021 64
• tring_p3
21 January 2021 65
Example
• Now compare your calculated answer with your
predicted form
21 January 2021 66
P 4. Find the Fourier series of the following
periodic function.
f(t)
3 T /4
0 t
T /4
- T /2 T /2 T 2T
f t t when
T
t
T
4 4
T T 3T
t w hen t
2 4 4
21 January 2021 67
f t T f t
2n
2
4
f t sin t dt
T 0 T
21 January 2021 68
T
4 4
2 n
b n
T t s i n
T
t d t
0
T
4
2
t T s i n 2 n
T 2 T
t d t
T
4
n
2
4 T
b 2 . s in
2 n
n
T 2
2 T n
s i n
n 2
2
2
bn 0 when n is even.
21 January 2021 69
Therefore, the Fourier series is
Tring_p4.m
2T 2 1 6 1 10
x(t) in
2 s t 2 sin t 2 sin t
T 3 T 5 T
21 January 2021 70
P5: Find the coefficients for the Fourier
series of:
t t 0
x(t )
t 0 t
x(t 2 ) x(t )
f (x)
Fundamental
range
x
0 2 4
Period = 2π
21 January 2021 71
• Find a0
T
2
1
x(t)dt
1
a0
T x(t)dt a0
2
T
2
1
x(t)dt
a0 1
2
a0
x(t)dt
0
1 1 t 2
a0 tdt a0
2 0
a0
0 2
21 January 2021 72
• Find an
T
2
1 2nt
2
an
T
x(t) c an
x(t) cos
2
dt
2
x(t) cosntdt t cosntdt
1
an an
0
21 January 2021 73
• Find bn
T
2 2
1 2nt
bn
T
x(t)s bn
x(t)sin
2
dt
21 January 2021 74
tring_p5.m
2 n1 n 2
x(t)
4 cost 0 4 cos3t
2 9
21 January 2021 75
The Complex Form of Fourier Series
j j
e e j
e
cos sin
2
21 January 2021 76
Complex Form of the Fourier Series
c0 ao
x(t)
n
cne jn 0t
1
cn (an jb n)
T/ 2
2
1
cn x(t)e dt
jn0t 1
cn (an jb n)
T T/2 2
cn | cn | e j n , cn c n* | cn | e j n
If x(t) is real,
1 a2
c c n bn
2
* | cn || cn |
2 n 1,2,3,
n n
b
n tan 1 n c0 a 0
21 January 2021
an 77
Perceval's Relationship
]
x(t) cne j n 0t
x *(t) c * n e jn0t
n n
21 January 2021 78
21 January 2021 79
Complex Frequency Spectra
cn | cn | e j n , cn c n* | c n | e j n bn
n tan 1 n 1,2
1 an
| cn || cn |
c0 a 0
|cn| amplitude
spectrum
phase
n
spectrum
21 January 2021 80
P6: Exponential FS
x(t)
A
t
T
T T
2 2 2
2
A /2 A 1
cn e jn0tdt (2 j sin n0 /2)
T / 2 T jn 0
/2 A 1
A 1 sin n 0 / 2
e jn0t T 2n 0
1
T jn 0
sin n
/ 2
A T
A 1 jn0 /2 1 jn0 / 2
e e T n
T jn0
21 January 202 1
jn0
T 81
A/5
sin n ,
1 T 1,
1
A T
cn 20 4 T 5
T n 2
0 8
T T
21 January 2021 82
A/10
sin n
1 1
1 , T ,
A T 20 2 T 5
cn
T n
0 2 4
T T
21 January 2021 83
Summary
1 t0 T
a0
T t0
x(t)dt
2 t 0T
an
T t0
x(t) cos n 0tdt n 1,2,
2 t 0 T
bn
T t0
x(t) sinn 0tdt n 1,2,
21 January 2021 84
Exponential Fourier Series
c0 ao
x(t)
n
cne jn 0t
1
cn (an jb n)
T/ 2
2
1
cn x(t)e dt
jn0t 1
cn (an jb n)
T T/2 2
cn | cn | e j n , cn c n* | cn | e j n
If x(t) is real,
1 a2
c c n bn
2
* | cn || cn |
2 n 1,2,3,
n n
b
n tan 1 n c0 a 0
21 January 2021
an 85
Perceval's Relationship
21 January 2021 86
FT Shortcomings
amplitude
Time f 3f 5f 7f
frequency
Application of Fourier Transform for Music Signal
Example: Timbre
Timbre, also known as sound quality or tone color, is oddly
defined in terms of what it is not:
When two sounds are heard that match for pitch, loudness, and duration,
and a difference can still be heard between the two sounds, that
difference is called timbre.
There are two physical correlates of timbre:
Spectrum envelope
Amplitude envelope
89
Six Synthesized Sounds Differing in Spectrum Envelope
Note the similarities in pitch (due to constant F0/harmonic spacing) and the
differences in timbre or sound quality.
Same melody, same spectrum envelope (if sustained), different
amplitude envelopes (i.e., different attack and decay characteristics).
Note differences in timbre or sound quality as the amplitude envelope
varies.
I
Timbre and Spectrum Envelope
• Miniprojects
• Create: Simulate different musical instruments: Guitar, Piano, Trumpet ……
• Analysis: Find Frequencies of male/Female/Children frequency
• Analysis/Justify: Analysis of voice Signals
• ( Why Females are preferred as anchoring?)
• Analysis of animal Voice
• Simulation of different Human and Animal Voice
• Extract Some features to distinguish voice (Animal/Human)
• Justify
• Compute
• Evaluate
• Show that
Activities for advanced Learners
21 January 2021 98
Thanks
99