You are on page 1of 34

Fourier Series

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


Introduction to Fourier Series

a0 a1 cosx
f (x)

... a2 cos2 x

... a3 cos3x

...

... an cosnx ...


f

T
f

T
f

T
0

0 2

cos cos 2 cos 3


0

0 2

sin sin 2 sin 3


Even and Odd Functions
(We are not talking about even or
odd numbers.)
Even Thevalue of
Functions the function
f( would be the
same when we
walk equal
distances along

the X-axis in
opposite
directions.
Mathematically speaking -
f f
Odd Functions The value of
f( the function
would change
its sign but with
the same

magnitude when
we walk equal
distances along
the X-axis in
opposite
Mathematically speaking directions.
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

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


Fourier series
A Fourier series is a convenient
representation of a periodic
function.
A Fourier series consists of a
sum of sines and cosine terms.
Sines and cosines are the most
fundamental periodic functions.
Fourier series

The formula for a Fourier series


is:
n
2nx 2nx
f ( x) a0 an cos bn sin
n 1 T T
Fourier series

We have formulae for the


coefficients

T
2
1
a0
T f ( x)dx
T

2
T

2nx
2
2
an
T T f ( x ) cos
T
dx

2
T

2nx
2
2
bn
T T f ( x ) sin
T
dx

2
Summary of finding
coefficients
function function function
even odd neither
T T
2 2
1 1
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

2nx 2nx
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

2nx 2nx
2 2
bn 0 bn
2
T f ( x) sin T
dx bn
2
T f ( x) sin
T T
dx
T

2 2
Example Fourier series

Example Find the coefficients


for the Fourier series of:

x x 0
f ( x)
x 0 x
f ( x 2 ) f ( x)

f ( x)


Fundamental
range

x
0 2 4
Period = 2
Example Fourier series f ( x)

Find a0 x
0 2 4
T
2
1 1
a0
T T f ( x)dx 0 2
a f ( x)dx


2

f (x) is an even function so:



1 1
a0
2 f ( x)dx

a0
f ( x)dx
0


1 1 x 2
a0 xdx a0 a0
0 2 0 2
Example Fourier series

Find an
T

2nx 2nx
2
2 1
an
T T f ( x ) cos
T
dx a n

f ( x ) cos
2
dx

2

Since both functions are even their product


is even:

f ( x) cosnx dx x cosnx dx
1 2
an

an
0
Example Fourier series

Find bn
T

2nx 2nx
2
2 1
bn
T T f ( x ) sin
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) sinnx dx
1
bn bn 0

Example Fourier series

So we can put the coefficients


back into the Fourier series
formula:
n
2nx 2nx
f ( x) a0 an cos bn sin
n 1 T T


n
2

f ( x) 2 1 1 cos nx
n

2 n 1 n

f ( x) cosx 0 cos3x
4 4
2 9
Partial Sums

The Fourier series gives the


exact value of the function.
However, it uses an infinite
number of terms, so is
impossible to calculate.
We can evaluate the partial
sums of a Fourier series by only
evaluating a set number of the
terms.
Partial Sums

For partial sums we use the


notation:
n N
2nx 2nx
S N x a0 an cos bn sin
n 1 T T

To represent a partial sum


with N terms.
Example 1 Partial Sums

Compare the plots of the partial


sums with the original function:

N 1 N 3

N 5 N 11
Example 1 Partial Sums

Compare the plots of the partial


sums with the original function:

N 100 N 1000
Example 1 Partial Sums

Compare the plots of the partial


sums with the original function:

N 1 N 3

N 9 N 25
Numerical Fourier Series