2. 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 (θ )
.
3.
4.
5.
6. Fourier Series
f (θ )
be a periodic function with period
2π
The function can be represented by a
trigonometric series as:
∞
∞
n =1
n =1
f ( θ ) = a0 + ∑ an cos nθ + ∑ bn sin nθ
7. ∞
∞
n =1
n =1
f ( θ ) = a0 + ∑ an cos nθ + ∑ bn sin nθ
What kind of trigonometric (series) functions
are we talking about?
cos θ , cos 2θ , cos 3θ and
sin θ , sin 2θ , sin 3θ
8.
9.
10. We want to determine the coefficients,
an
and
bn
.
Let us first remember some useful
integrations.
11. π
∫ π cos nθ cos mθ dθ
−
1 π
1 π
= ∫ cos( n + m ) θ dθ + ∫ cos( n − m ) θ dθ
2 −π
2 −π
∫
π
cos nθ cos m θdθ = 0
−π
∫
π
cos nθ cos m θdθ = π
−π
n≠m
n=m
12. π
∫ π 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.
13. π
∫ π sin nθ sin mθ dθ
−
1 π
1 π
= ∫ cos( n − m )θ dθ − ∫ cos( n + m )θ dθ
2 −π
2 −π
∫
π
sin nθ sin m θdθ = 0
−π
∫
π
sin nθ sin m θdθ = π
−π
n≠m
n=m
14. Determine
a0
Integrate both sides of (1) from
−π
to
π
π
∫ π f ( θ ) dθ
−
= ∫ a0 + ∑ an cos nθ + ∑ bn sin nθ dθ
−π
n =1
n =1
π
∞
∞
15. π
∫ π f ( θ ) dθ
−
= ∫ a0dθ + ∫ ∑ an cos nθ dθ
−π
−π
n =1
π
∞
π
+ ∫ ∑ bn sin nθ dθ
−π
n =1
π
π
∫π
−
∞
π
f ( θ ) dθ = ∫ a 0 dθ + 0 + 0
−π
16. ∫
π
f ( θ) dθ = 2πa0 + 0 + 0
−π
1
a0 =
2π
a0
∫
π
f ( θ ) dθ
−π
is the average (dc) value of the
function,
f (θ )
.
17. You may integrate both sides of (1) from
0
∫
to
2π
instead.
f ( θ ) dθ
0
=∫
2π
2π
0
∞
∞
a0 + ∑ an cos nθ + ∑ bn sin nθ dθ
n =1
n =1
It is alright as long as the integration is
performed over one period.
18. ∫
2π
f ( θ ) dθ
0
2π
2π
0
0
= ∫ a0dθ + ∫
+∫
2π
0
∫
2π
0
∑ an cos nθ dθ
n =1
∞
∑ bn sin nθ dθ
n =1
∞
2π
f ( θ ) dθ = ∫ a0dθ + 0 + 0
0
20. Determine
Multiply (1) by
an
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
π
21. Let us do the integration on the right-hand-side
one term at a time.
First term,
∫
π
a0 cos m θ dθ = 0
−π
Second term,
π
∞
∑ a cos nθ cos mθ dθ
∫
− π n =1
n
23. Therefore,
π
∫ π f (θ ) cos mθ dθ = a π
m
−
1
am =
π
π
∫π
−
f ( θ ) cos mθ dθ
m = 1, 2,
24. Determine
Multiply (1) by
bn
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
π
25. 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θ
28. The coefficients are:
1
a0 =
2π
∫
1
am =
π
π
1
bm =
π
π
f ( θ ) dθ
−π
∫π
f ( θ ) cos mθ dθ
m = 1, 2,
π
f ( θ ) sin mθ dθ
m = 1, 2,
−
∫π
−
29. We can write n in place of m:
1
a0 =
2π
1
an =
π
1
bn =
π
π
∫
∫π
−
π
π
f ( θ ) dθ
−π
f ( θ ) cos nθ dθ
∫ π f (θ ) sin nθ dθ
−
n = 1 , 2 ,
n = 1 , 2 ,
30. The integrations can be performed from
0
2π
to
1
a0 =
2π
1
an =
π
1
bn =
π
∫
2π
0
∫
2π
∫
2π
0
0
instead.
f ( θ ) dθ
f ( θ ) cos nθ dθ
f ( θ ) sin nθ dθ
n = 1 , 2 ,
n = 1 , 2 ,
31. Example 1. Find the Fourier series of
the following periodic function.
f ( θ) = A
= −A
when 0 < θ < π
when
f ( θ + 2π ) = f ( θ )
π < θ < 2π
33. 1 2π
a n = ∫ f ( θ ) cos nθ dθ
π 0
2π
1 π
=
A cos nθ dθ + ∫ ( − A) cos nθ dθ
π
π ∫0
1
=
π
π
2π
1
sin nθ
sin nθ
A n + π − A n = 0
0
π
34. 1 2π
bn = ∫ f ( θ ) sin nθ dθ
π 0
2π
1 π
=
A sin nθ dθ + ∫ ( − A) sin nθ dθ
π
π ∫0
π
2π
cos nθ
1 cos nθ
− A n + π A n
0
π
A
[ − cos nπ + cos 0 + cos 2nπ − cos nπ ]
=
nπ
1
=
π
35. A
[ − cos nπ + cos 0 + cos 2nπ − cos nπ ]
bn =
nπ
A
[1 + 1 + 1 + 1]
=
nπ
4A
=
when n is odd
nπ
36. A
[ − cos nπ + cos 0 + cos 2nπ − cos nπ ]
bn =
nπ
A
[ − 1 + 1 + 1 − 1]
=
nπ
= 0 when n is even
37. 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?
38. When we consider 4 terms as shown in the
previous slide, the function looks like the
following.
1.5
1
0.5
f(θ)
0
0.5
1
1.5
θ
39. When we consider 6 terms, the function looks
like the following.
1.5
1
0.5
f(θ)
0
0.5
1
1.5
θ
40. When we consider 8 terms, the function looks
like the following.
1.5
1
0.5
f( θ)
0
0.5
1
1.5
θ
41. When we consider 12 terms, the function looks
like the following.
1.5
1
0.5
f(θ)
0
0.5
1
1.5
θ
42. The red curve was drawn with 12 terms and
the blue curve was drawn with 4 terms.
1.5
1
0.5
0
0.5
1
1.5
θ
43. The red curve was drawn with 12 terms and
the blue curve was drawn with 4 terms.
1.5
1
0.5
0
0.5
1
1.5
0
2
4
6
θ
8
10
44. The red curve was drawn with 20 terms and
the blue curve was drawn with 4 terms.
1.5
1
0.5
0
0.5
1
1.5
0
2
4
6
θ
8
10
45. Even and Odd Functions
(We are not talking about even or
odd numbers.)
46. Even Functions
Mathematically speaking -
f ( − θ ) = f (θ )
The value of the
function would
be the same
when we walk
equal distances
along the X-axis
in opposite
directions.
47. Odd Functions
Mathematically speaking -
f ( − θ ) = − f (θ )
The value of the
function would
change its sign
but with the
same magnitude
when we walk
equal distances
along the X-axis
in opposite
directions.
48. 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
0
5
10
0
θ
10
49. 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
0
5
10
0
θ
10
50. The Fourier series of an even function f ( θ )
is expressed in terms of a cosine series.
∞
f ( θ ) = a0 + ∑ an 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
51. Example 2. Find the Fourier series of
the following periodic function.
f ( x) = x
2
when − π ≤ x ≤ π
f ( θ + 2π ) = f ( θ )
52. 1
a0 =
2π
1
f ( x ) dx =
2π
π
∫π
−
x =π
1 x
π
=
=
3
2π x = −π
3
3
2
π
∫π
−
2
x dx
53. 1 π
an = ∫ f ( x ) cos nx dx
π −π
1 π 2
=
x cos nxdx
∫−π
π
Use integration by parts. Details are shown
in your class note.
54. 4
an = 2 cos nπ
n
4
an = − 2
n
4
an = 2
n
when n is odd
when n is even
55. This is an even function.
Therefore,
bn = 0
The corresponding Fourier series is
π
cos 2 x cos 3 x cos 4 x
− 4 cos x −
+
−
+
2
2
2
3
2
3
4
2
56. Functions Having Arbitrary Period
Assume that a function
has
period, . We can relate angle
( ) with time ( ) in the following
manner.
θ = ωt
ω is the angular velocity in radians per
second.
57. ω = 2π f
f is the frequency of the periodic function,
f (t)
θ = 2π f t
Therefore,
where
2π
θ=
t
T
1
f =
T
60. 1
an =
π
2
an =
T
π
∫ π f (θ ) cos nθ dθ
−
T
2
2π n
∫ Tf ( t ) cos T t dt
−
2
n = 1 , 2 ,
n = 1, 2,
61. 1
bn =
π
2
bn =
T
π
f ( θ ) sin nθ dθ
n = 1 , 2 ,
2π n
f ( t ) sin
t dt
∫T
T
−
n = 1, 2,
∫π
−
T
2
2
62. Example 4. Find the Fourier series of
the following periodic function.
T
T
f ( t ) = t when − ≤ t ≤
4
4
T
T
3T
= −t +
when
≤t ≤
2
4
4
63. f (t +T ) = f (t)
This is an odd function. Therefore,
T
2
2πn
bn = ∫ f ( t ) sin
t dt
T 0
T
4
=
T
∫
0
T
2
2πn
f ( t ) sin
t dt
T
an = 0
64. 4
bn =
T
4
+
T
T
4
2πn
t sin
t dt
∫ T
0
T
2
T 2πn
t dt
− t + sin
∫T
2 T
4
Use integration by parts.
65. T
nπ
sin
2.
2
2πn
2T
nπ
= 2 2 sin
nπ
2
4
bn =
T
bn = 0
2
when n is even.
66. Therefore, the Fourier series is
2T
π2
2π 1
6π 1
10π
sin T t − 2 sin T t + 2 sin T t −
3
5
67. The Complex Form of Fourier Series
∞
∞
n =1
n =1
f ( θ ) = a0 + ∑ an cos nθ + ∑ bn sin nθ
Let us utilize the Euler formulae.
jθ
− jθ
cos θ =
sin θ =
+e
2
e
e
jθ
−e
2i
− jθ
68. n
th harmonic component of (1) can be
The
expressed as:
an cos nθ + bn sin nθ
= an
= an
e
jnθ
e
jnθ
+e
2
− jnθ
+e
2
− jnθ
+ bn
e
− ibn
jnθ
e
−e
2i
jnθ
− jnθ
−e
2
− jnθ
69. an cos nθ + bn sin nθ
an − jbn jnθ an + jbn − jnθ
=
e +
e
2
2
Denoting
a n − jb n
cn =
2
and
c0 = a0
,
c−n
a n + jbn
=
2
70. a n cos nθ + bn sin nθ
= cne
jnθ
+ c− n e
− jnθ
71. The Fourier series for
can be expressed as:
∞
(
f (θ )
f ( θ ) = c0 + ∑ c n e
n =1
=
∞
∑c e
n
n= −∞
jnθ
jnθ
+ c− ne
− jnθ
)
72. The coefficients can be evaluated in
the following manner.
an − jbn
cn =
2
1 π
j
=
∫−π f ( θ ) cos nθdθ − 2π
2π
1
=
2π
1
=
2π
π
π
∫ π f ( θ ) sin nθ dθ
−
∫ π f (θ )( cos nθ − j sin nθ ) dθ
−
π
∫π
−
f (θ ) e
− jnθ
dθ
73. an + jbn
c− n =
2
1 π
j
=
∫−π f ( θ ) cos nθdθ + 2π
2π
1
=
2π
1
=
2π
π
∫π
−
π
∫π
−
π
∫ π f (θ ) sin nθ dθ
−
f ( θ )( cos nθ + j sin nθ ) dθ
f (θ ) e
jnθ
dθ
74. an − jbn
cn =
2
Note that
cn .
c−n
is the complex conjugate of
Hence we may write that
1
cn =
2π
.
c− n
an + jbn
=
2
∫
π
f ( θ) e
−π
− jnθ
dθ
n = 0 , ± 1, ± 2 ,
75. The complex form of the Fourier series of
f ( θ ) with period
f (θ ) =
2π
∞
∑c e
n = −∞
n
is:
jnθ
76. Example 1. Find the Fourier series of
the following periodic function.
f ( θ) = A
= −A
when 0 < θ < π
when
f ( θ + 2π ) = f ( θ )
π < θ < 2π
77. A := 5
f ( x) :=
A if 0 ≤ x < π
−A if π ≤ x ≤ 2 ⋅π
0 otherwise
2π
1 ⌠
A0 :=
⋅ f ( x) dx
2π ⌡0
A0 = 0