0% found this document useful (0 votes)
36 views12 pages

4.1 Fourier Sine and Cosine Series

aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa

Uploaded by

bbteenager
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
36 views12 pages

4.1 Fourier Sine and Cosine Series

aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa

Uploaded by

bbteenager
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 12

Chapter 4

Fourier series
An important application of orthogonal functions is the expansion of an arbitrary periodic
function f(x) as a linear combination of sines and cosines, called a Fourier series. This series
is presented in Sec. 4.1 and some standard examples are shown in Sec. 4.2. The exponential
form of the series is discussed in Sec. 4.3 and this is applied to nding a particular solution of a
dierential equation in Sec. 4.4.
4.1 Fourier sine and cosine series
Consider a function f(x) that is periodic with period 2L, i.e., f(x + 2L) = f(x) for all x. We
claim we can write any such function as a Fourier series of the form
f(x) =
a
0
2
+

n=1
_
a
n
cos
_
nx
L
_
+ b
n
sin
_
nx
L
__
. (4.1)
The constants a
n
and b
n
are called Fourier coecients. Notice that a coecient b
0
is not needed
as it would multiply sin(0) = 0. The a
0
term contains the factor of 2 for conventional reasons
as this will allow us to write down formulae for a
0
and a
n
that have a similar form.
If the period of our function is some other value, say, P, then we can always dene a new
variable x equal to the original x times 2L/P such that the function has a period 2L when
written in terms of the new variable.
If the function is not periodic but only dened on an interval of length 2L, then we can form
a periodic function by simply repeating the original one shifted to the right and left by multiples
of 2L. This is called the periodic extension of the original function. In the end we may then
only be interested in the function within an interval corresponding to a single period.
Equation (4.1) is a special case of the formalism described in the previous section. That is,
we are expanding the function f(x) as a linear combination of basis functions, but here there
are dierent types of basis functions needed to form a complete set. We can rewrite the Fourier
series (4.1) in an equivalent way as
f(x) = a
0

0
(x) +

n=1
[a
n

n
(x) + b
n

n
(x)] , (4.2)
41
42 Lecture Notes on Mathematical Methods
where

0
(x) =
1
2
, (4.3)

n
(x) = cos
_
nx
L
_
,

n
(x) = sin
_
nx
L
_
, (4.4)
for n = 1, 2, . . .. The function
0
is not used since it would involve sin(0) = 0 and thus simply
be equal to zero.
We dene the inner product for any pair of periodic functions as an integral over a single
period, which we can take to be L x L:
f, g =
_
L
L
f(x)g(x) dx , (4.5)
We could equally well take the region of integration to be a x a + 2L for any a, which
is more convenient for some problems, e.g., if f(x) is the periodic extension of a function
originally dened in an interval that starts at a. Any region of integration will work as long as
it corresponds to one full period the function.
With the basis functions and inner product dened as above we nd the following
orthogonality relations:

0
,
n
=
L
2

0n
n = 0, 1, 2, . . . (4.6)

n
,
m
= L
nm
n = 0, 1, 2, . . . (4.7)

n
,
m
= L
nm
n = 1, 2, . . . (4.8)

n
,
m
= 0 (all n, m) (4.9)
As we have already seen in previous chapters, these relations can be easily veried by using
standard trigonometric identities such as 2 sina sinb = cos(ab) cos(a+b) (see Appendix B).
We can nd the Fourier coecients for a given function f(x) by taking the inner product of
f and the corresponding basis function. That is, to nd a
n
and b
n
for any given n we compute
a
n
=

n
, f

n
,
n

=
1
L
_
L
L
cos
_
nx
L
_
f(x) dx , (4.10)
b
n
=

n
, f

n
,
n

=
1
L
_
L
L
sin
_
nx
L
_
f(x) dx . (4.11)
Fourier Series 43
The integral formula for a
n
holds for both n = 0 and n = 1, 2, . . ..
Notice that if we dene the inner product as above in an interval that is symmetric about
zero, then there are certain easily identied cases where some of the coecients vanish. If the
function f(x) is even valued, i.e., f(x) = f(x), then because the sine function is odd, i.e.,
sin(nx/L) = sin(nx/L), the portion of the integral (4.11) from L to 0 is equal and
opposite to the part from 0 to L and as a result all of the b
n
are zero. In a similar way if f(x)
is odd, i.e., f(x) = f(x), then all of the a
n
vanish, including a
0
.
4.2 Example of Fourier series: the square-wave function
As an example of a function that we can express as a Fourier series, consider a square wave
dened as
f(x) =
_
_
_
1 L x < 0,
1 0 x < L.
(4.12)
Because this is an odd-valued function, all of the a
n
coecients will vanish and we only need to
compute
b
n
=

n
, f

n
,
n

=
1
L
_
_
0
L
sin
_
nx
L
_
(1) dx +
_
L
0
sin
_
nx
L
_
dx
_
=
2
L
_
L
0
sin
_
nx
L
_
dx
=
2
n
[cos(n) 1] . (4.13)
For n even, the cosine term is equal to one and we get b
n
= 0. For n odd, the cosine term is 1
so we nd
b
n
=
_
_
_
0 n even ,
4
n
n odd.
(4.14)
The Fourier series for the square wave function can therefore be written
f(x) =
4

_
sin
_
x
L
_
+
1
3
sin
_
3x
L
_
+
1
5
sin
_
5x
L
_
+ . . .
_
. (4.15)
The plots in Fig. 4.1 show the partial sum of the Fourier series including terms out to
n = 1, 3, 9, 19, 49 and 99.
44 Lecture Notes on Mathematical Methods
x
f
(
x
)
n = 1
x
f
(
x
)
n = 3
x
f
(
x
)
n = 9
x
f
(
x
)
n = 19
x
f
(
x
)
n = 49
x
f
(
x
)
n = 99
(a) (b)
(c)
(d)
(e) (f)
Figure 4.1: Fourier series for a square wave based on a partial sum of terms up to the value of n
indicated.
Fourier Series 45
In Fig. 4.1 one can see that as the number of terms in the sum increases, the series approaches
the exact form of the square-wave function. But there is an overshoot that is clearly visible for
larger n, which, surprisingly, does not vanish even when the number of summed terms is taken
to innity. This is called the Gibbs phenomenon, and is a characteristic feature of a Fourier
series of a function with jump discontinuities. For a square wave one can show that the size of
the overshoot approaches a xed value of just under 9% (see, e.g., Ref. [1]).
One may then question in what sense the Fourier series converges, as claimed, to the true
square-wave function. The answer is that the width of the region of overshoot goes to zero as
more terms are summed, so for any x arbitrary close to but not right on the discontinuity, the
series eventually approaches the target value.
4.3 Exponential form of Fourier series
It is often convenient to express the Fourier series in terms of complex exponentials rather than
sines and cosines. Starting from Eulers formula for both an angle and also ,
e
i
= cos + i sin , (4.16)
e
i
= cos i sin , (4.17)
we can solve for the sine and cosine terms to nd
cos =
e
i
+ e
i
2
, (4.18)
sin =
i(e
i
e
i
)
2
. (4.19)
These formulae may seem a bit strange in that the imaginary parts on the left are evidently
zero, but on the right-hand side it is not immediately clear that this holds. It is of course true
that the imaginary parts of both sides of the equations are equal; on the right-hand sides the
terms containing i all cancel as one can easily verify.
We can use Eqs (4.18) and (4.19) to write the Fourier series (4.1) as
f(x) =
a
0
2
+

n=1
_
a
n
cos
_
nx
L
_
+ b
n
sin
_
nx
L
__
=
a
0
2
+

n=1
_
a
n
2
(e
inx/L
+ e
inx/L
)
ib
n
2
(e
inx/L
e
inx/L
)
_
=
a
0
2
+
1
2

n=1
_
(a
n
ib
n
)e
inx/L
+ (a
n
+ ib
n
)e
inx/L
_
, (4.20)
46 Lecture Notes on Mathematical Methods
and we can express this as
f(x) =

n=
c
n
e
inx/L
, (4.21)
where
c
0
=
a
0
2
, (4.22)
c
n
=
a
n
ib
n
2
, (4.23)
c
n
=
a
n
+ ib
n
2
. (4.24)
The coecients c
n
in Eq. (4.21) are engineered so as to combine with the complex exponentials
to give an imaginary part of the series equal to zero, as it must since we began with a real
function f(x). The property needed for this to hold can be seen from Eqs. (4.23) and (4.24),
namely
c
n
= c

n
. (4.25)
We are usually interested in the Fourier series for real-valued functions, but we could also
represent a complex-valued function, in which case Eq. (4.25) would not hold.
We can also use the formalism of basis functions to write the Fourier series as
f(x) =

n=
c
n

n
(x) , (4.26)
where in this case the function
n
is

n
(x) = e
inx/L
. (4.27)
It is easy to verify that the
n
are orthogonal with an inner product dened in [L, L]:

n
,
m
=
_
L
L

n
(x)
m
(x) dx =
_
L
L
e
i(nm)x/L
dx = 2L
nm
. (4.28)
The missing steps to arrive at the nal equality are left as an exercise. Notice that the basis
functions
n
are complex, and so we need the complex conjugate of
n
for the inner product

n
,
m
.
To nd the values of the coecients c
n
for a given function f(x) we follow the by now familiar
procedure:
c
n
=

n
, f

n
,
n

=
1
2L
_
L
L
e
inx/L
f(x) dx . (4.29)
Fourier Series 47
4.3.1 Exponential form of Fourier series for a square wave
As an example of the complex exponential form of the Fourier series consider again the square
wave, for which we already found the series in Sec. (4.2). Here we show that we arrive at the
same result using the expansion from Eq. (4.26) with the basis functions from Eq. (4.27).
The coecients c
n
are found using
c
n
=

n
, f

n
,
n

=
1
2L
_
_
0
L
e
inx/L
(1) dx +
_
L
0
e
inx/L
dx
_
. (4.30)
For n = 0 we nd
c
0
=

0
, f

0
,
0

=
1
2L
_
_
0
L
(1) dx +
_
L
0
dx
_
= 0 . (4.31)
For n = 0 Eq. (4.30) gives
c
n
=
1
2L
_

_
L
in
_
_
1 e
in
_
+
_
L
in
_
_
e
in
1
_
_
. (4.32)
For n even, the terms in square brackets are zero; for n odd the rst is 2 and the second 2.
We therefore nd
c
n
=
_
_
_
0 n even,

2i
n
n odd.
(4.33)
Putting these c
n
into the series (4.27) gives
f(x) =

n=
c
n

n
(x)
=

n odd
_
2i
n
_
e
inx/L
=

n odd
_
2i
n
__
cos
_
nx
L
_
+ i sin
_
nx
L
__
. (4.34)
where summation over odd n covers both positive and negative values. In the sum in the nal
line of (4.34), the term that goes as
1
n
cos
_
nx
L
_
(4.35)
makes a contribution for n that is equal and opposite to the corresponding term with n, and
therefore they cancel. The terms that go as
48 Lecture Notes on Mathematical Methods
1
n
sin
_
nx
L
_
(4.36)
are the same for n and n, and so we can simply multiply those by two and sum over positive
(odd) n only. The nal result is therefore
f(x) =
4

n=1,3,...
1
n
sin
_
nx
L
_
, (4.37)
which is the same as what we found in Sec. 4.2.
4.4 Fourier series for particular solution of an ODE
An important application of Fourier series is to help nd the particular solution of a
nonhomogeneous ordinary dierential equation. Recall from Sec. 1.3.5 regarding the method
of undetermined coecients we considered an ODE of the the form Lu = f for some linear
dierential operator L. We showed that if the function f could be written as a sum of terms,
f =

n
f
n
, (4.38)
then by nding the solutions u
n
to the equations
Lu
n
= f
n
(4.39)
for all n we could construct the full solution u from the sum of the individual parts,
u =

n
u
n
. (4.40)
As an example of this type of problem, suppose we have a driven harmonic oscillator as we
saw in Sec. 1.4, except now the driving term on the right-hand side is not necessarily a simple
sine or cosine function, but an arbitrary periodic function f(t) with period T. So our equation
of motion corresponding to Eq. (1.69) is
u

+u

+
2
0
u = f(t) . (4.41)
We can express f(t) as a sum of terms in a Fourier series, which we do here using the exponential
form
f(t) =

n=
c
n
e
i
n
t
, (4.42)
with
Fourier Series 49

n
=
2n
T
. (4.43)
Let us suppose that the driving force f(t) has the form of a square wave,
f(t) =
_
_
_
A T/2 t < 0,
A 0 t < T/2.
(4.44)
We have already shown in Sec. (4.3) that this can be expressed as a complex Fourier series of
the form of Eq. (4.42) with coecients given by
c
n
=
_
_
_
0 n even,

2iA
n
n odd.
(4.45)
We can dene the functions corresponding to the nth term or Fourier mode as
f
n
(t) = c
n
e
i
n
t
=
2iA
n
e
i
n
t
(4.46)
for n odd and f
n
= 0 otherwise. We now need to solve
u

n
+u

n
+
2
0
u
n
= f
n
(4.47)
for all n. For n even we have f
n
= 0 and an obvious particular solution is simply u
n
= 0. For n
odd we can make use of the result we already found in Sec. (1.4) to write the solution as
u
n
= B
n
e
i
n
t
, (4.48)
where the complex coecient B
n
is (compare to Eq. (1.86)),
B
n
=
c
n

2
n

2
0
i
n

. (4.49)
Following the pattern from Eq. (1.86) we can write the factor in (4.49) that multiplies c
n
in
terms of its magnitude and phase as

2
n

2
0
i
n

=
e
i
n
_
(
2
n

2
0
)
2
+
2
n

2
(4.50)
with

n
= tan
1

n

2
n

2
0
. (4.51)
As in Sec. 1.4 the quandrant of
n
is determined by requiring
50 Lecture Notes on Mathematical Methods
cos
n
=

2
n

2
0
_
(
2
n

2
0
)
2
+
2
n

2
, (4.52)
sin
n
=

n

_
(
2
n

2
0
)
2
+
2
n

2
. (4.53)
The complex solution to Lu
n
= f
n
is therefore
u
n
=
2iA
n
1
_
(
2
n

2
0
)
2
+
2
n

2
e
i
n
e
i
n
t
=
2iA
n
1
_
(
2
n

2
0
)
2
+
2
n

2
[cos(
n
t +
n
) + i sin(
n
t +
n
)]
=
2A
n
1
_
(
2
n

2
0
)
2
+
2
n

2
[sin(
n
t +
n
) i cos(
n
t +
n
)] . (4.54)
We now redene the symbol u
n
to refer only to the real part of Eq. (4.48), which we can write
u
n
= |B
n
| sin(
n
t +
n
) , (4.55)
where the amplitude is given by
|B
n
| =
2A
n
1
_
(
2
n

2
0
)
2
+
2
n

2
(4.56)
We can see from Eqs. (4.43) and (4.51) that
n
and
n
both have the property

n
=
n
, (4.57)

n
=
n
. (4.58)
But since
1
n
sin(
n
t +
n
) =
1
n
sin(
n
t
n
) , (4.59)
the negative and positive values of n contribute exactly the same to the series. We can therefore
simply sum over positive (odd) values of n and multiply the result by two. The particular
solution is therefore
u
p
(t) =

n=
u
n
=

n=1,3,...
4A
n
1
_
(
2
n

2
0
)
2
+
2
n

2
sin(
n
t +
n
) . (4.60)
Fourier Series 51
Some examples of the solution are shown in Fig. 4.2 for dierent values of the systems
parameters. In all the plots, the times at which the force changes sign are indicated by the
vertical grid lines.
In Fig. 4.2(a) there is no damping ( = 0) and the spring constant k is set to zero so that the
natural angular frequency
0
is zero. The oscillating mass is then a free particle moving only
under the inuence of the driving force. For a time T this force is constant, and so the problem
is the same as a mass moving in a constant gravitational eld. That is, the position changes as
a quadratic function of time. At every interval of time T there is a change in the direction of
the force, so the overall motion is therefore a succession of parabolic segments, although in the
result in the gure is dicult to distinguish from a sine curve.
In Fig. 4.2(b) the damping constant is relative high so that the mass approaches its
terminal speed very quickly, and then proceeds at an almost constant speed until the force
changes direction. Then because of its inertia the oscillator overshoots slightly but then quickly
reverses and approaches its terminal speed in the opposite direction.
In Fig. 4.2(c) the spring constant relative high resulting in a high value of
0
and a
correspondingly short period for the natural oscillations. The eect of the constant force for a
time T is mainly to displace the equilibrium position of the damped oscillatory motion. Other
choices for the parameters can lead to more complicated behaviour as in Fig. 4.2(d), but the
result is always periodic with a period of the driving force.
52 Lecture Notes on Mathematical Methods
t
u
(
t
)
t
u
(
t
)
t
u
(
t
)
t
u
(
t
)
(a)
(b)
(c)
(d)
Figure 4.2: Particular solutions to the harmonic oscillator driven by a square wave for dierent values
of the systems parameters (see text).

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy