Chapter 10 - Fourier Analysis: J.R. Wilson January 7, 2018
Chapter 10 - Fourier Analysis: J.R. Wilson January 7, 2018
Chapter 10 - Fourier Analysis: J.R. Wilson January 7, 2018
J.R. Wilson
January 7, 2018
1 Introduction
Fourier Analysis allows us to express functions as a sum of sine and cosine terms. This
is useful because it allows us to describe functions that are not everywhere continuous /
differentiable. In this course we will address two situations:
The advantage of using sine and cosine terms is that trigonometric functions are easy
to differentiate and integrate. Each term contains only 1 characteristic frequency, hence
fourier analysis is a way to break a complex function down into its components.
For example a musical note or chord consists of a number of pure tones.
Recall that a vector v̄ has components v̄ = (vx , vy , vz ). We can find the components
by ‘projecting them out’ using the projection operators î, ĵ, k̂ such that
vx = î.v̄ (1)
vy = ĵ.v̄ (2)
vz = k̂.v̄ (3)
2 Fourier Series
A Fourier series is built from a sum of periodic components. A benefit of using Fourier
series over power series, is that for power series expansions we require our initial function
1
2
f (x) to be continuous and differentiable over the range in x that we want to be able to
use. We can relax these constraints when using Fourier series. Generally when Fourier
series converge, they converge fast. For example, when expressing a sound as a fourier
series, the first few terms are usually good enough to reproduce the original sound as we
here it.
There are many applications of Fourier series and you will meet a number during
your physics degree. Some tangible applications include
• Cleaning up ‘hiss’ and ‘pop’ in sound recordings. These effects are usually high
frequency noise that can be removed.
• Cleaning up digital images - again mottled effect in photos etc. is a higher fre-
quency that can be removed.
• The outlines of a picture can be found as boundaries are associated with high
frequencies. This leads to image recognition software etc.
y(t + T ) = y(t), ∀ t,
where T is the period of the function (see Fig. 1). If we need to, we can re-express this
condition in terms of the frequency f , or angular frequency ω, by noting the following
2π
ω= = 2πf.
T
0.35 T
0.3
0.25
y(t)
0.2
0.15
0.1
between ’1’ and ’0’ (or ’ON’ and ’OFF’) states. We can express the square wave pulse
train as
1 1
y(t) = h, − ≤ t − nT ≤
4 4
= 0, elsewhere (6)
where n is any integer. Figure 2 shows the function y(t) over two consecutive periods
where the pulse height h = 1 and T = 1.
1 T
0.8
0.6
y(t)
0.4
0.2
0
-1 -0.5 0 0.5 1
Figure 2: The square wave pulse defined by Eq. (6) shown over two periods from t = −1
to t = 1, where the periodicity of this function T = 1, and the pulse height h = 1.
The origin is mid-way through a pulse, so y(t) is an even function. With this config-
uration, we can use the symmetry of the problem to simplify1 the Fourier series solution
for y(t). For this particular example, we only need to integrate from t = −T /4 to
t = +T /4, as the integral outside this range is zero by inspection. Recall from Eq. (4)
that
∞
1 X 2πn 2πn
y(t) = A0 + An cos t + Bn sin t
2 T T
n=1
2 T /2
Z
A0 = y(t)dt,
T −T /2
2 T /4
Z
= hdt,
T −T /4
1
With a little practice, you will develop an intuition on sensible choices of the start and end positions
of a period of oscillation. This is loosely analogous to choosing the point a about which one expands a
Taylor series for a function f (x).
5
2 T /4
= [ht]−T /4 ,
T
= h.
So the average value of y(t) over period is A0 /2 = h/2, which is the first coefficient for
our Fourier series. Next, we calculate An via
2 T /4
Z
2πn
An = y(t) cos t dt,
T −T /4 T
2 T /4
Z
2πn
= h cos t dt,
T −T /4 T
T /4
2h T 2πn
= sin t
T 2πn T −T /4
h 2πn T 2πn −T
= sin . − sin .
nπ T 4 T 4
h nπ −nπ
= sin − sin
nπ 2 2
2h nπ
= sin
nπ 2
If n is odd, then we have sin(nπ/2) = ±1, and An is non-zero. If n is even, then An = 0.
Finally we can calculate Bn .
2 T /4
Z
2πn
Bn = y(t) sin t dt,
T −T /4 T
2 T /4
Z
2πn
= h sin t dt,
T −T /4 T
T /4
2h T 2πn
= − cos t ,
T 2πn T −T /4
h 2πn T 2πn T
= − cos . + cos . ,
nπ T 4 T 4
= 0, ∀ n
Now we have calculated all coefficients for our Fourier series solution. We can write y(t)
as
∞
h X 2h nπ 2πn
y(t) = + sin cos t
2 nπ 2 T
n=1
where we only need to sum over odd values of n. The harmonics can be written down as
h 2h 2π 2h 6π 2h 10π
y(t) = + cos t − cos t + cos t + ...
2 π T 3π T 5π T
6
Figure 3 shows the Fourier series obtained for terms up to n = 1, 3, 5, 7, 9, and 51.
As more terms are added, the Fourier series approximation of the square wave function
improves.
1.4 1.4
1.2 1.2
1 T 1 T
0.8 0.8
y(t)
y(t)
0.6 0.6
0.4 0.4
0.2 0.2
0 0
-0.2 -0.2
t t
1.4 1.4
1.2 1.2
1 T 1 T
0.8 0.8
y(t)
y(t)
0.6 0.6
0.4 0.4
0.2 0.2
0 0
-0.2 -0.2
t t
1.4 1.4
1.2 1.2
1 T 1 T
0.8 0.8
y(t)
y(t)
0.6 0.6
0.4 0.4
0.2 0.2
0 0
-0.2 -0.2
t t
Figure 3: The square wave pulse defined by Eq. (6) shown over two periods from t = −1
to t = 1. The corresponding Fourier Series expansion for the square wave potential is
shown (left to right, top to bottom) including terms up to n = 1, 3, 5, 7, 9, and 51. The
parameters h and T are set to 1 for this Figure.
We can re-write our fourier series solution in terms of ω0 , the angular frequency of
the first non-zero harmonic, to look at the frequency content of our function. If we look
at the magnitude of our coefficients (in this case, we need only look at An for odd n),
we see which frequencies are present in our function (See Figure 4).
h 2h 2h 2h
y(t) = + cos (ω0 t) − cos (3ω0 t) + cos (5ω0 t) + . . . (7)
2 π 3π 5π
NOTES:
7
0.7
0.6
0.5
0.4
|An|
0.3
0.2
0.1
0
0 1 2 3 4 5 6
ω/ ω0
Figure 4: The modulus of the amplitudes with different frequencies contributing to the
square wave pulse defined by Eq. (6). The corresponding Fourier series for this function
is shown in Eq. (7)
• We have performed a Fourier Analysis of y(t). This means we have taken our
original function, y(t), and expressed this as a function of sine and cosine terms
using Eq. (4).
• The solution obtained for y(t) has a parameter for the pulse height, h, and for the
period of the function T . We can use our solution for any h and T value we choose.
For example, if we set h = 1, and T = 2 our Fourier series solution for the square
2
Recall that sin(x) is an odd function, so we could have guessed that Bn = 0 for all n, without having
to calculate anything.
8
wave function is
1 2 2 2
y(t) = + cos (πt) − cos (3πt) + cos (5πt) + . . .
2 π 3π 5π
• We integrated over one full period, but as the solution is periodic, it is valid for
all values of t.
Now we could choose a value for ωt such that each cosine term would take a value ±1.
π h 2h 1 1
y(t = ) = + 1 cos (π) − cos (3π) + cos (5π) + . . .
ω 2 π 3 5
h 2h −1 −1
= + −1 − + ....
2 π 3 5
h 2h 1 1
= − 1 − + ....
2 π 3 5
Now at t = ωπ = πT T T
2π = 2 and from figure 2 we see that y 2 = 0 so we can write
h 2h 1 1
0 = − 1 − + ....
2 π 3 5
where
Z t2
1 2πn
Yn = y(t)e−i T
t
dt, (10)
T t1
Z t2
1
= y(t)e−iωnt dt. (11)
T t1
3
Recall that eiθ = cosθ + i sin θ - Euler’s formula.
4
Our aim is to obtain integrals for the coefficients that are easier to calculate than the original form.
10
This is completely equivalent to the previous expressions but using complex numbers
has halved the length of the equations. For real y(t), Y−n = (Yn )∗ so the Yn values for
±n are complex conjugates of each other. The real parts give cosine (even) terms and
the imaginary parts give sine (odd) terms.
Looking at the graph, if we shifted the curve down by A2 , as shown by the dashed
axis in the figure, we would have an odd function. Therefore, we would expect a series
with only imaginary terms (or sine functions) and a constant term of A2 .
Using equation 11 we can write
1 T At −iωnt
Z
Yn = e dt.
T 0 T
A T −iωnt
Z
Yn = te dt.
T2 0
(12)
which we can integrate by parts
Z T −inωt T Z T
−iωnt te 1
te dt. = + e−inωt dt
0 −inω 0 inω 0
11
T e−inωT 1 −inωt T
= −0− e 0
(13)
−inω (inω)2
2π
since we know ω = T , we can say
∞
A iA X einωt
y(t) = +
2 2π n
n=−∞,n6=0
3 Fourier Integrals
Consider a function which is not necessarily periodic, for example see Figure 6, where
we require that y(t) → 0 as t → ±∞.
12
Graph
1.4
1.2
0.8
0.6
0.4
0.2
0
0 0.2 0.4 0.6 0.8 1
What is the frequency content of y(t)? Can we re-write y(t) in terms of the frequency
ν = 1t ? To do this, we need to transform from the time domain t to the frequency domain
ν. In general, we can transform from x to its reciprocal u = 1/x using:
Z ∞
Y (u) = y(x)e−i2πux dx,
Z−∞∞
y(x) = Y (u)ei2πux du, (14)
−∞
Note that the exponent in the transformation from x to u has the opposite sign to the
exponent in the inverse transformation (from u to x). Here Y (u)is called the Fourier
Transform of y(x) and the pair of equations is called the Fouerier Inversion Theorem.
y(x) and Y (u) is called a Fourier Transform pair.
Note that there are several conventions for where the 2π factor appears so you may
also see
√
• a factor of √12π in both equations (ie define Ynew = 2πY
Z ∞
1
Y (u) = √ y(x)e−iux dx,
2π −∞
Z ∞
1
y(x) = √ Y (u)eiux du,
2π −∞
1
• a factor of 2π in one equation (ie substitute u with v where v = 2πu)
Z ∞
1
Y (u) = y(x)e−iux dx,
2π −∞
Z ∞
y(x) = Y (u)eiux du,
−∞
13
If y(x) is real, Y (u) is complex with Y (−u) = (Y (u))∗ . In general both y(x) and
Y (u) can be complex (but x, u are real).
Usually the ‘ordinary’ variable is t (time) or x (space) and the ‘other’ variable u
represent (angular) frequency, so Y (u) lives in the so-called Frequency domain and u has
the dimensions or inverse time or inverse length.
2π
If y(t) contains an oscillation at period P , Y (u) has a ‘hump’ at u = p .
Z ∞
1
Y (u) = y(t)e−iut dt
2π −∞
Z T
1 2
Y (u) = 1e−iut dt
2π − T2
T
1 1 −iut 2
Y (u) = e
2π −iu − T2
−1 −iuT /2
Y (u) = e − eiuT /2
2πiu
−1 uT
Y (u) = −2i sin
2πiu 2
1 uT
Y (u) = sin
πu 2
Figure 7: (a) A top hat function and (b) its fourier transform.
δ(u) = 0, for u 6= 0
Z ∞
δ(u)du = 1.
−∞
So the integral over all u of the δ function is unity, and the delta function is non-zero
only at the position u. We can create delta functions at different locations, by providing
an offset e.g.
Z ∞
δ(u − u0 )f (u)du = f (u = u0 ) = f (u0 ).
−∞
15
1 1
0.9 0.9
0.8 0.8
0.7 0.7
Y(u)
f(x)
0.5 0.5
0.4 0.4
0.1 0.1
0 0
0 1 2 3 4 5 6 0 1 2 3 4 5 6
x u
Figure 8: (left) The function f (x) = constant (right) the frequency domain representa-
tion f (x) = δ(u).
y(t) Y (u)
1 1 1
cos (2πt/T ) 2 δ u + T + δ u − T
1 1 1
sin (2πt/T ) 2 δ u+ T −δ u− T
2 /L2 √ −u2 L2
e−x 2 πe
top hat sin(Lπu)/(πu)
Z 2π
cos mx cos nxdx = πδmn (16)
0
Z 2π
sin mx sin nxdx = πδmn (17)
0
Z 2π
cos mx sin nxdx = 0 (18)
0