Document

advertisement
Ae2 Mathematics : Fourier Series
J. D. Gibbon
(Professor J. D Gibbon1 , Dept of Mathematics)
j.d.gibbon@ic.ac.uk
http://www2.imperial.ac.uk/∼jdg
These notes are not identical word-for-word with my lectures which will be given on a WB.
Some of these notes may contain more examples than the corresponding lecture while in other
cases the lecture may contain more detailed working. I will not be handing out copies of these
notes – you are therefore advised to attend lectures and take your own.
Contents
1 Introduction
2 Derivation of the Fourier coefficients am
2.1 Proof of (2.1), (2.2) and (2.3) . . . . . .
2.2 Parseval’s equality . . . . . . . . . . . . . .
2.3 Example . . . . . . . . . . . . . . . . . . . .
1
and bm
. . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . .
3 Odd and even functions & periodic extension
3.1 Odd and even functions . . . . . . . . . . . . . . .
3.2 Examples . . . . . . . . . . . . . . . . . . . . . . . .
3.3 Periodic extension and half-range series . . . . .
3.4 An example of periodic extension . . . . . . . . .
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
4 Fourier Transforms as the limit L → ∞ of Fourier series
1
Do not confuse me with Dr J. Gibbons who is also in the Mathematics Dept.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
2
2
3
4
5
5
6
8
9
11
5th/01/11 (ae2mafs.tex)
1
1
Introduction
Let us consider functions f (x) that are periodic on the x-axis with period p
f (x + p) = f (x) .
(1.1)
If f (x) is plotted over several periods its repetitive nature becomes clear. Two obvious examples are sin x and cos x each of which have period 2π. (1.1) also generalizes to
for integer n .
f (x + np) = f (x)
(1.2)
Another example is the sawtooth function sketched below which is defined as f (x) = x on
−π ≤ x ≤ π and is also periodic of period p = 2π. This function is, however, discontinuous
at x = (2n + 1)π.
f (x)
x
−π
π
2π
Yet another example seen below is a square wave of period p = 2π :
f (x)
1
−π
x
π
2π
,
The sawtooth and square-wave functions are typical examples of rough functions in the sense
that they contain discontinuities. The question we wish to consider is whether such rough
periodic functions can be represented by an infinite series, not of polynomials, but of sines and
cosines?
5th/01/11 (ae2mafs.tex)
2
2
Derivation of the Fourier coefficients am and bm
The general convention for what are called Fourier series is to consider periodic functions of
period 2L over the domain [−L, L] on the x-axis. Then :
The Fourier series for a periodic function f (x), periodic on [−L, L] has a Fourier series
representation
f (x) = a0 +
1
2
∞ n
X
am cos
m=1
mπx L
+ bm sin
mπx o
(2.1)
L
where the Fourier coefficients am and bm are given by
Z
Z
mπx mπx 1 L
1 L
dx ,
bm =
dx , (2.2)
am =
f (x) cos
f (x) sin
L −L
L
L −L
L
while
1
a0 =
L
Z
L
f (x) dx .
(2.3)
−L
(2.3) is consistent with putting m = 0 in am defined in (2.2).
2.1
Proof of (2.1), (2.2) and (2.3)
Split the cosine and sine in (2.1) into the combinations
1
[exp(iθ) + exp(−iθ)]
2
1
[exp(iθ) − exp(−iθ)]
sin θ =
2i
cos θ =
(2.4)
to turn (2.1) into
f (x) =
1
2
a0 +
∞
X
1
2
m=1
≡
+∞
X
(am − ibm )eimπx/L + (am + ibm )e−imπx/L
cm eimπx/L
(2.5)
m=−∞
where
cm =
(am − ibm )
1
(am + ibm )
2
1
2
m > 0,
m < 0,
c0 = 12 a0 .
(2.6)
We can invert this to find the cm by multiplying by e−inπx/L (n is another integer) and
integrating across the expansion in (2.5)
Z L
Z L
+∞
X
−inπx/L
f (x)e
dx =
cm
ei(m−n)πx/L dx .
(2.7)
−L
m=−∞
−L
5th/01/11 (ae2mafs.tex)
3
When m 6= n the integral on the RHS of (2.7) is
Z L
L(ei(m−n)π − e−i(m−n)π )
ei(m−n)πx/L dx =
i(m − n)π
−L
2L sin(m − n)π
0 m 6= n
=
=
2L m = n
(m − n)π
(2.8)
Thus only one term is non-zero in the infinite series on the RHS of (2.7), leaving us with
Z L
1
f (x)e−imπx/L dx ,
for m = 0, 1, 2, ...
(2.9)
cm =
2L −L
Taking real & imaginary parts & using (2.6) we obtain (2.1).
Under what circumstances is the expansion (2.1) a realistic representation of our periodic
function f (x)? There is a proof – too complicated for this syllabus because it requires use of
the Riemann-Lebsegue Lemma – that shows the following version of Fourier’s Theorem :
Provided f (x) is finite at its discontinuities in [−L, L] and it also has a finite
number of maxima & minima on this interval then the Fourier series (2.1) converges to f (x) at points where f (x) is continuous and at discontinuities xd (say),
f (x) must converge to
1
2
lim [f (xd − δ) + f (xd + δ)] .
(2.10)
δ→0
This, of course, is the average value of the function at xd .
2.2
Parseval’s equality
Consider the square of the infinite series from m = −∞ to m = ∞ in (2.5) and form the
integral
Z L
Z L
∞
∞
X
X
2
∗
|f (x)| dx =
c n cm
ei(n−m)πx/L dx .
(2.11)
−L
m=−∞ n=−∞
−L
The integral on the RHS has already been found in (2.8) so (2.11) becomes
Z L
0
m 6= n
2
P∞
|f (x)| dx =
2
2L m=−∞ |cm | m = n
−L
(2.12)
Now use the definition of cm in (2.6) to show that
∞
X
m=−∞
|cm |2 = c20 + 2
∞
X
m=1
|cm |2 = 14 a20 +
1
2
∞
X
m=1
a2m + b2m .
Thus we have Parseval’s equality (see formula sheet) :
Z
∞
X
1 L
2
1 2
|f (x)| dx = 2 a0 +
a2m + b2m .
L −L
m=1
(2.13)
(2.14)
5th/01/11 (ae2mafs.tex)
2.3
4
Example
f (x)
x
−π
π
Consider the function
f (x) =
2π
x
0≤x≤π
0 −π ≤ x ≤ 0
which is also periodic over the whole x-axis. In this case L = π and we have
Z π
Z π
f (x) cos (mx) dx ,
πbm =
f (x) sin (mx) dx ,
πam =
−π
(2.15)
(2.16)
−π
and, for m = 0,
πa0 =
in which case a0 = π/2. For am
Z
πam =
Z
π
f (x) dx ==
−π
Z
π
x dx ,
(2.17)
0
π
x cos (mx) dx
Z
1 π
x d[sin (mx)]
m 0
Z
π
1
1 π
x sin(mx) 0 −
sin (mx)
m
m 0
π
1 cos(mx)
0
m2
1
m
−
1
.
(−1)
m2
0
=
=
=
=
Thus we have
am =
Now we calculate bm :
πbm =
Z
0
2
− πm
2
m even
m odd
(2.18)
(2.19)
π
x sin (mx) dx
Z
1 π
= −
x d[cos (mx)]
m 0
Z
π
1
1 π
cos (mx) dx
= − x cos(mx) 0 +
m
m 0
π cos(mπ)
.
= −
m
0
(2.20)
5th/01/11 (ae2mafs.tex)
5
Thus
bm =
(−1)m+1
.
m
(2.21)
Together the complete series is :
sin x sin 2x sin 3x
π
2 cos x cos 3x
+
+ ... +
f (x) = −
−
+
... .
4 π
12
32
1
2
3
3
(2.22)
Odd and even functions & periodic extension
3.1
Odd and even functions
(i) A function f (x) is said to be even if it has the property f (−x) = f (x).
(i) A function f (x) is said to be odd if it has the property f (−x) = −f (x).
Typical examples of even functions are cos x or x2n for integer values of n. Typical examples
of odd functions are sin x or x2n+1 for integer values of n. Note that many functions are
neither odd nor even : for example exp x. However they can be split down into even and odd
parts
f (x) = 12 [f (x) + f (−x)] + 12 [f (x) − f (−x)] .
(3.1)
|
{z
}
|
{z
}
even
An example is
ex =
1
2
odd
ex + e−x + 12 ex − e−x .
| {z }
| {z }
coshx
(3.2)
sinhx
Why are these relevant to Fourier series?
Consider first bm for an even function f (x) : we split the domain down into [−L, 0] and
[0, L]. On [−L, 0] we change variables from x → −y and change the sign on the integral
when switching limits
Z L
Z 0
mπx mπx Lbm =
f (x) sin
f (x) sin
dx +
dx
L
L
0
−L
Z 0
Z L
mπx mπy dx +
d(−y)
=
f (x) sin
f (−y) sin −
L
L
0
L
Z L
Z L
mπx mπy f (x) sin
f (−y) sin
=
dx −
d(y)
L
L
0
0
(
0
for an even f (x)
RL
(3.3)
=
mπx
2 0 f (x) sin L dx for an odd f (x)
Thus if f (x) is an even function then the two integrals cancel2 . For am the story is the
2
Note that while the dummy variables within the two integrals in (3.3) are different, this does not matter
because the limits in the two are identical and finite.
5th/01/11 (ae2mafs.tex)
6
opposite
Z
L
Z
mπx mπx 0
dx +
dx
f (x) cos
L
L
−L
Z 0
Z L
mπx mπy dx +
d(−y)
=
f (x) cos
f (−y) cos −
L
L
0
L
Z L
Z L
mπx mπy =
dx +
d(y)
f (x) cos
f (−y) cos
L
L
0
(0 R
L
2 0 f (x) cos mπx
dx for an even f (x)
L
=
0
for an odd f (x)
Lam =
f (x) cos
0
(3.4)
Thus we have the general result :
(i) If f (x) is an even function then
2
am =
L
Z
L
f (x) cos
0
mπx L
bm = 0 .
dx ,
(3.5)
(ii) If f (x) is an odd function then
2
bm =
L
am = 0 ,
Z
L
f (x) sin
0
mπx L
dx .
(3.6)
Note that the non-zero integrals are over [0, L] with a factor of 2 outside & thus “double-up”.
3.2
Examples
Example 1 : (even) Consider the function
f (x) = |x|
−π ≤x≤π
(3.7)
and periodic over the whole x-axis.
f (x)
x
−2π
−π
π
2π
Now L = π and |x| is an even function so bm = 0.
Z π
x dx = π 2 ,
πa0 = 2
0
(3.8)
5th/01/11 (ae2mafs.tex)
7
so a0 = π. Moreover,
1
2
πam =
=
=
=
=
Therefore
Z
π
x cos(mx) dx
Z
1 π
x d[sin(mx)] dx
m 0
Z
π
1
1 π
sin(mx) dx
x sin(mx) 0 −
m
m 0
π
cos(mx)
m2
0
1 (−1)m − 1 .
2
m
0
am =
0
m even
4
m odd
− πm
2
The first few terms in the series are3
cos 3x cos 5x
π
4
cos x +
f (x) = −
+
+ ... .
2 π
32
52
Now apply Parseval’s equality. Firstly
Z
Z
1 π
1 π 2
2
2
|f (x)| dx =
x dx = π 2
π −π
π −π
3
(3.9)
(3.10)
(3.11)
(3.12)
and so from (2.14), using a0 and am ,
∞
2 2 1 2 16 X
1
π = π + 2
3
2
π r=1 (2r + 1)4
(3.13)
or (π 2 = 9.872 and π 4 = 97.459 and π 4 /96 = 1.015)
π4
1
1
= 1 + 4 + 4 + ...
3
5
96
(3.14)
Example 2 : (odd) Consider the function
f (x) =
1
0≤x≤1
−1 −1 ≤ x ≤ 0
(3.15)
and periodic over the whole x-axis. This is an odd function with L = 1.
3
By definition, plots can be made of only a finite number of terms : these capture the straight lines well
but oscillations are seen to occur around the apices of the triangles : these are called Gibbs phenomena.
5th/01/11 (ae2mafs.tex)
8
f (x)
1
x
−1
1
2
,
−1
Thus am = 0 including a0 and
1
2
bm =
Z
1
0
= −
Therefore
sin(mπx) dx = −
1 (−1)m − 1
mπ
bm =
0
4
πm
1
1 cos(mπx) 0
mπ
m even
m odd
The first few terms in the series are
sin 3πx sin 5πx
4
f (x) =
sin πx +
+
+ ... .
π
3
5
(3.16)
(3.17)
(3.18)
Oscillatory Gibbs phenomena are seen around the discontinuities in plots of a finite number of
terms.
3.3
Periodic extension and half-range series
If we are given a function f (x) defined only over [0, L] then, by definition, this is not a periodic
function so Fourier’s Theorem is not applicable. To circumvent this problem, construct a global
function F (x) that is equal to f (x) in [0, L] but is extended over the whole x-axis as a periodic
function. Consider f (x) below :
f (x)
x
1
2
L
L
The global function F (x) could be constructed two ways : the first is to repeat it ad infinitum
as a reflection in the y-axis to make it an even function : we say that F (x) is the “even
extension of f (x)”. Clearly bm = 0.
5th/01/11 (ae2mafs.tex)
9
F (x)
x
1
−L − 2 L
1
2
L
L
The second is to repeat it ad infinitum as an anti-reflection in the y-axis to make it an odd
function : we say that F (x) is the “odd extension of f (x)”. Clearly am = 0.
F (x)
x
1
−L − 2 L
1
2
L
L
In both cases the extension F (x) is a periodic function to which Fourier’s Theorem applies.
The even and odd extensions are a matter of choice : the resultant Fourier series are called
half-range series for obvious reasons.
An example of periodic extension
3.4
Define the “tent-function”
f (x) =
x
π−x
0 ≤ x ≤ 12 π
1
π≤x≤π
2
(3.19)
1) : The even extension of f (x) defined in (3.19) with L = π is sketched below :
− 12 π
−π
1
2
π
x
π
Because this extension is even by construction, bm = 0. To calculate am :
Z π
Z π/2
Z π
1
πa0 =
f (x)dx =
xdx +
(π − x)dx = 14 π 2
2
0
0
(3.20)
π/2
and so a0 = 12 π. Moreover
1
2
πam =
Z
π
f (x) cos mx dx =
0
Z
π/2
x cos mx dx +
0
Z
π
π/2
(π − x) cos mx dx .
(3.21)
5th/01/11 (ae2mafs.tex)
10
Integration by parts gives
Z
1
2
b
a
Z
b
cos mx dx =
a
1
[sin mx]ba
m
1
1
x sin mx + 2 cos mx
x cos mx dx =
m
m
(3.22)
b
(3.23)
a
π
1
1
1
1
+ 2 [cos mx]π/2
− [x sin mx]ππ/2 − 2 [cos mx]ππ/2
[sin mx]ππ/2 + [x sin mx]π/2
0
0
m
m
m
m
m
1
=
[2 cos( 12 mπ) − 1 − cos mπ]
(3.24)
m2
πam =
Using the fact that cos mπ = (−1)m : we have cos 12 mπ = (−1)r when m = 2r (even) and
cos 12 mπ = 0 when m = 2r + 1 (odd). Thus
1
2
πam =
1
2r 2
0
[cos rπ − 1]
m = 2r + 1 (odd)
m = 2r
(even)
(3.25)
The r-even terms are zero leaving only r-odd terms with am = −2/πr2 (m = 2r but r odd) :
π
2 cos 2x cos 6x cos 10x
+
+
...
(3.26)
f (x) = −
4 π
12
32
52
2) : The odd extension of f (x) defined in (3.19) with L = π is sketched below :
−π
− 12 π
1
2
π
x
π
Because this extension is odd by construction, am = 0.
1
2
πbm =
Integration by parts gives
Z
b
a
Z
π/2
x sin mx dx +
0
Z
b
a
sin mx dx = −
Z
π
π/2
(π − x) sin mx dx
1
[cos mx]ba
m
1
1
x sin mx dx = − x cos mx + 2 sin mx
m
m
(3.27)
(3.28)
b
a
(3.29)
5th/01/11 (ae2mafs.tex)
1
2
11
π
1
1
[cos mx]ππ/2 − [x cos mx]π/2
+ 2 [sin mx]π/2
0
0
m
m
m
1
1
+
[x cos mx]ππ/2 − 2 [sin mx]ππ/2
m
m
1
=
[2 sin( 12 mπ) − sin mπ]
m2
2
=
sin( 12 mπ)
2
m
(
0
m = 2r
(even)
=
2 sin(r+ 12 )π
m = 2r + 1 (odd)
(2r+1)2
πbm = −
Now sin(r + 12 )π = cos rπ = (−1)r . Thus
(
0
bm =
4(−1)r
π(2r+1)2
m = 2r
(even)
m = 2r + 1 (odd)
(3.30)
(3.31)
Thus the odd-range expansion is
4 sin x sin 3x sin 5x sin 7x
−
+
−
...
f (x) =
π
12
32
52
72
(3.32)
Note: put x = 0 in (3.26) or put x = π/2 in (3.32) & end up with the same expansion for π 2
π2
1
1
1
1
= 2 + 2 + 2 + 2 + ...
1
3
5
7
8
4
(3.33)
Fourier Transforms as the limit L → ∞ of Fourier series
The Fourier Transform4 of a function f (x) and its inverse on the infinite domain [−∞ , ∞] is
defined by
Z ∞
Z ∞
1
−ikx
(FT) f (k) =
e
f (x) dx ,
(inverse FT) f (x) =
eikx f (k) dk . (4.1)
2π −∞
−∞
To prove f (x) is the inverse of f (k) as stated in (4.1), we use (2.5)
Z L
+∞ X
1
0 −imπx0 /L
0
f (x )e
dx eimπx/L
f (x) = lim
L→∞
2L −L
m=−∞
Dirichlet integral
(4.2)
Let Lm = L/m and κm = π/Lm = mπ/L. Define δκm = κm+1 − κm = π/L. Then
Z L
∞
X
1
iκm x
−iκm x0
0
0
f (x) =
δκm e
e
f (x ) dx .
lim
2π L→∞ m=−∞
−L
4
Not examinable but useful in other courses.
(4.3)
5th/01/11 (ae2mafs.tex)
12
We define
f L (k) =
and in the limit k = δκm → 0
Z
L
0
e−ikx f (x0 ) dx0
(4.4)
−L
∞
X
1
eiκm x f L (κm )δκm
f (x) =
lim lim
2π L→∞ κm →∞ m=−∞
Z ∞
1
eikx f (k) dk
=
2π −∞
(4.5)
(4.6)
which is the inverse Fourier Transform based on the Fourier Transform as the limit of (4.4)
Z ∞
f (k) = lim f (k) =
e−ikx f (x) dx .
(4.7)
L→∞
−∞
Example : To find f (k) when f (x) = e−a|x| where a > 0 :
|x| =
f (k) =
Z
0
e
−∞
−ikx ax
x x≥0
−x x ≤ 0
e dx +
Z
∞
(4.8)
e−ikx e−ax dx .
(4.9)
0
The integrals are simple and the resulting functions vanish at ±∞ but not at x = 0.
f (k) =
1
1
2a
+
= 2
.
a − ik a + ik
a + k2
(4.10)
Note finally that when the parameter a is very large the function f (x) has a very sharp cusp
at x = 0 which gets sharper as a is increased whereas f (k) flattens out.
Download