Вы находитесь на странице: 1из 59

PWQL420M

POWER QUALITY

ADEL ELGAMMAL
ASSOCIATE PROFESSOR

ADEL ELGAMMAL
THE UNIVERSITY OF TRINIDAD AND TOBAGO UTT

CHAPTER 6
FOURIER ANALYSIS

ADEL ELGAMMAL
THE UNIVERSITY OF TRINIDAD AND TOBAGO UTT

1
Joseph Fourier

Fourier was
obsessed with the
physics of heat and
developed the
Fourier series and
transform to model
heat-flow problems.

Joseph Fourier 1768 - 1830

What do we hope to achieve with the Fourier 
Transform?
We desire a measure of the frequencies present in a wave.  This will
lead to a definition of the term, the spectrum.
Light electric field

Plane waves have only


one frequency, .

Time

This light wave has many


frequencies. And the
frequency increases in
time (from red to blue).

It will be nice if our measure also tells us when each frequency occurs.

2
Anharmonic waves are sums of sinusoids.
Consider the sum of two sine waves (i.e., harmonic 
waves) of different frequencies:

The resulting wave is periodic, but not harmonic.


Essentially all waves are anharmonic.

Fourier 
decomposing 
functions sin(t)

sin(3t)
Here, we write a
square wave as 
a sum of sine 
waves.

sin(5t)

3
Fourier Series
Fourier Series
Periodic Functions

Periodic functions
• A periodic function has a basic shape
which is repeated over and over again.
• The fundamental range is the time (or
sometimes distance) over which the basic
shape is defined.
• The length of the fundamental range is
called the period.

4
Example – Periodic functions
1  1  x  0
f ( x)  
2 0  x  1
f ( x  2)  f ( x )
fundamental range

period = 2

Periodic functions
• We can express a general periodic function as: 

T T
f ( x)   x 
2 2
f ( x  T )  f ( x)
where T is the period.

5
The Mathematic Formulation

• Any function that satisfies

f (t )  f (t  T )
where T is a constant and is called the period of the
function.

Example:
t t
(t )  cos  cos
f (t Find its period
Find its period.
3 4
t t 1 1
f (t )  f (t  T ) cos  cos  cos (t  T )  cos (t  T )
3 4 3 4

Fact: cos   cos(  2m)


T
 2m T  6 m
3 T  24 smallest T
T
 2n T  8n
4

6
Example:
f (t )  cos 1t  cos 2t Find its period.

f (t )  f (t  T ) cos 1t  cos 2t  cos 1 (t  T )  cos 2 (t  T )

1T  2m 1 m 1 must be a



2 n 2 rational number
2T  2n

A rational number is a number that can be in the form p/q


where p and q are integers and q is not equal to zero.

Examples:
p q p / q =
1 1 1/1 1
1 2 1/2 0.5
55 100 55/100 0.55

1 1000 1/1000 0.001

253 10 253/10 25.3


No! "q" can't be 
7 0 7/0
zero!

7
Here are some more examples:

Number As a Fraction Rational?


5 5/1 Yes
1.75 7/4 Yes
.001 1/1000 Yes
0.111... 1/9 Yes
√2  ? NO !
(square root of 2)

Example:

f (t )  cos10t  cos(10  )t


Is this function a periodic one?

1 10 not a rational

2 10   number

8
Fourier Series

Fourier Series

Introduction
• Decompose a periodic input signal into 
primitive periodic components.
primitive periodic components.

A periodic sequence
f(t)

t
T 2T 3T

9
Synthesis
a0  2nt  2nt
f (t )    an cos   bn sin
2 n 1 T n 1 T
DC Part Even Part Odd Part

T is a period of all the above signals

Let 0=2/T.
2/T.
a0  
f (t )    an cos(n0t )   bn sin( n0t )
2 n 1 n 1

Harmonics
2
D fi
Define 0  2f 0  , called
ll d the
th fundamental
f d t l angular
l frequency.
f
T
Define n  n0 , called the n-th harmonic of the periodic function.

a0  
f (t )    an cos n0t   bn sin n0t
2 n 1 n 1

a0  
f (t )    an cos n t   bn sin n t
2 n 1 n 1

10
Fourier coefficients
• One of the most important things about the
F i
Fourier series
i i that
is th t even though
th h we are
representing f (x) with an infinite series, with an
infinite number of coefficients, we can calculate
the coefficients an, bn one by one.

Orthogonal Functions

• Call a set of functions {k} orthogonal on an 


interval a < t < b if it satisfies

b 0 mn
a m (t )n (t )dt  rn mn

11
Orthogonal set of Sinusoidal Functions

Define 0=2/T.
T /2 T /2
T / 2
cos( m0t )dt  0, m0 
T / 2
sin( m0t )dt  0, m0

T /2  0 mn
T / 2 cos( m  0 t ) cos( n  0 t )dt  
T / 2 m  n
We now prove this one

T /2  0 mn
T / 2
sin( m0t ) sin( n0t )dt  
T / 2 m  n
T /2
T / 2
sin( m0t ) cos( n0t )dt  0, for all m and n

Proof
1
cos  cos   [cos(  )  cos(  )]
2


T /2

T / 2
cos( m0t ) cos(n0t )dt mn
1 T /2 1 T /2
2 T / 2 2 T / 2
 cos[( m  n )  0 t ]dt  cos[( m  n)0t ]dt

1 1 1 1
 [( m  n)0t ] T / 2  [( m  n)0t ] T / 2
T /2 T /2
sin[( sin[(
2 ( m  n ) 0 2 ( m  n ) 0
1 1 1 1
 2 sin[( m  n) ]  2 sin[( m  n) ]
2 ( m  n ) 0 2 ( m  n ) 0

0 0 0

12
Proof
1 1
cos  cos   [cos(  )  cos(  )] cos 2   [1  cos 2]
2 2
T /2
 T / 2
cos( m0t ) cos( n0t )dt m=n
1 T /2
2 T / 2
T /2
 cos 2 (m0t )dt  [1  cos 2m0t ]dt
T / 2
T /2 T /2
1 1
 t  sin 2m0t ]
2 T / 2 4m0 T / 2

0
T
 T /2  0 mn
2 T / 2
cos( m0t ) cos( n0t )dt  
T / 2 m  n

Orthogonal set of Sinusoidal Functions

Define 0=2/T.
T /2 T /2
T / 2
cos( m0t )dt  0, m0 
T / 2
sin( m0t )dt  0, m0

T /2  0 mn
T / 2 cos( m  0 t ) cos( n  0 t )dt  
T / 2 m  n
T /2  0 mn

T / 2
sin( m0t ) sin( n0t )dt  
T / 2 m  n
T /2

T / 2
sin( m0t ) cos( n0t )dt  0, for all m and n

13
1, 
 
cos 0t , cos 20t , cos 30t , 
sin  t , sin 2 t , sin 3 t ,  
 0 0 0 

an orthogonal
g set.

Decomposition

a0  
f (t )    an cos(n0t )   bn sin( n0t )
2 n 1 n 1

2 t 0 T
T t0
a0  f (t )dt

2 t0 T
T t0
an  f (t ) cos n0tdt n  1,2,

2 t 0 T
T t0
bn  f (t ) sin n0tdt n  1,2,

14
Example (Square Wave)
f(t)
1

-6 -5 -4 -3 -2 -  2 3 4 5

2 
Define 0=2/T =1
2 0
a0  1dt  1
2 T = 2
2
2  1 
an 
2 0
cos ntdt 
n
sin nt 0  0 n  1,2, 

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,

1 2 1 1 
f (t )    sin t  sin 3t  sin 5t  
2  3 5 
f(t)
1

-6 -5 -4 -3 -2 -  2 3 4 5

1.5

0.5

-0.5

15
Fourier Coefficients of 
S
Symmetrical Waveforms
t i lW f

Easy ways of finding 
F i
Fourier coefficients
ffi i

Easy ways of finding Fourier 
coefficients
• There are some easy shortcuts for finding the Fourier 
coefficients.
coefficients
• We can see that:
T
2
2
a0 
T  f ( x)dx
T

2

is just the area under the fundamental


range divided by the period.

16
Easy ways of finding Fourier 
coefficients
• Example ‐ Using the formula:
1  1  x  0
f ( x)  
2 0  x  1
f ( x  2)  f ( x )  T  2
T
2 1
2 2
 2 1
a0  f ( x)dx  a0  f ( x)dx
T T

2

0 1
2 2
 a0   1dx   2dx  a0  1  2  3
2
2 1 20 2

Easy ways of finding Fourier 
coefficients
• Example – Using the area under the 
fundamental range:
fundamental range:
So if the periodic function
has a simple shape we can
Period = 2
use geometry to find a0

Fundamental
range

a0 area a 1  2 a0 3
   0   
2 period 2 2 2 2

17
Fourier Coefficients of 
Symmetrical Waveforms
• The use of symmetry properties simplifies the 
calculation of Fourier coefficients.
l l ti fF i ffi i t
– Even Functions
– Odd Functions
– Half‐Wave
– Even Quarter
Even Quarter‐Wave
Wave
– Odd Quarter‐Wave
– Hidden

Waveform Symmetry
• Even Functions are defined by the property:

f (t )  f (t )

• Odd Functions are defined by the property:

f (t )   f (t )

18
Decomposition
• Any function f(t) can be expressed as the sum of 
an even function fe(t) and an odd function f
an even function f and an odd function fo(t).
(t)

f (t )  f e (t )  f o (t )
f e (t )  12 [ f (t )  f (t )] Even Part

f o (t )  12 [ f (t )  f (t )] Odd Part

Example

e  t t 0
f (t )  
0 t0

 12 e  t Even Part
t 0
f e (t )   1 t
 2e t0

 12 e  t Odd Part
t 0
f o (t )   1 t
 2 e t0

19
Odd and Even Functions
Even Function : f - t   f t 
Odd Function : f - t   f t 

Even Odd

Odd and even functions ‐ revision
• If f (x) is even:
a a

 f ( x)dx
a
 2  f ( x)dx
0

a a

 f ( x)dx  f ( x)dx
0
a

-a a

20
Odd and even functions ‐ revision
• If f (x) is odd:
a

 f ( x)dx  0
a

 f ( x)dx
a

-a a

Odd and even functions ‐ revision
• If f (x) is even and g(x) is odd then:
– h(x) = f (x) x f (x) is even (even x even =
even)
– h(x) = g(x) x g(x) is even (odd x odd = even)
– h(x) = f (x) x g(x) is odd (even x odd =
odd)

21
Easy ways of finding Fourier 
coefficients
We can also use the properties of even and odd functions to
make
k finding
fi di the
h Fourier
F i coefficients
ffi i easier.
i
• Consider the formula for Fourier series:

a0 n     2nx   2nx  
f ( x)     an cos   bn sin   
2 n 1   T   T 

Since all the sines are odd functions and all the cosines are even
functions, we can break the function and the Fourier series into two
parts:
f ( x)  f odd ( x)  f even ( x)

Easy ways of finding Fourier 
coefficients
• We can compare with the Fourier series to get:

n 
  2nx  
f odd ( x)    bn sin   
n 1   T 
a0 n    2nx  
f even ( x)     an cos  
2 n 1   T 
Thus if f (x) is odd:
Thus,
f even ( x)  0  a0  0  a n
And, if f (x) is even:
f odd ( x)  0  bn  0

22
Easy ways of finding Fourier 
coefficients
• We can also see these results from our formulae for the 
coefficients:
T

 2nx 
2
2
an 
T T
f ( x ) cos 
 T 
 dx

2

If f (x) is odd then we are integrating an odd function (odd x even


= odd).
As we saw earlier, integrating an odd function over the interval (-
a, a) is zero for any value of a.
i.e.
f ( x ) odd  a 0  0  a n

Easy ways of finding Fourier 
coefficients
• Similarly, for:
T

 2nx 
2
2
bn 
T  f ( x) sin
T T 
dx

2

If f (x) is even then we are integrating an odd function (even x odd =


odd).
So:
f (x) even  bn  0

23
Fourier Coefficients of Even Functions

f (t )  f (t )

a0 
f (t )    an cos n0t
2 n 1
4 T /2
an 
T 0
f (t ) cos( n0t )dt

Fourier Coefficients of Odd Functions

f (t )   f (t )

f (t )   bn sin
i n 0 t
n 1

4 T /2
bn   f (t ) sin( n0t )dt
T 0

24
Odd and Even Functions
Even Function : f - t   f t 
Odd Function : f - t   f t 

Even Odd

 2T
 a n   f t  cosnt dt for n  0,1, 2, 3, ....
 T0
If f t  is even then 
 bn  0



a 0
If f x  is odd then  n T
 b  b  2 f t  sinnt dt for n  1, 2, 3, ....

n n 
T0

Summary of finding coefficients
function function function
even odd neither
T T
2 2
2 2
a0   f ( x)dx a0   f ( x)dx
a0 T

Though maybe easy to find



T
2 0 T

Though maybe easy to find



T
2

using geometry using geometry

T T

 2nx   2nx 
2 2
2 2
an an 
T  f ( x) cos

T
2
T 
dx
0 an 
T  f ( x) cos

T
2
T 
dx

T T

 2nx   2nx 
2 2
bn 0 bn 
2
T  f ( x) sin T 
dx bn 
2
T  f ( x) sin
T T 
dx
T
 
2 2

25
Example – Fourier series
• Example – Find the coefficients for the Fourier 
series of:
i f
 x    x  0
f ( x)  
 x 0 x 
f ( x  2 )  f ( x)
f ( x)

 Fundamental
range

Period = 2π
x
0 2 4

Example – Fourier series
• Find a0
T
2 
2 2
a0 
T  T
f ( x)dx  a0 
2 
 f ( x)dx

2

f (x) is an even function so:

 
2 2
a0 
2 

f ( x)dx  a0 
  f ( x)dx
0

 
2 2  x2 
 a0   xdx  a0     a0  
 0   2 0

26
Example – Fourier series
• Find an Define 0=2/T =1
T = 2
T

 2nx   2nx 
2
2 1
an 
T  f ( x) cos
T T 
dx  an 
  f ( x) cos

2 
dx

2

Since both functions are even their product is


even:
 

 f ( x) cosnx dx  x cosnx dx


1 2
an   an 
 
 0

Example – Fourier series
• Now we will have to use integration by parts.
b b
dx  uv a   v dx
dv du
u
b

a
dx a
dx
du
u x 1
dx
sin nx 
 cosnx   v 
dv
dx n
Substituting:
2   x sin nx  sin nx  
  
x cosnx dx
2

an   an     dx
0    n  0 0 n 

 cosnx   2  cosn   1 

2 
 an  0  an   
   n  0 
2
 n2 

 an  2  1  1
2
n
n
 

27
Example – Fourier series
• Find bn
T

 2nx   2nx 
2
2 1
bn 
T  f ( x) sin
T T 
dx  bn 
  f ( x) sin

2 
dx

2

Since sine is an odd function and f (x) is an even


function, the product of the functions is odd:

 f ( x) sin nx dx


1
bn   bn  0
 

Example – Fourier series
• So we can put the coefficients back 
into the Fourier series formula:
into the Fourier series formula:

a0 n     2nx   2nx  
f ( x)     an cos   bn sin   
2 n 1   T   T 

 
n 
 2 
 f ( x)     2  1  1 cosnx 
n

2 n 1  n 

cos x   0  cos3x   
4 4
 f ( x)  
2  9

28
Half‐Wave Symmetry

f (t )  f (t  T ) and f (t )   f t  T / 2 

T/2 T/2 T

Fourier Coefficients for Half‐Wave Symmetry

f (t )  f (t  T ) and f (t )   f t  T / 2 

T/2 T/2 T

The Fourier series contains only odd harmonics.

29
Fourier Coefficients for Half‐Wave Symmetry

f (t )  f (t  T ) and f (t )   f t  T / 2 

f (t )   (an cos n0t  bn sin n0t )
n 1

0 for n even


an   4 T / 2
T 0 f (t ) cos(n0t )dt for n odd

0 for n even


bn   4 T / 2
T 0 f (t ) sin( n0t )dt for n odd

Quarter‐Wave Symmetry
If a signal has the following properties, it is said to
quarter‐wave symmetric:
• It is half‐wave
half wave symmetric.
symmetric
• It has symmetry (odd or even) about the quarter‐period
point (i.e. at a distance of L/2 from an end or the
centre).

30
Quarter‐Wave Symmetry
Even Quarter-Wave Symmetry

T/2 T/2 T

Odd Quarter-Wave Symmetry

T/2 T/2
T

Fourier Coefficients for
Even Quarter‐Wave Symmetry

T/2 T/2 T


f (t )   a2 n 1 cos[(
[( 2n  1)0t ]
n 1

8 T /4
a2 n 1 
T 0
f (t ) cos[(2n  1)0t ]dt

31
Fourier Coefficients for
Odd Quarter‐Wave Symmetry

T/2 T/2
T


f (t )   b2 n 1 sin[(
i [( 2n  1)0t ]
n 1

8 T /4
b2 n 1 
T  0
f (t ) sin[( 2n  1)0t ]dt

Hidden Symmetry

• An asymmetry periodic function:
A

T T

 Adding a constant to get symmetry property.


A/2

T T
A/2

32
Example
Even Quarter-Wave Symmetry
1
T/2 T/2
T T/4 T/4 T
1

8 T /4 8 T /4
a2 n 1 
T 
0
f (t ) cos[(2n  1)0t ]dt 
T 
0
cos[(2n  1)0t ]dt

T /4
8 4
 sin[( 2n  1)0t ]  (1) n 1
(2n  1)0T 0
(2n  1)

4 1 1 
f (t )   cos 0t  cos 30t  cos 50t  
 Example
3 5 

Even Quarter-Wave Symmetry


1
T/2 T/2
T T/4 T/4 T
1

8 T /4 8 T /4
a2 n 1 
T 
0
f (t ) cos[(2n  1)0t ]dt 
T 
0
cos[(2n  1)0t ]dt

T /4
8 4
 sin[( 2n  1)0t ]  (1) n 1
(2n  1)0T 0
(2n  1)

33
Example
Odd Quarter-Wave Symmetry
1
T/2 T/2
T T/4 T/4 T
1

8 T /4 8 T /4
b2 n 1 
T 
0
f (t ) sin[( 2n  1)0t ]dt 
T 
0
sin[( 2n  1)0t ]dt

T /4
8 4
 cos[(2n  1)0t ] 
(2n  1)0T 0
(2n  1)

4 1 1 
f (t )   sin 0t  sin 30t  sin 50t  
 Example
3 5 

Odd Quarter-Wave Symmetry


1
T/2 T/2
T T/4 T/4 T
1

8 T /4 8 T /4
b2 n 1 
T 
0
f (t ) sin[( 2n  1)0t ]dt 
T 
0
sin[( 2n  1)0t ]dt

T /4
8 4
 cos[(2n  1)0t ] 
(2n  1)0T 0
(2n  1)

34
Fourier Series of Square Wave

T 4

 f t sin k t dt ,
8
bk  0 for k odd
T 0

 t
f t  
4 1

 k sin 2k T 
n 1

Triangle Wave
 4  cos x cos 3x cos 5 x 
  2    
2  1 3 2
5 2

yes no
Even symmetry
Odd symmetry
Half-wave symmetry
Quarter-wave symmetry

35
Right Triangular Wave
 sin x sin 2 x sin 3 x 
2    
 1 2 3 

yes no
Even symmetry
Odd symmetry
Half-wave symmetry
Quarter-wave symmetry

Saw Tooth Wave
 sin x sin 2 x sin 3 x 
  2    
 1 2 3 

yes no
Even symmetry
Odd symmetry
Half-wave symmetry
Quarter-wave symmetry

36
Example 1 – Fourier series
• Find the Fourier series for:
 1  2  x  1

f ( x)   1 1  x  1
 1 1  x  2

f ( x  4)  f ( x )

Fundamental
range

Period = 4

Example 1 – Fourier series
• We can use the area under the 
curve to find
t fi d a0
area -1  2 -1
a0   0
period 4
The function is even so:

bn  0

37
Example 1 – Fourier series
• All we have to find is:
T

 2nx   nx 
2 2
2 1
an 
T  f ( x) cos
T T 
dx  an 
2 2
f ( x) cos
 2 
dx

2

even function x even function:

 nx 
2
 an   f ( x) cos dx
0  2 

 nx   nx 
1 2
 an   1cos dx    1cos dx
0  2  1  2 

Example 1 – Fourier series
• Evaluate the integrals:
 nx   nx 
1 2
an   1 cos dx    1 cos dx
0  2  1  2 
1 2
 2  nx   2  nx 
 an   sin     sin  
 n  2  0  n  2  1

 n  2  n 
sin 0   sin n  
2 2 2
 an  sin   sin  
n  2  n n n  2 

0 n even
4  n   a  4   1  ,1, 5, 9 
 an  sin   
n n 
n
 2 
 1  , 3, 7,11

38
Example 1 – Fourier series
• So the Fourier coefficients for:

 1  2  x  1

f ( x)   1 1  x  1 Fundamental
 1 1  x  2 range

f ( x  4)  f ( x )

Period = 4

are:
0 n even
4 
bn  a0  0, an    1  ,1, 5, 9  Answer!
n 
 1  , 3, 7,11

Example 2 – Fourier series
• Find the Fourier series for:
 
 x      x   2
  
f ( x)   x  x
 2 2
 x   
 x 
 2
f ( x  2 )  f ( x)

Period = 2π

Fundamental
range

39
Example 2 – Fourier series
• The function is odd so:
a0  0
an  0
T

 2nx 
2
2
bn 
T T f ( x ) sin 
 T 
dx

2

Example 2 – Fourier series
• Both f (x) and sine are odd, so their 
product is even:
d ti
T T

 2nx   2nx 
2
2 42
bn 
T T f ( x) sin T dx  bn  T 0 f ( x) sin T dx

2

 f ( x) sin nx dx


2
 bn 

  0

 x     x  

2  
  22
 
f ( x)   x  x  bn    x sin nx dx    x   sin nx dx 
 2 2  0  
 x     
 x  2
 2

40
Example 2 – Fourier series
• Now we will have to use integration by parts on 
both integrals:
both integrals: 


2 


  x sin nx dx    x   sin nx dx 
2
bn 
b b  0  

 udv  uva   vdu


b  2 

a a

2

 x sin nx dx  u  x  du  1


0
cosnx 
dv  sin nx   v  
n
  

 x cosnx  2 cosnx 
2 2
  x sin nx dx       n dx
0  n 0 0

 n  0  cos0   sin nx   2

  cos   
 2   n 0
2
2n n

Example 2 – Fourier series
• Now we will have to use integration by parts on 
both integrals:
both integrals: 


2 


  x sin nx dx    x   sin nx dx 
2
bn 
b b  0  

 udv  uv   vdu


b  2 
a
a a


  n   sin nx   2
 cos 
 2   n  0
2
2n

  n  1  n  1
 cos   2 sin    2 sin 0 
2n  2  n  2  n

2
  n  1  n 
  x sin nx dx   cos   2 sin  
0
2n  2  n  2 

41
Example 2 – Fourier series
• Now we find the second integral:
 
22 

 x sin nx dx    x   sin nx dx 


  0
b b bn 
 udv  uv   vdu
b  
a  2 
a a

  x   sin nx dx  u   x    du  1


 cosnx 
2
dv  sin nx   v  
n

  x    cosnx   cosnx  
  
   x   sin nx dx       1   dx
  n  
  n 
2
2 2

0  cosn    n   sin nx  



  cos 
 2   n  
2
n 2n
2

Example 2 – Fourier series
• Now we find the second integral:
 
22 

 x sin nx dx    x   sin nx dx 


  0
b b bn 
 udv  uv   duv
b  
a  2 
a a

  n  1   n 
 cos   2  sin n   sin   
2n  2  n   2 

  n  1  n 
  x   sin nx dx  2n cos

  sin 
2  n2  2 

2

42
Example 2 – Fourier series
• So our two integrals are:

2
  n  1  n 
 x sin nx dx   2n cos
0
2
  2 sin 
 n  2 


  n  1  n 
  x   sin nx dx  2n cos 2   n 2 sin 2 
2

Substituting:

 
22 

bn    x sin nx dx    x   sin nx dx 
 0  
 2 
2   n  1  n    n  1  n 
 bn    cos   sin   cos   2 sin   
  2n  2  n 2  2  2n  2  n  2 

Example 2 – Fourier series
• This gives us our final coefficient:

2 1  n  1  n 
bn    2 sin    2 sin   
 n  2  n  2 

4  n 
 bn  sin  
n 2  2 
0 n even
4 
 bn  2   1  ,1, 5, 9 
n 
 1  , 3, 7,11

43
Partial Sums
• The Fourier series gives the exact value of the function.
• In practice we cannot add up an infinite number of
terms.
• Instead we =can evaluate the partial sums of a Fourier
series by only evaluating a set number of the terms.


N
 2nx   2nx  
f ( x)  S N  a0    an cos   bn sin
i   
n 1   T   T 

Example 1 – Partial Sums
• Looking at the square wave 
example from above:
l f b
 1  2  x  1

f ( x)   1 1  x  1
 1 1  x  2

f ( x  4)  f ( x )
Fundamental
range f (x) : even
a0  0
bn  0
Period = 4

0 n even
4 
an    1  ,1, 5, 9 
n 
 1  , 3, 7,11

44
Example 1 – Partial Sums
• This gives the formula for the 
partial sums:
ti l
n N
  2nx   2nx  
S N  x   a0    an cos   bn sin   
n 1   T   T 
n N
  2nx   2nx  
 S N  x   0    an cos   0  sin   
n 1   4   4 
n N
  nx  
 S N  x     an cos  
n 1   2 

Example 1 – Partial Sums
• Calculating some of the partial sums:

0 n even
n N
  nx   4 
S N x     an cos   an    1  ,1, 5, 9 
n 1   2  n 
 1  , 3, 7,11

 1 x  4  x 
 S1 x  
4
 1 cos   cos 
  2    2

 x  4  2x  4  3x 
 S3 x  
4
cos    0  cos   1 cos 
  2  2  2  3  2 

 x  4  3x 
 S3 x  
4
cos   cos 
  2 3  2 

45
Example 1 – Partial Sums
• Calculating some of the partial sums:

0 n even
n N
  nx   4 
S N x     an cos   an    1  ,1, 5, 9 
n 1   2  n 
 1  , 3, 7,11

 x  4  2x  4  3x 
 S5 x  
4
cos    0  cos   1 cos 
  2 2  2  3  2 
4  4x  4  5x 
  0  cos   1 cos 
4  2  5  2 
 x  4  3x  4  5x 
 S5 x  
4
cos   cos  cos 
  2 3  2  5  2 

Example 1 – Partial Sums
• Compare the plots of the partial 
sums with the original function:

N 1 N 3

N 5 N  11

46
Example 1 – Partial Sums
• Compare the plots of the partial 
sums with the original function:
ith th i i l f ti

N  100 N  1000

Example 2 – Partial Sums
• Calculate the partial sums for a 

“sawtooth” function:
t th” f ti  
 x     x  
2
  
f ( x)   x  x
 2 2
 x   
Period = 2π  x 
 2
Fundamental f ( x  2 )  f ( x)
range
g

f (x) : odd
a0  0
an  0
0 n even
4 
bn    1  ,1, 5, 9 
n 2 
 1  , 3, 7,11

47
Example 2 – Partial Sums
• This gives the formula for the 
partial sums:
ti l
n N
  2nx   2nx  
S N  x   a0    an cos   bn sin   
n 1   T   T 
n N
  2nx   2nx  
 S N  x   0    0  cos   bn  sin   
n 1   2   2  
n N
 S N  x    bn sin nx 
n 1

Example 2 – Partial Sums
• Calculating some of the partial 
sums:
0 n even
n N 4 
S N x    bn sin nx  bn    1  ,1, 5, 9
n 2 
 1  , 3, 7,11
n 1

 S1  x   sin x 
4

 S3 x   sin  x    0  sin 2 x    1 sin 3 x 


4 4 4
   ( 2) 2   (3) 2
 S3 x   sin x   sin 3 x 
4 4
 9

48
Example 1 – Partial Sums
• Compare the plots of the partial 
sums with the original function:

N 1 N 3

N 9 N  25

F i S i
Fourier Series
Complex Form of 
the Fourier Series
the Fourier Series

49
Harmonics
a0  
f (t )    an cos n t   bn sin nt
2 n 1 n 1

a
 0   (an cos nt  bn sin nt )
2 n 1
  
 0   an2  bn2  sin nt 
a an bn
cos nt 
 2 
 an  bn an2  bn2
2 n 1 2

a0 
   an2  bn2 cos  n cos nt  sin  n sin nt 
2 n 1

 C0   Cn cos(nt   n )
n 1

Amplitudes and Phase Angles


f (t )  C0   Cn cos(nt   n )
n 1

harmonic amplitude phase angle

a0
C0 
2 b 
 n  tan 1  n 
Cn  an2  bn2  an 

50
Complex Exponentials
e jn0t  cos n0t  j sin n0t

e  jn0t  cos n0t  j sin n0t

cos n0t 
2

1 jn0t
e  e  jn0t 

sin n0t 
2j
e 
1 jn0t j
 
 e  jn0t   e jn0t  e  jn0t
2

Complex Form of the Fourier Series

a0  
f (t )    an cos n0t   bn sin n0t
2 n 1 n 1

a0 1 
 j 
 
   an e jn0t  e  jn0t   bn e jn0t  e  jn0t
2 2 n 1 2 n 1

a0   1 1 
    (an  jbn )e jn0t  ( an  jbn )e  jn0t 
2 n 1  2 2  a0
c0 
 
 2
 c0   cn e jn0t  c n e  jn0t
1
n 1 cn  (an  jbn )
2
1
c n  (an  jbn )
2

51
Complex Form of the Fourier Series

 

f (t )  c0   cn e jn0t  c n e  jn0t
n 1

 1
 c0   cn e jn0t
  cn e jn0t
n 1 n  
a0
 c0 
 c e n
jn0t 2
1
n   cn  (an  jbn )
2
1
c n  (an  jbn )
2

Complex Form of the Fourier Series

a0 1 T /2
c0  
2 T  T / 2
f (t )dt

1
cn  (an  jbn )
2
  f (t ) sin n0tdt 
1 T /2 T /2
f (t ) cos n0tdt  j 
T T / 2  T /2 
1 T /2 a0
  f (t )(cos n0t  j sin n0t )dt c0 
T T / 2 2
1 T /2 1
  f (t )e  jn0t dt cn  (an  jbn )
T T / 2 2
1
1 1 T /2
c n  (an  jbn )
c n 
2
(an  jbn ) 
T  T / 2
f (t )e jn0t dt
2

52
Complex Form of the Fourier Series

 a0
c0 
f (t )  c e
n  
n
jn0t
2
1
cn  (an  jbn )
1 T /2 2
cn 
T  T / 2
f (t )e  jn0t dt 1
c n  (an  jbn )
2
cn | cn | e jn , c n  cn* | cn | e  jn
If f(t) is real,
1 2
| cn || c n | an  bn2
c n  c *
n
2 n  1,2,3, 
 b 
 n  tan 1   n  c0 
1
a0
 an  2

Complex Frequency Spectra

cn | cn | e jn , c n  cn* | cn | e  jn  b 


 n  tan 1   n  n  1,2,3,
1 2  an 
| cn || c n | an  bn2
2
|cn| amplitude
1
c0  a0 spectrum
2

phase
n spectrum

53
Example
f(t)
A
t
T T d d T
  T
2 2 2 2

A 1
A d / 2  jn0t  (2 j sin n0 d / 2)
T  d / 2
cn  e dt
T  jjn0
d /2 A 1
A 1  1 sin n0 d / 2
 e  jn0t T 2 n0
T  jn0 d / 2
 nd 
sin  
A 1 1  
Ad  T 
  e  jn0 d / 2  e jn0 d / 2  T  nd 
T   jn0  jn0   
 T 

Example
A/5

-120 -80 -40 0 40 80 120


-150 -100 -50 50 100 150

 nd  1 1 d 1
sin   d , T , 
cn 
Ad  T  20 4 T 5
T  nd  2
  0   8
 T  T

54
Example

A/10

-120 -80 -40 0 40 80 120


-300 -200 -100 100 200 300

 nd  1 1 d 1
sin   d , T , 
cn 
Ad  T  20 2 T 5
T  nd  2
  0   4
 T  T

Example
f(t)
A
t
T
0 d T

A 1
A d  jn0t  (1  e  jn0 d )
T 0
cn  e dt
T jjn0
d A 1  jn0 d / 2 jn0 d / 2  jn0 d / 2
A 1  e (e e )
 e  jn0t T jn0
T  jn0 0
 nd 
sin  
A 1 1  
Ad  T  e  jn0 d / 2
  e  jn0 d   T  nd 
T   jn0  jn0   
 T 

55
Fourier Series Simulation 
Using MATLAB

ao  a1 cost   a2 cos2t   a3 cos3t   ...


1
f (t ) 
2
 b1 sin t   b2 sin 2t   b3 sin 3t   ...

an   f (t ) cosnt dt
2 T
T 0
bn   f (t ) sinnt dt
2 T
T 0

56
• clear
• for i=1:1:360
• if(i
if(i<=180) )
• ft(i)=1;
• else
• ft(i)=‐1;
• end
• end

• clear
• for i=1:1:360
• if(i<=180)
• ft(i)=1;
• else
• ft(i)=‐1;
• end
• xaxis(i)=i;
i (i) i
• End
• plot(xaxis,ft)

57
• x=2*pi/360; nharm=21;
• for nh=1:1:nharm
• y=nh*x;  an=0; bn=0; 
• for kh=1:1:360
• an=an+2/360*ft(kh)*cos(kh*y); 
• bn=bn+2/360*ft(kh)*sin(kh*y); 
• end
• cn(nh)=sqrt(an*an+bn*bn);
• thetan(nh)=atan(an/bn)*180/pi;
• end
• % 2/T * f(t)[height] * cos(n w t) * 1[width]
• %
% n w t = kh
t kh y = kh
kh nhh x = kh
kh nh
h 2 pi /360
2 i /360
• % n (w t) = nh (kh 2 pi /360)
• cnprint=cn,
• thetanprint=thetan,
• plot(xaxis,ft),pause

• clear
• for i=1:1:360
• if(i<=180)
• ft(i)=1;
• else
• ft(i)=‐1;
• end
• xaxis(i) i;
xaxis(i)=i;
• end
• x=2*pi/360; nharm=21;
• for nh=1:1:nharm
• y=nh*x;  an=0; bn=0;  
• for kh=1:1:360
• an=an+2/360*ft(kh)*cos(kh*y); 
• bn=bn+2/360*ft(kh)*sin(kh*y); 
• end
• c ( ) sq t(a a b b );
cn(nh)=sqrt(an*an+bn*bn);
• thetan(nh)=atan(an/bn)*180/pi;
• xhar(nh)=nh;
• end
• cnprint=cn,
• thetanprint=thetan,
• plot(xaxis,ft),pause
• plot(xhar,cn)

58
Inverse Fourier Transform

• for i=1:1:360
• fti(i)=0;
• for nh=1:1:nharm
• fti(i)=fti(i)+an(nh)*cos(nh*i*pi/180)+
b ( h)* i ( h*i* i/180)
bn(nh)*sin(nh*i*pi/180);
• end
• end

Total Harmonic Distortion (THD)
• The most commonly used power quality measure
• It is defined as the ratio of the root‐mean square 
of the harmonic content to the root‐mean square 
value of the fundamental quantity.  Frequently the 
THD is expressed in percent
(for voltage)

(for current)
V 2  V 3  V 4  V 5  ...
2 2 2 2

THD 
V1
 I  I  I  ...
2 2 2 2
I
 2 3 4 5

I1

59