Chapter 12 A
Chapter 12 A
12
Fourier Series
I n 1807, the French mathematician and physicist Joseph Fourier submitted a paper
on heat conduction to the Academy of Sciences of Paris. In this paper Fourier made
the claim that any function f .x / can be expanded into an infinite sum of trigonometric
functions,
1
X
f .x / D C Tak cos.kx / C bk sin.kx /U; x :
a0
for
2 k D1
The paper was rejected after it was read by some of the leading mathematicians of
his day. They objected to the fact that Fourier had not presented much in the way of
proof for this statement, and most of them did not believe it.
In spite of its less than glorious start, Fourier’s paper was the impetus for major
developments in mathematics and in the application of mathematics. His ideas forced
mathematicians to come to grips with the definition of a function. This, together
with other metamathematical questions, caused nineteenth-century mathematicians
to rethink completely the foundations of their subject, and to put it on a more rigorous
foundation. Fourier’s ideas gave rise to a new part of mathematics, called harmonic
analysis or Fourier analysis. This, in turn, fostered the introduction at the end of
the nineteenth century of a completely new theory of integration, now called the
Lebesgue integral.
The applications of Fourier analysis outside of mathematics continue to multiply.
One important application pertains to signal analysis. Here, f .x / could represent
the amplitude of a sound wave, such as a musical note, or an electrical signal from a
CD player or some other device (in this case x represents time and is usually replaced
by t). The Fourier series representation of a signal represents a decomposition of
this signal into its various frequency components. The terms sin kx and cos kx
712
12.1 Computation of Fourier Series 713
oscillate with numerical frequency1 of k =2 . Signals are often corrupted by noise,
which usually involves the high-frequency components (when k is large). Noise can
sometimes be filtered out by setting the high-frequency coefficients (the ak and bk
when k is large) equal to zero.
Data compression is another increasingly important problem. One way to ac-
complish data compression uses Fourier series. Here the goal is to be able to store or
transmit the essential parts of a signal using as few bits of information as possible.
The Fourier series approach to the problem is to store (or transmit) only those ak and
bk that are larger than some specified tolerance and discard the rest. Fortunately, an
important theorem (the Riemann–Lebesgue Lemma, which is our Theorem 2.10) as-
sures us that only a small number of Fourier coefficients are significant, and therefore
the aforementioned approach can lead to significant data compression.
Notice that, except for the term a0 =2, the series is an infinite linear combination of the
basic terms sin nx and cos nx for n a positive integer. These functions are periodic
with period 2= n, so their graphs trace through n periods over the interval T ; U.
Figure 1 shows the graphs of cos x and cos 5x, and Figure 2 shows the graphs of
sin x and sin 5x. Notice how the functions become more oscillatory as n increases.
1 1
x x
−π π −π π
−1 −1
1
Be sure you know the difference between angular frequency, k in this case, and numerical frequency. It
is explained in Section 4.1.
714 Chapter 12 Fourier Series
LEMMA 1.2 Let p and q be positive integers. Then we have the following orthogonality relations.
Z Z
sin px d x D cos px d x D0 (1.3)
Z
sin px cos qx d x D0 (1.4)
(
; if p D q
Z
cos px cos qx d x D 0; if p 6 D q
(1.5)
(
; if p D q
Z
sin px sin qx d x D 0; if p 6D q (1.6)
on the interval T ; U. To find a0 , we simply integrate the series (1.7) term by term.
Using the orthogonality relation (1.3), we see that
Z
f .x / d x D a0 : (1.8)
Using the orthogonality relations in Lemma 1.2, we see that all the terms on the
right-hand side of (1.9) are equal to zero, except for
Z
an cos nx cos nx d x D an :
12.1 Computation of Fourier Series 715
is called the partial sum of order N for the Fourier series in (1.13). We say that
the Fourier series converges at x if the sequence of partial sums converges at x as
N ! 1: We use the symbol in (1.13) because we cannot be sure that the series
converges. We will explore the question of convergence in the next section, and we
will see in Theorem 2.3 that for functions that are minimally well behaved, the
can be replaced by an equals sign for most values of x.
EXAMPLE 1.15 ◆ Find the Fourier series associated with the function
(
0; for x < 0,
f .x / D
x ; for 0 x :
2
We used the expression a0 =2 instead of a0 for the constant term in the Fourier series (1.7) so formulas
like equation (1.10) would be true for n D 0 as well as for larger n.
716 Chapter 12 Fourier Series
Z Z
a0 D 1
f .x / d x D 1
. x/ dx D 2 :
0
D 1
n
2
.1 cos n /:
Thus, since cos n D . 1/n , the even numbered coefficients are a2n D 0, and the
odd numbered coefficients are a2nC1 D 2=T.2n C 1/2 U for n 0:
We compute bn using (1.11). Again we integrate by parts to get
Z Z
bn D 1
f .x / sin nx d x D 1
. x / sin nx d x
0
Z
D 1
n 0
. x / d cos nx
Z
D 1
n
. x / cos nx
1
n 0
cos nx d x
0
|an| and |bn|
D n1 :
The magnitude of the coefficients is plotted in Figure 3, with jan j in black and
1 jbn j in blue. Notice how the coefficients decay to 0. The Fourier series for f is
1 1
X cos.2n C 1/x X
f .x / C 2 C sin nx
:
.2n C 1/2
(1.16)
0 n 4 n
0 10 20 30 n D0 n D1 ◆
Figure 3 The Fourier coefficients
for the function in Example 1.15. Let’s examine the experimental evidence for convergence of the Fourier series
in Example 1.15. The partial sums of orders 3, 30, and 300 for the Fourier series
in Example 1.15 are shown in Figures 4, 5, and 6, respectively. In these figures
the function f is plotted in black and the partial sum in blue. The evidence of
these figures is that the Fourier series converges to f .x /, at least away from the
discontinuity of the function at x D 0:
12.1 Computation of Fourier Series 717
π
π π
0 0 0
x x x
−π 0 π −π 0 π −π 0 π
Figure 4 The partial sum of Figure 5 The partial sum of Figure 6 The partial sum of
order 3 for the function in order 30 for the function in order 300 for the function in
Example 1.15. Example 1.15. Example 1.15.
The formula for bn is derived similarly. Thus equations (1.10) and (1.11) are the
special case for L D of the following more general result.
P1
THEOREM 1.17 If f .x / D a0 =2 C n D1 Tan cos.n x = L / C bn sin.n x = L /U for L x L, then
Z L
n x
an D 1
L
f .x / cos
L
d x ; for n 0; (1.18)
L
Z L
n x
bn D 1
L
f .x / sin
L
d x ; for n 1: (1.19)
L
Keep in mind that Theorem 1.17 only shows that if f can be expressed as a
Fourier series, then the coefficients an and bn must be given by the formulas in (1.18)
and (1.19). The theorem does not say that an arbitrary function can be expanded into
a convergent Fourier series.
718 Chapter 12 Fourier Series
The special case when n D 0 in (1.18) deserves special attention. Since cos 0 D
1, it says
Z L
a0 D 1
L
f .x / d x :
L
f(x) f(x)
f(−a) = −f(a)
−a a a
x x
−L 0 L −L −a 0 L
f(−a) = f(a)
5. If f is odd, then
Z L
f .x / d x D 0:
L
We will leave the proof for the exercises. If we remember that the integral of f
computes the algebraic area under the graph of f , parts 4 and 5 of Proposition 1.23
can be seen in Figures 7 and 8.
Z L
n x
bn D L2 f .x / sin
L
dx; for n 1:
0
720 Chapter 12 Fourier Series
π π π
0 0 0
x x x
−π 0 π −π 0 π −π 0 π
−π −π
−π
Figure 10 The partial sum of Figure 11 The partial sum of Figure 12 The partial sum of
order 5 for f (x) = x. order 11 for f (x) = x. order 51 for f (x) = x.
EXAMPLE 1.27 ◆ Compute the Fourier series for the saw-tooth wave f graphed in Figure 13 on the
interval T 1; 1U.
The graph in Figure 13 on the interval T 1; 1U consists of two lines with slope
C2 and 2 respectively. The formula for f on the interval 1x 1 is given by
(
1 C 2x ; if 1 x 0;
f .x / D
1 2x ; if 0 x 1:
12.1 Computation of Fourier Series 721
1
0
x
−3 −2 −1 0 1 2 3
−1
EXAMPLE 1.28 ◆ Find the Fourier series of the function f .x / D sin 3x C 2 cos 4x on the interval
T ; U.
722 Chapter 12 Fourier Series
1
0
x
−3 −1 1 3
−1
0
x
−3 −1 1 3
−1
Since f is already given as a sum of sines and cosines, no work is needed. The
Fourier series of f is just sin 3x C 2 cos 4x. This example illustrates an important
point. According to Theorem 1.17, the Fourier coefficients of a function are uniquely
determined by the function. Thus, by inspection, b3 D 1, a4 D 2 and all other
coefficients are equal to 0. By uniqueness, these are the same values as would have
been obtained by computing the integrals in Theorem 1.17 for the an and bn . ◆
EXAMPLE 1.29 ◆ Find the Fourier series of the function f .x / D sin2 x on the interval T ; U.
In this example, f is not explicitly given as a linear combination of sines and
cosines, so there is some work to do. However, if we use the trigonometric identity
sin2 x D 12 .1 cos 2x /;
the right side is the desired Fourier series, since it is a finite linear combination of
terms of the form cos nx. ◆
................
EXERCISES
In Exercises 1–6 expand the given function in a Fourier series valid on the interval
x . Plot the function and two partial sums of your choice over the interval
x . Plot the same partial sums over the interval 3 x 3 .
1. f .x / D j sin x j
2. f .x / D jx j
12.1 Computation of Fourier Series 723
(
0; x < 0;
3. f .x / D
x ; 0 x :
(
0; x < 0;
4. f .x / D
sin x ; 0 x :
5. f .x / D x cos x
6. f .x / D x sin x
In Exercises 7–16 find the Fourier series for the indicated function on the indicated
interval. Plot the function and two partial sums of your choice over the interval.
(
1 C x ; for 1 x 0,
7. f .x / D on T 1; 1U
1; for 0 < x 1
8. f .x / D 4 x 2 on T 2; 2U
9. f .x / D x 3 on T 1; 1U
10. f .x / D sin x cos2 x on T ; U
(
0; for 1 x 0,
11. f .x / D on T 1; 1U
x 2 ; for 0 < x 1
(
sin x =2; for 2 x 0,
12. f .x / D on T 2; 2U
0; for 0 < x 2
(
cos x ; for 1 x 0,
13. f .x / D on T 1; 1U
1; for 0 < x 1
(
1 C x ; for 1 x 0,
14. f .x / D on T 1; 1U
1 x ; for 0 < x 1
(
2 C x; for 2 x 0,
15. f .x / D on T 2; 2U
2 C x ; for 0 < x 2
(
2; for 2 x 0,
16. f .x / D on T 2; 2U
2 x ; for 0 < x 2
is its associated Fourier series. Two questions arise immediately whenever an infinite
series is encountered. The first question is, does the series converge? The second
question arises if the series converges. Can we identify the sum of the series?
In particular, does the Fourier series of a function f converge at x to f .x / or to
something else? These are the questions we will address in this section.3
3
Theorem 1.17 does not answer this question, since it assumes that f .x / equals its Fourier series and
then describes what the Fourier coefficients have to be.
12.2 Convergence of Fourier Series 725
The partial sums of this series are all periodic with period 2 . Therefore, if the
Fourier series converges, the limit function will be periodic with period 2 . Thus
the limit cannot be equal to f .x / D x everywhere. The evidence from the graphs of
the partial sums in Figures 10, 11, and 12 of the previous section indicates that the
series does converge to f .x / D x on the interval . ; /. Since the limit must be
2 -periodic, we expect that the limit is closely related to the periodic extension of
f .x / D x from the interval . ; /. The situation is illustrated in Figure 1, which
shows the partial sum of order 5 over 3 periods. The periodic extension of f .x / D x
is shown plotted in black.
Since it will appear repeatedly, let’s denote the periodic extension of a function
f .x / defined on an interval T L ; L U by f p .x /. Usually it is easier to understand
the periodic extension of a function graphically than it is to give an understandable
formula for it. This is illustrated for f .x / D x in Figure 1. However, for the record,
the formula for the periodic extension5 is
f p .x / D f .x 2kL / for .2k 1/ L < x .2k C 1/ L :
You will notice that f p is periodic with period 2L :
To get a feeling for whether or not the Fourier series of f .x / D x converges
to its periodic extension f p , we graph both f p and the partial sum of order 21 in
Figure 2. Note that the graph of S21 (the blue curve) is close to the graph of f p
except at the points of discontinuity of f p , which occur at the odd multiples of :
The accuracy of the approximation of f p .x / by S21.x / gets worse as x gets closer
4
We studied periodic functions in Section 5.5, but let’s refresh our memory. A function g .x / is periodic
with period T if g .x C T / D g .x / for all x. Notice that every integral multiple of a period is also a period.
The smallest period of cos.n x = L / and sin.n x = L / is 2L = n, so n .2L = n / D 2L is also a period. Thus
each function in the partial sum SN in (2.2) is periodic with period 2L.
5
Notice we use less than (<) at the lower endpoint of each interval and less than or equal () at the upper
endpoint. A choice is necessary to avoid having two values at the endpoints. This is not the only possible
choice, but it is as good as any.
726 Chapter 12 Fourier Series
π
0
x
−3π −π π 3π
−π
0
x
−3π −π π 3π
−π
wise continuous on all of R, and its only possible points of discontinuity are the odd
multiples of L.
We will say that the function f has left-hand derivative at x 0 if the left-hand
limit f .x 0 / exists and the limit
f .x / f .x 0 /
lim /
x !x0 x x0
Convergence
Since a Fourier series converges to a periodic function, we may as well assume
from the beginning that the function f is already periodic. If, as was the case in
Example 1.25, we are given a function that is not periodic, then it is necessary to
look at the periodic extension of the function.
We are now in a position to state our main theorem on the convergence of Fourier
series. A proof is beyond the scope of this text, but one can be found in any advanced
book on Fourier series.
THEOREM 2.3 Suppose f .x / is a piecewise continuous function that is periodic with period 2L.
If the left- and right-hand derivatives of f exist at x 0 then the Fourier series for f
converges at x 0 to
f .x 0C / C f .x 0 /
:
2
COROLLARY 2.4 Suppose f .x / is a piecewise continuous function that is periodic with period 2L.
Suppose in addition that f has left- and right-hand derivatives at every point.
EXAMPLE 2.6 ◆ We have verified that the hypothesis of Corollary 2.4 holds for the periodic extension
f p of f .x / D x on x . Show that the conclusion of Corollary 2.4 holds
at any point of discontinuity.
The points of discontinuity are .2k C 1/ , the odd integral multiples of . We
have f p .T.2k C 1/ UC / D and f p .T.2k C 1/ U / D . Therefore,
f p .T.2k C 1/ UC / C f p .T.2k C 1/ U /
2
D 0:
We have also seen that the Fourier series of f is
1
X . 1/nC1
2 sin nx :
n D1
n
When x D .2k C 1/ every term in the series is equal to 0. Hence the series converges
to 0, so the conclusion of Theorem 2.5 is valid at x D .2k C 1/ . ◆
0
x
−3 −1 1 3
Since f is only defined over the interval T 1; 1U, we are really looking at the
Fourier series of its periodic extension f p , shown plotted in black in Figure 4. For
obvious reasons, f p is called the square wave. Since f (and f p ) is an odd function,
Theorem 1.24 says that only the sine terms are present in the Fourier series, and that
the coefficients are
Z 1 Z 1
bn D2 f .x / sin n x d x D2 sin n x d x D 2
n
T. 1/n 1 U:
0 0
Hence
b2n D0 and b2nC1 D .2n C4 1/ :
The Fourier series associated to f p (and to f ) is
1
4X
f p .x / sin.2n C 1/ x :
1
nD0 2n C 1
(2.9)
Gibb’s phenomenon
Suppose that the piecewise continuous function f has a discontinuity at x 0 , but that
the left- and right-hand derivatives of f exist at x 0 . As Theorem 2.3 points out, the
Fourier series of f converges at x 0 to T f .x 0C / C f .x 0 /U=2. However, if you look
closely at the graphs of the partial sums near the points of discontinuity in Figures 1,
2, and 4, we see that the graph of the partial sum overreaches the graph of the function
on each side of the discontinuity. This effect is called Gibb’s phenomenon.
To examine Gibb’s phenomenon a little more deeply, let’s look at the graphs of
some high order partial sums for the square wave. The partial sums S301 and S601
730 Chapter 12 Fourier Series
0
x
−3 −1 1 3
−1
Figure 4 The partial sum S11 (x) for the square wave in
Example 2.8.
1 1
0 0
x x
−0.01 0.01 −0.01 0.01
−1 −1
are plotted in Figures 5 and 6, but only for 0:01 x 0:01; so that we may
see the overrun clearly. Notice that both partial sums display the overrun that is
characteristic of Gibb’s phenomenon. In the two cases the amount of the overrun is
approximately the same, but for the higher order sum the duration is smaller.
It can be proved that whenever a function f satisfies the hypotheses of Theo-
rem 2.3, but has a discontinuity at x 0 , the graphs of the partial sums of the Fourier
series display Gibb’s phenomenon near x 0 . Furthermore, the ratio of the length
of the interval between the upper peak and the lower peak of the partial sum to
j f .x0C/ f .x0 /j is approximately 1:179 in every case.
The Riemann–Lebesgue Lemma
Notice that in every example we have considered, the Fourier coefficients approach 0
as the frequency gets large. This is demonstrated, in particular, in Figures 3, 9, and 14
in Section 1. These examples are typical of the behavior of Fourier coefficients, as
the next theorem, known as the Riemann-Lebesgue lemma, shows.
The intuitive reason behind this theorem is that as k gets very large, sin kx and
cos kx oscillate much more rapidly than does f (see Figures 1 and 2 in Section 1).
If k is large, f .x / is nearly constant on two adjacent periods of sin kx or cos kx. The
integral over each period is almost zero, since the areas above and below the x-axis
almost cancel.
1 h
X n x n x i
f .x / D C C bn sin
a0
an cos ; (2.11)
2 n D1
L L
except at those points where f is not continuous. Let’s look more closely at the nth
summand, which we can rewrite in terms of its amplitude and phase7 as
n x n x n x
f n .x / D an cos C bn sin D An cos n ; (2.12)
L L L
p
where An D an2 C bn2 and tan n D bn =an : We see that f n .x /, defined in (2.12), is
an oscillation with amplitude An and frequency8 !n D n = L : We will call f n the
component of f at frequency !n D n = L : Notice that !n D n !1 , where !1 D = L,
so all of the frequencies are integer multiples of the fundamental frequency !1 .
We can interpret Corollary 2.4 as saying that any function that satisfies its hy-
potheses is an infinite linear combination of oscillatory components at frequencies
that are integer multiples of the fundamental
p frequency. The component of f at
frequency !n has amplitude An D an2 C bn2 . The amplitude is a numerical measure
of the importance of the component in the Fourier expansion. By the Riemann–
Lebesgue lemma, the Fourier coefficients decay to 0 as n increases, so the amplitudes
An do as well. As a result, the components at the smaller frequencies dominate the
Fourier series in (2.11). This fact is illustrated by the plots of the magnitudes of the
coefficients in Figures 3, 9, and 14 in Section 1.
7
See Section 4.4.
8
This is an angular frequency. Remember that we are using angular frequencies instead of numerical
frequencies unless otherwise stated.
732 Chapter 12 Fourier Series
PROPOSITION 2.13 Suppose that f is a piecewise continuous function that is periodic with period 2L.
Then for any c the Fourier coefficients for f are given by
Z cC2L
n x
an D L1 f .x / cos
L
dx; for n 0;
c
Z cC2L
n x
bn D 1
L
f .x / sin
L
dx; for n 1:
c
In Exercises 7–14 find the sum of the Fourier series for indicated function at every
point in R without computing the series. Each of these is an exercise in Section 1.
Although that is not very important, the reference is included in parentheses.
(
0; x < 0;
7. f .x / D on T ; U (See Exercise 1.3)
x; 0 x
(
0; x < 0;
8. f .x / D on T ; U (See Exercise 1.4)
sin x ; 0 x
(
1 C x ; for 1 x 0
9. f .x / D on T 1; 1U (See Exercise 1.7)
1; for 0 < x 1
16. Compute the Fourier series for the function f .x / D x 2 on the interval T ; U:
(See Example 2.7.) Use the result and Theorem 2.3 to show that
1 1
. 1/nC1
D 12 D 6 :
X 2 X 1 2
and
n D1
n2 n D1
n2
17. Compute the Fourier series for the function f .x / D x 4 on the interval T ; U:
Use the result, Theorem 2.3, and Exercise 16 to show that
1 1
. 1/nC1
D 90 :
X 4 X 4
n4
D 7120 and
1
n4
n D1 n D1
in a Fourier series valid on the interval 1 x 1. Plot the graph of f and the
partial sums of order N for N D 5; 10; 20; and 40, as in Exercise 17 in Section
1. Notice how much slower the series converges to f in this example than in
Exercise 17 in Section 1. What accounts for the slow rate of convergence in this
example?
19. Expand the function f .x / D er x in a Fourier series valid for x . For
the case r D 1=2, plot the partial sums of orders N D 10; 20; and 30 of the
Fourier series along with the graph of f p over the intervals x and
2 x 2 .
20. Use the previous exercise to compute the Fourier coefficients for the function
f .x / D sinh x D .e x e x /=2 and f .x / D cosh.x / D .e x C e x /=2 over the
interval x .
21. Use Theorem 2.3 to determine the sum of the Fourier series of the function f
defined in Exercise 18 for each x in the interval 1 x 1.
22. Suppose that f is periodic with period T and differntiable. Show that f 0 is also
periodic with period T .
734 Chapter 12 Fourier Series
and
1
X n x
f .x / D C for 0 x L:
a0
an cos ;
2 n D1
L
The basic idea behind our method comes from Theorem 1.24.
f(x) = ex 0 For the function f .x / D e x on the interval T0; 1U, the even extension f e is plotted in
x blue in Figure 1.
Since the function f e is an even function defined on T L ; L U, Theorem 1.24 tells
−1 0 1
Figure 1 The even extension of us that its Fourier series has the form
f (x ) = e x . 1
X n x
f e .x / C x L;
a0
an cos ; for L (3.1)
2 n D1
L
where Z L
n x
an D 2
L
f e .x / cos
L
dx; for n 0:
0
12.3 Fourier Cosine and Sine Series 735
with the coefficients given by (3.2). The series in (3.3), with the coefficients given
in (3.2), is called the Fourier cosine series for f on the interval T0; L U.
EXAMPLE 3.4 ◆ Find the Fourier cosine series for f .x / D e x on the interval T0; 1U:
|an | The coefficients in (3.2) become
Z 1
an D2 e x cos n x d x D 1 C 2n 2 2 . 1 /n e 1 :
0
0
x
−3 −2 −1 0 1 2 3
is an odd function defined on T L ; L U, Theorem 1.24 tells us that its Fourier series
has only sine terms. Proceeding as before, we find that
1
X
f .x / bn sin nx ; for 0 < x L; (3.6)
n D1
where Z L
n x
bn D L2 f .x / sin
L
d x ; for n 1: (3.7)
0
The series in (3.6), with the coefficients given in (3.7), is called the Fourier sine
series for f on the interval T0; L U.
EXAMPLE 3.8 ◆ Find the Fourier sine series for f .x / D e x on the interval T0; 1U:
The coefficients in (3.7) become
D 2n 1T1C n.2 12 / eU :
Z 1 n
bn D2 e x sin n x d x
0
This evaluation can be done by direct computation, by looking the integral up in an
integral table, or by using a computer and a symbolic algebra program. Thus we
have
X1 2n T1 . 1/n eU
ex sin n x
n D1
1 C n 2 2
(3.9)
2.e C 1/ 4.e 1/ 6.e C 1/
1 C 2 sin x 1 C 4 2 sin 2 x C 1 C 9 2 sin 3 x C : : :
0
x
−3 −2 −1 0 1 2 3
−2
|bn | on the interval T0; 1U: The magnitude of the coefficients is plotted in Figure 5. Notice
that the sine coefficients do not decay nearly as rapidly as do the cosine coefficients
1 in Figure 2. The partial sum of order 3 is plotted in blue in Figure 6. It is inter-
esting to compare this figure with Figure 3. The black curve in Figure 6 is the odd
periodic extension of f .x / D e x , which we denote by f op . In this case f op satis-
fies the hypotheses of Corollary 2.4 and fails to be continuous only at the integers.
Consequently, the Fourier sine series converges to f op .x / everywhere except at the
integers. ◆
0 n Note that while we used the even and odd extensions of f ( f e and f o ) to help
0 10
derive the cosine and sine expansions, the formulas for an and bn involve only the
Figure 5 The Fourier sine function f on the interval T0; L U. This is reflected by the fact that the cosine and sine
coefficients for f (x) = e x . expansions converge to f only on .0; L /. Outside this interval the cosine and sine
expansions converge to f ep and f op , respectively. Examples 3.4 and 3.8 illustrate
these facts, but another example might help to put things into perspective.
EXAMPLE 3.10 ◆ Find the complete Fourier series for f .x / D e x on the interval T 1; 1U:
From (1.10) we have
Z 1
e 1=e
an D e x cos n x d x D. 1 /n
1 C n2 2
; for n 0;
1
Again there are several ways to verify this. Hence the complete Fourier series for e x
on T 1; 1U is
|an| and |bn|
( 1 )
C 1 .C n12/ 2 [cos n x
X n
2 ex D e
1
e
1
2
n sin n x] : (3.11)
n D1
1 The magnitude of the coefficients is plotted in Figure 7, with jan j in black and
jbn j in blue. The partial sum ofxorder 3 is plotted in blue Figure 8.
0 n The periodic extension of e satisfies the hypotheses of Corollary 2.4 and fails to
0 10 be continuous only at the odd integers. Consequently, the Fourier series converges
Figure 7 The coefficients of the to the periodic extension everywhere except at the odd integers. ◆
complete Fourier series for f (x) = Now we have three Fourier series that converge to f .x / D e x on the interval
e x. .0; 1/. The first in (3.5) contains only cosine terms. The second in (3.9) contains only
sine terms. The third in (3.11) contains both sine and cosine terms. It is interesting
to compare graphs of the partial sums in Figures 3, 6, and 8. The difference between
the three is what happens outside of the interval .0; 1/. The cosine series converges
to f ep , the even periodic extension of f . The sine series converges to f op , the odd
periodic extension of f , except at the integers. And, finally, the full Fourier series
converges to f p , the periodic extension of f , except at the odd integers.
Of course, the same three series can be considered for any piecewise continuous
function defined on an interval of the form T L ; L U.
738 Chapter 12 Fourier Series
x
−3 −2 −1 0 1 2 3
In exercises 5–8 sketch the graph of the even extension of the function f . Also
sketch the graph of the even periodic extension with period 2 over three periods.
5. f .x / D 1 x
6. f .x / D 1 2x
7. f .x / D x 2
1
8. f .x / D x 2 2
In Exercises 9 – 20 expand the given function in a Fourier cosine series valid on the
interval 0 x . Plot the function and two partial sums of your choice over the
interval 0 x . Plot the same partial sums and the function the series converges
to over the interval 3 x 3 .
9. f .x / D x
10. f .x / D sin x
11. f .x / D cos x
12. f .x / D 1
13. f .x / D x
14. f .x / D x 2
15. f .x / D x 3
16. f .x / D x 4
12.3 Fourier Cosine and Sine Series 739
(
1; 0 x < =2;
17. f .x / D
0; =2 x
(
x; 0 x < =2;
18. f .x / D
=2; =2 x
19. f .x / D x cos x
20. f .x / D x sin x
In Exercises 21 – 32 expand the given function in a Fourier sine series valid on the
interval 0 x . Plot the function and two partial sums of your choice over the
interval 0 x . Plot the same partial sums and the function the series converges
to over the interval 3 x 3 .
21. Same as Exercise 9
22. Same as Exercise 10
23. Same as Exercise 11
24. Same as Exercise 12
25. Same as Exercise 13
26. Same as Exercise 14
27. Same as Exercise 15
28. Same as Exercise 16
29. Same as Exercise 17
30. Same as Exercise 18
31. Same as Exercise 19
32. Same as Exercise 20
33. Show that the functions cos.n x = L /, n D 0 ; 1; 2; : : : are orthogonal on the
interval T0; L U. This means that
Z L
cos.n x = L / cos. p x = L / d x D 0; if p 6D n :
0
Hint: Use Exercise 23.
34. Show that the functions sin.n x = L /, n D 1; 2; 3; : : : are orthogonal on the
interval T0; L U. This means that
Z L
sin.n x = L / sin. p x = L / d x D 0; if p 6D n :
0
Hint: Use Exercise 23.
35. Show that Z 1
cos.2n x / sin.2k x / d x D 0:
0
740 Chapter 12 Fourier Series
Sometimes it is useful to express the Fourier series in complex form using the complex
exponentials, einx for n D 0; 1; 2; : : : . This is possible because of the close
connection between the complex exponentials and the trigonometric functions. We
explored this connection in the appendix to this book and in Section 4.3. The most
important facts to know about the complex exponential are Euler’s formula
eiy D cos y C i sin y ; (4.3)
which defines the exponential, and that all of the familiar properties of the real
exponential remain true for the complex exponential.
If we write down Euler’s formula with y replaced by y, we get
e iy
D cos y i sin y : (4.4)
Solving (4.3) and (4.4) for cos y and sin y, we see that
D e C2 e
iy iy iy iy
cos y and sin y De 2i
e
: (4.5)
Let’s substitute these expressions into the Fourier series (4.1). The nth term in the
sum is the component of f at the frequency !n D n = L, and it becomes
n x
n x
f n .x / D an cos C bn sin
L L
D2 e
an in x = L
Ce in x = L
C b2in ein x =L e in x = L
(4.6)
D an 2 i bn ein x =L C an C2 i bn e in x =L
D n ein x =L C n e in x =L ;
12.4 The Complex Form of a Fourier Series 741
n D an 2
i bn
and n D an C2 i bn ; for n 1. (4.7)
We will also write the constant term as f 0 .x / D 0 D a0 =2: Separating the positive
and negative terms, the Fourier series can be written as
1
X
f .x / n ein x = L : (4.8)
nD 1
Notice that by (4.6), the component of f at frequency !n D n = L is given by
f n .x / D n ei !n x C n e i !n x : As a result, when we talk in terms of low frequency
components we have to consider the coefficients n and n for small values of n.
We can use (4.2) to express the coefficients n in terms of the function f . For
example, for n 1 we have
n D an 2
i bn
Z L h n x n x i
D 1
2L
f .x / cos
L
i sin
L
dx
L
Z L
D 1
2L
f .x /e in x = L
dx:
L
The corresponding formulas for n D 0 and for n < 0 can be computed in the same
way, and we discover that
Z L
n D 1
2L
f .x /e in x = L
dx; for all n. (4.9)
L
EXAMPLE 4.10 ◆ Find the complex Fourier series for the function f .x / D e x on the interval T 1; 1U:
This is the function we examined in Examples 3.4, 3.8, and 3.10. For this
function it is much easier to compute the complex Fourier coefficients than the real
742 Chapter 12 Fourier Series
Figure 1 The coefficients of the The last identity follows since ein D e in D . 1/n :
complex Fourier series for f (x) = The magnitude of the coefficients is plotted in Figure 1. Notice that we included
e x. negative indices. The complex Fourier series is
1
1=e X . 1/n in x
ex e 2 1 i n
e for 1x 1: ◆
nD 1
These equations simplify somewhat if the function f is real valued. In that case
f .x / D f .x /; so
Z L Z L
n D 2L1 f .x /e in x = L dx D 2L1 f .x / e in x = L dx
L L
Z L
D 2L1 f .x /ein x = L d x D n :
L
an D n C n D 2 Re n and bn D i .n n / D 2 Im n :
EXAMPLE 4.12 ◆ Compute the coefficients of the real Fourier series for the function f .x / D e x on the
interval T 1; 1U:
We computed the complex coefficients in Example 4.10 and found that
n D 2.1. 1/n
i n /
.e 1=e/:
12.5 The Discrete Fourier Transform and the FFT 743
Since the function is real valued, we can use (4.11) to find that
an D 2 Re n D . 1/n .e 1=e/
1 C n2 2
and
................
EXERCISES
1. Show that the complex Fourier coefficients for an even, real-valued function are
real. Show that the complex Fourier coefficients for an odd, real-valued function
are purely imaginary (i.e., their real parts are zero).
In Exercises 2–11 find the complex Fourier series for the given function on the
interval T ; U.
2. f .x / D x
3. f .x / D jx j
(
1; x < 0;
4. f .x / D
1; 0x
(
0; x < 0;
5. f .x / D
1; 0 x
6. f .x / D x 2
7. f .x / D ebx
8. f .x / D x 3
9. f .x / D x
10. f .x / D j cos x j
11. f .x / D j sin x j
12. Two complex valued function f and g are said to be orthogonal on the inter-
Rb
val Ta ; bU if a f .x /g .x / d x D 0: Show that The functions ei px and eiq x are
orthogonal on T ; U if p and q are different integers.
13. Use the P
method of proof of Theorem 1.17, and Exercise 12 to show that if
f .x / D n1D 1 n einx for x , then
Z
n D 21 f .x /e inx
dx:
744 Chapter 12 Fourier Series
The Fourier coefficients k are often too difficult to compute exactly. In such a case
it is useful to approximate the coefficients using a numerical integration technique
such as the trapezoid rule.
We remind you that for a function F defined on the interval T0; 2 U, the trapezoid
R 2
rule for approximating the integral 0 F .t / dt with step size h D 2= N is
Z 2
F .t / dt h F .0/ C F .h / C F .2h / C C F .. N 1 /h / C
1 1
F .N h/ :
0 2 2
If F .t / is 2 -periodic, then F .0/ D F .2/ D F . N h /, and the preceding formula
becomes
Z 2
2 X
N 1
X N 1
F .t / dt h F . j h/ D
N j D0
F .2 j = N /:
0 j D0
Applying this formula to the integral for the Fourier coefficient in (5.1), we get
Z 2 N 1
X
k D 21 f .t /e ikt
dt N1 f .2 j = N /e 2 i j k= N : (5.2)
0 j D0
Let’s set
yj D f .2 j = N / and w D e 2 i = N :
Then w De 2 i = N
, and the approximation becomes
N 1
1 X
k N j D0
y jw jk: (5.3)
The sum on the right side of equation (5.3) involves the discrete values y j D
f .2 j = N /. The values of f .t / for t 6 D 2 j = N are ignored. It is a common
occurrence in the digital age to replace a time dependent function with such a discrete
sample of that function. For example, f .t / may represent a music signal that we want
to transmit over the internet. The internet, or any other computer network, allows
only discrete signals, so to transmit the music we replace the continuous signal f .t /
with the discrete sample y j D f .2 j = N / for j D 0; 1; 2; : : :; N 1:
In many digital applications signals arise that are not represented by a continuous
function at all. Instead, they arise as discrete values y j at a discrete set of times t j .
Such a signal is illustrated in Figure 1. Here, the horizontal axis represents time,
which has been divided into many small time intervals.
9
In most applications of the material in this section, the function f represents a time dependent signal.
Consequently, we will use t instead of x as the independent variable.
12.5 The Discrete Fourier Transform and the FFT 745
For the last expression in (5.5) we use the notation w D e2 i =N , so that w D
e 2 i = N .
k byNk D by NN k :
Therefore, when considering small frequency components while using the discrete
Fourier transform, we must include both b
yk and b
y N k for small nonnegative values
of the index k.
746 Chapter 12 Fourier Series
EXAMPLE 5.7 ◆ Use the discrete Fourier transform to compute approximately the first 64 Fourier
coefficients of the function
f .t / D e t 2 =10
[sin 2t C 2 cos 4t C 0:4 sin t sin 10t]
on the interval T0; 2 U.
f(t) The function f is plotted in Figure 2. Because of the terms involving sin 2t and
cos 4t, we would expect that the Fourier coefficients of order 2 and 4 would be large.
With N D 64; we set y j D f .2 j = N / for 0 j N 1. Then we use the fast
2
Figure 2 The function in Now let’s look at (5.5) and restrict ourselves to k D 0; 1; : : : ; N 1. The kth
Example 5.7. yk as a linear combination of f y j j 0 j N 1g: These N
equation expresses b
equations can be expressed as the single matrix equation
0 1 0 10 1
b
y0 1 1 1 1 y0
B
B b
y1 C
C
B
B1 w w2 wN 1 C CB
B
y1 C
C
B
B b
B
y2
C
C
B
CDB1
B
w2 w4 C
w 2. N 1/ C
CB
B
B y2
C
C:
C (5.8)
B :: C B :: :: :: ::: :: C B :: C
: A : : : : A : A
b
yN 1 1 wN 1
w 2. N 1/
w . N 1/2
yN 1
|yˆk|
It will be useful to use vector notation. We will set
y D . y0 ; y1 ; : : : ; y N
/T ;
20
1 and
y D .b
b y0 ; b
y1 ; : : : ; b
y N 1 /T :
FF D NI or F 1
D N1 F :
The computation of F F is not too difficult. For example, when N D 3,
0 10 1
1 1 1 1 1 1
FF D 1 w w 2 A
1 w w2 A :
1 w2 w 4
1 w2 w4
An explicit computation shows that this matrix product is 3I . For example, the
.2; 1/-entry of this matrix product is
w3
1 C w C w2 D 11 D 0;
w
since w 3 D 1: On the other hand, the .2; 2/-entry is
1 C jw j2 C jw j4 D 3:
We summarize this discussion in the next theorem.
THEOREM 5.11 The original signal y j , j D 0; : : : ; N 1, can be computed from its discrete Fourier
yk , k D 0; : : : ; N 1, using
transform, b
N 1
X
yj D N1 yk w
b
jk
; for 1 < j < 1:
k D0
yD
1
y:
Fb (5.12)
N
748 Chapter 12 Fourier Series
Noise filtering
Practical applications of this theorem are numerous. We will mention two. The
first involves filtering noise from a signal. When a signal is transmitted, it is often
corrupted by interference from background radiation or other sources. The corrupted
part of the signal is called noise. In many applications, the noise appears with a certain
frequency range that is different from the dominant frequencies of the original signal.
To filter out noise, a discrete Fourier transform of the signal is computed using (5.8).
Then, the Fourier coefficients, b yk , corresponding to the noisy, undesirable frequencies
are set equal to zero. The signal is then recomputed from the new Fourier coefficients
using equation (5.12). Since the frequency components corresponding to the noise
have been removed, the resulting signal should contain much less noise than the
original.
Frequently, noise occurs at relatively high frequencies. Suppose that we add the
noise term N .t / D 2 sin.50t / to the function in Example 5.7. The resulting signal
is g .t / D f .t / C N .t /; and it is plotted in Figure 4. It is difficult to see that the
signal of interest is the function f .t / plotted in Figure 2. We set y j D g .2 j = N / for
0 j N 1, with N D 256, and take the discrete Fourier transform. The result
is plotted in Figure 5. Notice the large terms at k D 50 and k D 206 D N 50: To
eliminate the high frequency noise, we “zero out” the high frequency coefficients by
setting b yk D 0 for 13 k N 13 D 243; and compute the inverse transform. The
resulting function is plotted in blue in Figure 6, while the original function f is plotted
in black. The graphical comparison shows that we have effectively recovered the
wanted signal from the noisy one. The most significant difference occurs at the two
endpoints. This is a result of Gibb’s phenomenon. Since f p , the periodic extension
of f , is not continuous, we have to expect this.
|yˆk|
g(t)
2 2
0 t 0 t
0 π 2π 0 π 2π
k
−2 0 128 255 −2
Figure 4 A signal in the Figure 5 The discrete Fourier Figure 6 The result of filtering
presence of high frequency transform of the noisy signal. out the high frequencies.
noise.
Data compression
A second application involves data compression. The goal is to store or transmit
a signal using the fewest possible bits of data. One way to accomplish this is to
store or transmit only the dominant Fourier coefficients of a given signal. In view
of the Riemann–Lebesgue Lemma, Theorem 2.10, only a finite number of Fourier
coefficients are dominant, since these coefficients get very small as the frequency
12.5 The Discrete Fourier Transform and the FFT 749
The idea is to compute b y;k first using (5.14), and then compute the Fourier
transform using (5.15). The savings in the computation comes from realizing that
y;k is periodic in k with period q. To see this, we first remember that w N D 1 and
b
N D pq. Then we have
q 1 q 1
X X
y;kCq
b D y pC w p .kCq /
D y pC w pk D by;k :
D0 D0
750 Chapter 12 Fourier Series
................
EXERCISES
All of these exercises are designed to be done with a mathematical computer program
such as Matlab, Maple, or Mathematica.
1. Consider the function
f .t / D e t 2 =10
.cos 2t C 2 sin 4t C 0:4 cos 2t cos 40t / :
For what values of n would you expect the Fourier coefficients to be largest?
Why? Compute the coefficients numerically through n D 50 and see if you are
right. (You can use a fast Fourier transform algorithm with N D 256 to do this if
you wish.) Plot the partial sum of the Fourier series of order n D 6 and compare
with the plot of the original f .x /.
2. Consider the function
g .t / D e t 2 =8
[cos 2t C 2 sin 4t C 0:4 cos 2t cos 10t] ;
for 0 t 2: Compute numerically the partial sum of the Fourier series of
order N D 25. Zero out any coefficients that have absolute value smaller than
10% of the maximum. Plot the resulting series and compare with the original
function g .t /. Try experimenting with different tolerances (other than 10%).
3. Show that if y D f ym g is a sequence of real numbers that is periodic with period
N and by is the discrete Fourier transform of y, then the complex conjugate of b ym
is b
y N m . (As a result, when m is small relative to N , b
y N m has to be considered
a low frequency coefficient, since it is equal to the conjugate of b ym , which is
approximately equal to the conjugate of the mth Fourier coefficient.)
The next three problems require the use of the fast Fourier transform on a computer
(e.g., Maple or Matlab’s FFT routine).
12.5 The Discrete Fourier Transform and the FFT 751
4. Filtering Let
f .t / D e t 2 =10
.sin.2t / C 2 cos.4t / C 0:4 sin.t / sin.50t // :
Discretize f by setting yk D f .2k =256/; for k D 0 : : : 255. Use the fast
Fourier transform to compute b yk for 0 k 255. According to Exercise 3, the
low-frequency coefficients are b y0 : : : b y256 m : : : b
ym and b y255 for some low value
of m. Filter out the high-frequency terms by setting b yk D 0 for m k 255 m
with m D 6. Apply the inverse fast Fourier transform to this new set of b yk to
compute the yk (now filtered); plot the new values of yk and compare with the
original function. Experiment with other values of m.
5. Compression Let tol D 0:01. In Exercise 4, if jb yk j < tol M, where M D
max0k255 jbyk j, set b
yk equal to zero. Apply the inverse fast Fourier transform
to this new set of byk to compute the yk . Plot the new values of yk and compare
with the original function. Experiment with other values of tol. Keep track of
the percentage of Fourier coefficients that have been filtered out. Matlab’s sort
command is useful for finding a value for tol in order to filter out a specified
percentage of coefficients.
6. Repeat the previous two exercises over the interval 0 t 1 with the function
f .t / D 52t 4 C 100t 3 49t 2 C 2 C N .100.t 1=3//
C N .200.t 2=3//
where N .t / D te t2
: