You are on page 1of 81

Periodic Functions and

Fourier Series
Periodic Functions
A function f   is periodic
if it is defined for all real 
and if there is some positive number,

T such that f   T   f   .
f  

0

T
f  

0

T
f  

0

T
Fourier Series
f   be a periodic function with period 2
The function can be represented by
a trigonometric series as:
 
f    a0   a n cos n   bn sin n
n 1 n 1
 
f    a0   a n cos n   bn sin n
n 1 n 1

What kind of trigonometric (series) functions


are we talking about?

cos  , cos 2 , cos 3  and


sin  , sin 2 , sin 3 
0

0  2

cos q cos 2q cos 3q


0

0  2

sin q sin 2q sin 3q


We want to determine the coefficients,

an and bn .

Let us first remember some useful


integrations.

  cos n cos m d

1  1 
  cos n  m  d   cos n  m  d
2  2 


cos n cos m d  0 nm


cos n cos m d   nm

  sin n cos m d

1  1 
  sinn  m  d   sinn  m  d
2  2 


sin n cos m d  0

for all values of m.



  sin n sin m d

1  1 
  cos n  m  d   cos n  m  d
2  2 

 sin n sin m d  0 nm




 sin n sin m d   nm



Determine a0
Integrate both sides of (1) from
 to 

  f  d

  

   a0   an cos n   bn sin n  d

 n 1 n 1 

  f  d

   

  a0d     an cos n  d
 
 n 1 
  

    bn sin n  d

 n 1 
 
  f  d    a d  0  0
 
0



f  d  2a0  0  0


1
a0 
2 
f  d

a0 is the average (dc) value of the


function, f   .
You may integrate both sides of (1) from

0 to 2 instead.
2
 f  d
0

2   

  a0   an cos n   bn sin n  d
0
 n 1 n 1 

It is alright as long as the integration is


performed over one period.
2
 f  d
0

2 2  

  a0d     an cos n  d
0 0
 n 1 
2  

   bn sin n  d
0
 n 1 
2 2
 f  d   a0 d  0  0
0 0
2
 f  d  2a0  0  0
0

1 2
a0   f  d
2 0
Determine an
Multiply (1) by cos m
and then Integrate both sides from
 to 

  f  cos m d

  

   a0   an cos n   bn sin n  cos m d

 n 1 n 1 
Let us do the integration on the right-hand-side
one term at a time.

First term,


a0 cos m  d  0
Second term,
 

   n 1
a n cos n cos m  d
Second term,
 

  a

n 1
n cos n cos m d  am

Third term,

 



 b
n 1
n sin n cos m  d  0
Therefore,

 f  cos m d  am

1 
am   f  cos m d m  1, 2, 
  
Determine bn
Multiply (1) by sin m 
and then Integrate both sides from
 to 

  f   sin m d

  

  a0   a n cos n   bn sin n  sin m  d

 n 1 n 1 
Let us do the integration on the right-hand-side
one term at a time.

First term,



a 0 sin m  d  0
Second term,

 

  a

n 1
n cos n sin m  d
Second term,

 

  a

n 1
n cos n sin m  d  0

Third term,

 



 b
n 1
n sin n sin m d  bm
Therefore,

 f   sin m d  bm

1 
bm   f   sin m d m  1 , 2 ,
  
The coefficients are:

1
a0 
2  f  d


1 
am   f  cos m d m  1, 2, 
  

1 
bm   f  sin m d m  1, 2, 
  
We can write n in place of m:

1
a0 
2 

f  d
1 
an   f  cos n d n  1 , 2 ,
  

1 
bn   f   sin n d n  1 , 2 ,
  
The integrations can be performed from

0 to 2 instead.

1 2
a0   f  d
2 0

1 2
f  cos n d

an  n  1 , 2 ,
0

1 2
bn   f   sin n d n  1 , 2 ,
 0
Example 1. Find the Fourier series of
the following periodic function.
f  
A

0

-A
p 2p 3p 4p 5p

f    A when 0    
  A when     2
f   2   f  
1 2
a0   f   d 
2 0
1   2


  f   d    f   d  
2  0 

1   2


2 
  0
A d   
 A d  
0
1 2
an   f  cos n d
 0

1  2


  A cos n  d    A  cos n  d  
  0 
 2
1  sin n  1 sin n 
 A    A  0
 n 0   n 
1 2
f   sin n d

bn 
0

1  2

 
  0 
 A sin n  d   A sin n  d  
 2
1 cos n  1  cos n 
  A  A
 n  0   n  
A
  cos n  cos 0  cos 2n  cos n 
n
A
bn   cos n  cos 0  cos 2n  cos n 
n
A
 1  1  1  1
n
4A
 when n is odd
n
A
bn   cos n  cos 0  cos 2n  cos n 
n
A
  1  1  1  1
n
 0 when n is even
Therefore, the corresponding Fourier series is

4A  1 1 1 
 sin  sin 3  sin 5  sin 7  
  3 5 7 

In writing the Fourier series we may not be


able to consider infinite number of terms for
practical reasons. The question therefore, is
– how many terms to consider?
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


When we consider 6 terms, the function looks
like the following.
1.5

0.5

f() 0

0.5

1.5


When we consider 8 terms, the function looks
like the following.
1.5

0.5

f ( ) 0

0.5

1.5


When we consider 12 terms, the function looks
like the following.
1.5

0.5

f() 0

0.5

1.5


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


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

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

Even and Odd Functions
(We are not talking about even or
odd numbers.)
Even Functions The value of the
function would
f(q) be the same
when we walk
equal distances
along the X-axis
q
in opposite
directions.

Mathematically speaking -
f     f  
Odd Functions The value of the
f(q) function would
change its sign
but with the
same magnitude
q
when we walk
equal distances
along the X-axis
in opposite
directions.
Mathematically speaking -
f      f  
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

5
10 0 10


Odd functions can solely be represented by
sine waves because, sine waves are odd
functions. A sum of odd functions is another
odd function.
5

10 0 10


The Fourier series of an even function f  
is expressed in terms of a cosine series.

f    a0   a n cos n
n 1

The Fourier series of an odd function f  


is expressed in terms of a sine series.

f     bn sin n
n 1
Example 2. Find the Fourier series of
the following periodic function.
f(x)

x
-p 0 p 3p 5p 7p 9p

f x   x 2
when    x  
f   2   f  
1  1 
a0   f x dx  
2
x dx
2  2 
x 
1 x  3
 2
 3 
2   x   3
1 
an   f x cos nx dx
  

1  2 

 
  
x cos nxdx

Use integration by parts. Details are shown
in your class note.
4
an  2 cos n
n
4
an   2 when n is odd
n

4
an  2 when n is even
n
This is an even function.
Therefore, bn  0
The corresponding Fourier series is

 2
 cos 2 x cos 3 x cos 4 x 
 4 cos x  2
 2
 2
 
3  2 3 4 
Functions Having Arbitrary Period

Assume that a function f t  has


period, T . We can relate angle
(  ) with time ( t ) in the following
manner.
  t
 is the angular velocity in radians per
second.
  2 f
f is the frequency of the periodic function,

f t 
1
  2 f t where f 
T
2
Therefore,  t
T
2 2
 t d  dt
T T
Now change the limits of integration.

2 T
     t t
T 2
2 T
   t t
T 2

1
a0 
2  
f  d

T
2
1
a0   f t dt
T T

2
1 
an   f  cos n d n  1 , 2 ,
  

 2 n 
2
2
an 
T  Tf t cos T t dt n  1, 2, 

2
1 
bn   f   sin n d n  1 , 2 ,
  

 2 n 
2
2
bn 
T  Tf t sin T t dt n  1, 2, 

2
Example 4. Find the Fourier series of
the following periodic function.
f(t)

3T/4

0 t
T/4

-T/2 T/2 T 2T

T T
f t   t when   t 
4 4
T T 3T
 t  when t
2 4 4
f t  T   f t 
This is an odd function. Therefore, an  0
 2n 
T
2
bn   f t sin t  dt
T 0  T 
T

 2n 
2
4
  f t sin t  dt
T 0  T 
T

 2n 
4
4
bn 
T  T 
t sin t  dt
0
T
2
4  T   2n 

T T 
  t   sin
2  T 
t  dt
4

Use integration by parts.


  T 
4
2
 n 
bn   2.  sin 
  2n 
T  2  
2T  n 
 2 2 sin 
n  2 

bn  0 when n is even.
Therefore, the Fourier series is

2T   2  1  6  1  10  
 sin  T t   2 sin  T t   2 sin  T t   
 2
   3   5   
The Complex Form of Fourier Series
 
f    a0   a n cos n   bn sin n
n 1 n 1
Let us utilize the Euler formulae.
j  j
e e
cos  
2
j  j
e e
sin  
2i
The n th harmonic component of (1) can be
expressed as:

an cos n  bn sin n
jn  jn jn  jn
e e e e
 an  bn
2 2i
jn  jn jn  jn
e e e e
 an  ibn
2 2
an cos n  bn sin n
 an  jbn  jn  an  jbn   jn
 e   e
 2   2 
Denoting

 a n  jb n   a n  jb n 
c n    , cn  
 2   2 
and c0  a0
a n cos n  bn sin n
jn  jn
 cne  c n e
The Fourier series for f  
can be expressed as:

 

f    c0   cne jn
 c ne  jn

n 1

 c e
n 
n
jn
The coefficients can be evaluated in
the following manner.
 an  jbn 
cn   
 2 
1  j 
  f  cos nd    f  sin n d
2  2 

1 
  f  cos n  j sin n d
2 

1 
  f  e  jn
d
2 
 an  jbn 
c n   
 2 
1  j 
  f  cos nd    f  sin n d
2  2 

1 

2   f  cos n  j sin n d

1 
  f  e
jn
 d
2 
 an  jbn   an  jbn 
cn    c n  
 2   2 
Note that cn is the complex conjugate of
cn . Hence we may write that

1
 f  e  jn
cn  d
2 
.

n  0 ,  1,  2 , 
The complex form of the Fourier series of
f   with period 2 is:


f    c e n
jn

n  
Example 1. Find the Fourier series of
the following periodic function.
f  
A

0

-A
p 2p 3p 4p 5p

f    A when 0    
  A when     2
f   2   f  
A  5

f ( x)  A if 0  x  
A if   x  2 
0 otherwise

2
1 
A0   f ( x) dx
2 0

A0  0
n  1  8

2
1 
An   f ( x) cos ( nx) dx
 0

A1  0 A2  0 A3  0 A4  0
A5  0 A6  0 A7  0 A8  0
2
1 
Bn   f ( x) sin( nx) dx
 0

B1  6.366 B2  0 B3  2.122 B4  0

B5  1.273 B6  0 B7  0.909 B8  0
 
1
f    c e     jn
jn cn  f  e d
n
2 
n  

n  0,  1,  2,

2
1   1i n  x
C ( n)   f ( x) e dx
2  0
2
1   1i n  x
C ( n)   f ( x) e dx
2  0

C ( 0)  0 C ( 1)  3.183i C ( 2)  0 C ( 3)  1.061i

C ( 4)  0 C ( 5)  0.637i C ( 6)  0 C ( 7)  0.455i

C ( 1)  3.183i C ( 2)  0 C ( 3)  1.061i


C ( 4)  0 C ( 5)  0.637i C ( 6)  0 C ( 7)  0.455i

You might also like