7.6 Fourier Series

Back

Suppose we have some set of pairwise orthogonal vectors {vj : j 2 J} and a

vector P not in the span of the {vj}. We can still take the projections of P

on the vj and sum them. This time we don’t get back to P, but we get as

close as we could get and still be in the span of the {vj}:

Proposition 7.6.1. In an inner product space, if

8 j 2 J, uj =

< P, vj >

< vj , vj >

vj

and V = span{vj : j 2 J} then

Q =

X

j2J

uj

is the closest point of V to P.

Proof:

It is easy to see by writing out

< (P − Q), vi >

that P − Q is orthogonal to each of the vj and so P − Q is orthogonal to

the subspace V . By Pythagoras theorem, the distance from P to any other

point of V is greater than the length of P − Q. _

146 CHAPTER 7. FOURIER THEORY

Remark 7.6.1. This tells us that when we write the set of projections for a

given function f on the sine and cosine functions sin(nx), cos(mx) for n,m 2

Z+, that as we take increasingly large integers we are getting closer to f. Now

the question comes up: how close do we actually get in the limit?

Definition 7.6.1. A set of vectors B in an inner product space V is a Topological

Basis for V iff

8 v 2 V, 9 {vj : j 2 Z+} _ B, 9 {tj : j 2 Z+} _ R :

v =

X1

1

tj vj , lim

n!1

Xn

1

tj vj

where the limit is in the metric derived from the inner product, and

8 n 2 Z+, 8 tj 2 R, 8 vj 2 B,

X

tjvj = 0 ) 8 j 2 [1 · · · n], tj = 0

Remark 7.6.2. There is another sort of basis which we shall not deal with,

so I shall just drop the word ‘topological’ and refer to a basis.

Exercise 7.6.1. Show that if the elements of B are pairwise orthogonal, that

is if the inner product for any two distinct elements is zero and if B does not

contain the vector 0, then the second (independence) condition is satisfied.

Remark 7.6.3. I want to show that the trigonometric functions form a basis

for the space PC[−_, _]. First let’s be clear that what we mean here is that

(a) the above set of functions is an orthogonal set and since it does not

contain the zero function must be independent by the last exercise, and (b)

any piecewise continuous function is the limit in the mean of scaled sums of

functions in this set. in the mean means that we have convergence in the L2

metric.

The argument depends on two subsidiary propositions, one of which is a

well known theorem called the Weierstrass Approximation Theorem which

is too hard for the course. It states that any continuous function can be

approximated by a sequence of trigonometric functions uniformly. I shall

explain precisely what this means soon. The other is that any piecewise

continuous function on a closed interval can be approximated by a continuous

function in the mean. I shall prove this shortly. First the statement of the

Weierstrasss Theorem:

7.6. FOURIER SERIES 147

Figure 7.5: Uniform convergence to f

Theorem 7.1. Weierstrass For any continuous function

f : [_, _] −! R

with f(_) = f(−_) and for any " 2 R+, there exists a trigonometric polynomial

P(x) = a0 +

jX=N

j=1

aj cos(jx) + bj sin(jx)

such that

8x 2 [−_, _], |P(x) − f(x)| < "

Remark 7.6.4. Note that N will depend rather a lot on " and will be bigger

the smaller " is. Note also that N does not depend on x. This is a strong

sort of convergence called uniform convergence. You can see that it is telling

us that we can find P that is wholly contained in a tubular region around

the graph of f, as in figure 7.5

The tube has height 2" of course.

Remark 7.6.5. You will find a proof of this theorem as a special case of the

Stone-Weierstrass Theorem in George Simmons’ nice little book Introduction

to Topology and Modern Analysis although you need to be told that the

topology in it is point set topology, not proper topology. There is a direct

148 CHAPTER 7. FOURIER THEORY

Figure 7.6: The Gibbs Effect

proof in the excellent An Introduction to Linear Analysis by Kreider, Kuller,

Ostberg and Perkins.

Remark 7.6.6. The latter has a nice analysis of the Gibbs Phenomenon,

showing that the ‘overshoot’ is computable. In fact they compute the overshoot

as a multiple of the actual value: it turns out to be:

2

_

Z _

0

sin(t)

t

dt

Mathematica gives this as approximately) 1.178979744472167270232029, an

overshoot of nearly 18% which is quite big. Unfortunately there is an error

in the computation for my edition of KKOP, they give 1.089490, just under

9% overshoot, half the Mathematica value.

The graph for the square wave close to height 1 is shown in figure 7.6: this

is just the result of applying a magnifying glass to figure 7.3.

Note that the overshoot does not change much as we add more terms, it

just gets closer to the point of discontinuity. The overshoot may be seen

as a legitimate protest from a nicely behaved, properly brought up, smooth

function being forced to approximate a nasty, rough discontinuous one.

Remark 7.6.7. Mathematica sure makes finding errors easy. Except when

they are bugs in Mathematica of course. In this case it is hard to doubt that

there is an error in the text. My edition is dated from 1966, back in the stone

age when sums like this were a lot of work.

Remark 7.6.8. This leaves the matter of being able to approximate a piecewise

continuous function by a continuous one. I deal with the case of one

7.6. FOURIER SERIES 149

Figure 7.7: Approximating a discontinuity

discontinuity and leave the case of several as an exercise for the sceptical.

The argument is contained entirely in figure 7.7 where the step discontinuity

is bridged by a continous approximation; the replacement function goes

along the dotted line.

Proposition 7.6.2. If f is a function with a step discontinuity, it can be

approximated as closely as may be required in the L2 metric by a continuous

function.

Proof:

The distance between the two functions in the L2 metric is the integral of

the square of the difference function, which is zero outside the box and is

roughly the area of the region between the curves inside the box. We can

make this as small as we like by making the box thinner, that is by making

the dashed line more and more nearly vertical. _

Proposition 7.6.3. The set of functions {cos(nt), n 2 N} [ {sin(nt) : n 2

Z+} is a basis for PC[−_, _].

Proof:

For any " 2 R+, and for any f 2 PC[−_, _], we can find a continuous

function ˜ f which differs from f in the L2 metric by less than "/2 by the

above argument applied to all the points of discontinuity of f. We can make

sure that ˜ f(_) = ˜ f(−_) by the same method.

We can find, according to Weierstrass, a trigonometric polynomial P which

differs from ˜ f by less than "/

p

8_ at every point of [−_, _], and which therefore

is of distance less than "/2 in the L2 metric. The triangle inequality

ensures that the distance between P and f in the L2 metric is less than ".

This shows that we can find a sequence of trigonometric polynomials which

converges to f in the space PC[−_, _] with the L2 metric. So the set of

trigonometric polynomials spans PC[−_, _]. We have already seen that the

150 CHAPTER 7. FOURIER THEORY

orthogonality property means the set of trigonometric polynomials is linearly

independent, so they are a basis. _

Remark 7.6.9. This shows where a bit of linear algebra can get you. The

power of abstraction is allowing us to do things in infinite dimensional function

spaces that are extensions of what we can do in two and three dimensions.

This is very cool.

Definition 7.6.2. The basis described in the above proposition is called the

Fourier basis.

Definition 7.6.3. The values of the projection coefficients onto the Fourier

basis vectors of any function f are called the Fourier coefficients for f.

Definition 7.6.4. The trigonometric series for f is called the Fourier Series

for f, or its Fourier Expansion.

Remark 7.6.10. Notations vary: in ours the function cos(0t) = 1 has coefficient

a0 =

R _

−_ f(t)dt R

1dt

Other authors have an a0 twice this. The reason is that the square of the

norm of each vector sin(kt), cos(kt) is _ for k _ 1 and 2_ for the function 1.

Some authors normalise the basis so that instead of working with cos(kt) we

work with 1/

p

_ cos(kt) and similarly for sin(kt) and the constant function

1/

p

2_. I shan’t do this, instead I have:

8 f 2 PC[−_, _], f = a0 +

X1

j=1

aj cos(jt) + bj sin(jt)

where

a0 =

R _

−_ f(t)dt

2_

; aj =

R _

−_ f(t) cos(jt)dt

_

, bj =

R _

−_ f(t) sin(jt)dt

_

for j 2 Z+.

Corollary 7.2. Parseval’s Equality For every f 2 PC[−_, _],

1

_

Z _

−_

(f(t))2 dt = 2a20

+

X1

j=1

(a2j

+ b2j

)

where the aj and bj are the Fourier coefficients for f.

7.6. FOURIER SERIES 151

Proof:

Given

f = a0 +

X1

j=1

aj cos(jt) + bj sin(jt)

we have

< f, f >=

Z _

_

(f(t))2dt

=

Z

(a0 +

X1

j=1

aj cos(jt) + bj sin(jt))(a0 +

X1

j=1

aj cos(jt) + bj sin(jt)) dt

=

Z

a20

+

X1

j=1

a2j

Z

cos2(jt) + b2j

Z

sin2(jt)

= 2_a20

+ _

X1

j=1

a2j

+ b2j

which gives the required result when we divide by _. _

Remark 7.6.11. Again, be warned that this can have different forms if the

basis functions are normalised. Engineers who do signal and image processing

will hear their lecturers talk about the energy in the signal being preserved

by the transformation.

A very strong form of convergence occurs when the function f is piecewise

differentiable. The following theorem gives lots of fascinating results. Unfortunately

I don’t have the time to prove it:

Proposition 7.6.4. If f : [−_, _] −! R is piecewise differentiable, then

the Fourier series converges pointwise to f(x) on every interval on which

f is differentiable, and when limx"a f(x) 6= limx#a f(x), the Fourier series

converges to

1

2

_

lim

x"a

f(x) + lim

x#a

f(x)

_

Remark 7.6.12. To show where this gets you, remember the series for

sign(x) and note that

4

_

_

sin(x) +

sin(3x)

3

+

sin(5x)

5

+ · · ·

_

converges to 0 at 0,±_ and to +1 for x 2 (0, _). So when x = _/2 we deduce

that

1 =

4

_

(1 −

1

3

+

1

5

1

7

+

1

9

− · · · )

152 CHAPTER 7. FOURIER THEORY

or

_

4

= 1 −

1

3

+

1

5

1

7

+

1

9

− · · ·

which is not otherwise particularly obvious.

Exercise 7.6.2. By finding the Fourier series for y = |x| and evaluating it

at the origin, obtain a series for _2.

Exercise 7.6.3. By evaluating the Fourier series for y = x2 at the origin,

obtain another series for _2.

Remark 7.6.13. Sometimes we have a function defined on some other interval.

It is simple to transform the domain back to [−_, _] by an affine map

and needs no new ideas.

Exercise 7.6.4. Find the right functions to do Fourier Theory for piecewise

continuous functions defined for the interval [1,

p

5].