Lecture5 Fourier
Lecture5 Fourier
Lecture 5:
Fourier series
1 Fourier series
When N oscillators are strung together in a series, the amplitude of that string can be described
by a function A(x, t) which satisfies the wave equation:
2 2
∂ 2 ∂
−v A(x, t) = 0 (1)
∂t2 ∂x2
We saw that electromagnetic fields satisfy this same equation with v = c the speed of light.
We found normal mode solutions of the form
ω
A(x, t) = A0cos (x ± vt) + φ (2)
v
for any ω which are traveling waves. Solutions of the form
A(x, t) = A0cos(kx)cos(ωt) (3)
with ω 2 = v 2k 2 are called standing waves. Whether traveling waves or standing waves are rele-
vant depends on the boundary condition.
More generally, we found traveling wave solutions could come from any function f (x + vt):
2 2
∂ 2 ∂
− v f (x + vt) = 0 (4)
∂t2 ∂x2
Similarly f (x − vt) is a solution. Functions f (x − vt) are right-moving traveling waves and func-
tions f (x + vt) are left-moving traveling waves.
Now, since any vector can be written as a sum of eigenvectors, any solution can be written
as a sum of normal modes. This is true both in the discrete case and in the continuum case.
Thus we must be able to write
X
f (x + vt) = akcos( kx )cos(ωt) + bksin(kx)cos(ωt) + ckcos(kx )sin(ωt) + dksin(kx)sin(ωt) (5)
k
where the sum is over wavenumbers k. In particular, at t = 0 any function can be written as
X
f (x) = akcos(kx ) + bksin(kx) (6)
k
2 Fourier’s theorem
Fourier’s theorem states that any square-integrable function1 f (x) which is periodic on the
interval 0 < x 6 L (meaning f (x + L) = f (x)) can be written as
∞ X ∞
X 2πn 2πn
f (x) = a0 + ancos x + bnsin x (7)
L L
n=1 n=1
L
d xf (x)2 exists.
R
1. A function is square-integrable if 0
1
2 Section 2
with Z L
1
a0 = dxf (x) (8)
L 0
2 L
Z
2πn
an = dxf (x) cos x (9)
L 0 L
Z L
2 2πn
bn = dxf (x) sin x (10)
L 0 L
This decomposition is known as a Fourier series. Fourier series are useful for periodic func-
tions or functions on a fixed interval L (like a string). One can do a similar analysis for non-
periodic functions or functions on an infinite interval (L → ∞) in which case the decomposition
is known as a Fourier transform. We will study Fourier series first.
It is easy to verify these formulas for an and bn. For a0, we just integrate f (x). Since
2π
cos L nx goes through n cycles of the complete cosine curve as x goes from 0 to L, we have
Z L
2πn
dx cos x =0, n > 0 (11)
0 L
Similarly,
L
Z
2πn
dx sin x =0, n>0 (12)
0 L
Thus,
Z L Z L ∞ Z L
X∞ Z L
X 2πn 2πn
dxf (x) =a0 dx+ an dx cos x + bn dx sin x (13)
0 0 0 L 0 L
n=1 n=1
=a0L (14)
in agreement with Eq. (8).
For an we can use the cosine sum formula to write
Z L Z L
2πm 2πn 1 n+m 1 n−m
dx cos x cos x = dx cos 2πx + cos 2πx (15)
0 L L 0 2 L 2 L
Now again we have that these integrals all vanish over an integer number of periods of the
cosine curve. The only way this wouldn’t vanish is if n − m = 0. So we have for n > 0
Z L Z L
2πm 2πn 1 L
dx cos x cos x = δm n dx = δm n (16)
0 L L 2 0 2
where δm n is the Kronecker δ-function
0, m = /n
δm n = (17)
1 m=n
Similarly, Z L
2πm 2πn
dx cos x sin x =0 (18)
0 L L
Z L
2πm 2πn L
dx sin x sin x = δm n (19)
0 L L 2
Thus, for n > 0
Z L
2πn
dxf (x) cos x (20)
0 L
Z L " ∞ X ∞ #
X 2πm 2πm 2πn
= dx a0 + amcos x + bmsin x cos x (21)
0 L L L
m=1 m=1
∞
LX
= amδm n (22)
2
m=1
L
= an (23)
2
Example 3
as in Eq. (9). In the same way you can check the formula for bn.
We use
• Fourier cosine series for functions which are even on the interval (f (x) = f (L − x))
• Fourier sine series for functions which are odd on the interval (f (x) = −f (L − x))
• For functions that are neither even nor odd on the interval, we need both sines
and cosines
3 Example
Find the Fourier series for the sawtooth function:
2.0
1.5
1.0
0.5
0.0
- 0.5
-1.0
0 1 2 3 4 5
This function is clearly periodic. It is equal to f (x) = x on the interval 0 < x 6 1. Thus we
can compute the Fourier series with L = 1. We get
Z 1
1 L
Z
1
a0 = f (x) = dxx = (24)
L 0 0 2
Next,
Z 1
2 L
Z
2πn
an = dxf (x) cos x =2 dxx cos(2πnx) (25)
L 0 L 0
1
=− (29)
πn
Thus we have
∞
1 X 1 2πnx
f (x) = + − sin (30)
2 πn L
n=1
Let’s look at how well the series approximates the function when including various terms.
Taking 0, 1 and 2 terms in the sum gives
4 Section 4
Already at 3 modes, it’s looking reasonable. For 5, 10 and 100 modes we find
2.0 2.0 2.0
1.5 1.5 1.5
1.0 1.0 1.0
0.5 0.5 0.5
0.0 0.0 0.0
- 0.5 - 0.5 - 0.5
-1.0 -1.0 -1.0
0 1 2 3 4 0 1 2 3 4 0 1 2 3 4
4 Plucking a string
Let’s apply the Fourier decomposition we worked out to plucking a string. Suppose we pluck a
string by pulling up one end:
What happens to the string? To find out, let us do a Fourier decomposition of the x-dependence
of the pluck. We start by writing
∞
X 2nπ 2nπ 2nπ
A(x, t) = ancos x cos(ωnt) + bnsin x cos(ωnt) , ωn = v (31)
L L L
n=0
2nπ
Here v is the speed of sound in the string. For a given wavenumber, kn = L , we know that
ωn = knv to satisfy the wave equation. We could also have included components with sin(ωnt);
however since the string starts off at rest (so that ∂tA(x, t) = 0), then the coefficients of the
sin(ωnt) functions must all vanish.
At time t = 0, the amplitude is
∞
X 2nπ 2nπ
A(x, 0) = ancos x + bnsin x (32)
L L
n=0
This is just the Fourier decomposition of the function described by our pluck shape. If we
approximate the pluck as the sawtooth function from the previous section, then we already
know that
1
an = 0, bn = − (33)
πn
Exponentials 5
So that, setting L = 1
∞
X 1
A(x, t) = − sin(2πx)cos(2πvt) (34)
πn
n=1
Figure 4. Amplitudes of the relative harmonics of a string plucked with a sawtooth plucking.
The n = 1 mode is the largest. This the fundamental frequency of the string. Thus the
2π
sound that comes out of the string will be mostly this frequency: ω1 = L v. The modes with n >
1 are the harmonics. Harmonics have frequencies which are integer multiples of the funda-
mental.
5 Exponentials
Fourier series decompositions are even easier with complex numbers. There we can replace the
sines and cosines by exponentials. The series is
∞ 2π
in x L
X
f (x) = cne (35)
n=−∞
where
Z L
1 −i nx
2π
cn = dxf (x)e L (36)
L 0
If n =
/ m then,
Z L
i (m−n) x L
2π
L 1 2π
i (m−n) L x L
dxe = e (38)
0 2π m − n 0
L 1 i2π(m−n)
= e −1 =0 (39)
2π m − n
If m = n, then the integral is just
Z L
dx = L (40)
0
Thus,
Z L 2π
i (m−n) x L
dxe = Lδm n (41)
0
and so
Z L 2π
−in x L
dxf (x)e = Lcn (42)
0
6 Section 6
So an = Re(cn + c−n) and bn = Im(c−n + cn). Thus, the exponential series contains all the infor-
mation in both the sine and cosine series in an efficient form.
1 L
Z
2πm 2πn
dx cos x sin x =0 (45)
L 0 L L
1 L
Z
2πm 2πn 1
dx cos x cos x = δnm (46)
L 0 L L 2
Z L
1 2πm 2πn 1
dx sin x sin x = δn m (47)
L 0 L L 2
These are examples of orthogonal functions. The integral is a type of inner product. The dot-
product among vectors is another example of an inner product. We can write the inner product
in various ways
X
hv |wi ≡ ~v · w
~= viwi (48)
i
The integral inner product is a generalization of this from vectors of numbers to functions.
We can define the inner product of two functions as
1 2π
Z
hf |g i = dxf ⋆(x)g(x) (49)
2π 0
where f ⋆(x) is the complex conjugate of f (x). For example,
where |xi i = (0, ···, 0, 1, 0, 0) with the 1 in the ith component. That is the |xi i are the unit vec-
tors. When a set of functions satisfy
hfi |f j i = δi j (52)
we say that they are orthonormal. The ortho part means they are orthogonal: hfi |f j i = 0
for i =
/ j. The normal part means they are normalized, hfi |f j i = 1 for i = j.
If any function can be written as a linear combination of functions fi we say that the set
{fi } is complete. Then
X
f (x) = aifi(x) (53)
i
We can extract ai via
X X
hf (x)|fi i = a j hf j |fi i = a jδij = ai (54)
j j
Orthogonal functions (optional) 7
This is exactly what we did with the Fourier decomposition above. It is also what we do with
vectors
X
~v = ci~xi (55)
Bessel functions come up in 2 dimensional problems. You will start to see them all over the
place in physics.
Legendre polynomials Pn. These satisfy P0(x) = 1, P1(x) = x and
(n + 1)Pn+1(x) = (2n + 1)xPn(x) − nPn−1(x) (58)
Their inner product is Z 1
2
hPn |Pm i = dxPn(x)Pm(x) = δnm (59)
0 2n + 1
Legendre polynomials come up in problems with spherical symmetry. You will study them to
death in quantum mechanics.
Hermite polynomials
x2
− d − x22
Hn(x) = (−1)ne 2 e (60)
dx2
So H0(x) = 1, H1(x) = x, H2(x) = x2 − 1 and so on. These satisfy
Z 1 x2
−
hHn |Hm i = dxe 2 Hn(x)Hm(x) = δn m (61)
0