Download Lecture 8: Fourier Analysis

Survey
yes no Was this document useful for you?
   Thank you for your participation!

* Your assessment is very important for improving the workof artificial intelligence, which forms the content of this project

Document related concepts

Factorization wikipedia , lookup

Fundamental theorem of algebra wikipedia , lookup

Transcript
Lecture 8: Fourier Analysis
1. Odd periodic functions
Consider the function f = sin θ. It is odd: f (θ) = −f (−θ) and it is periodic: f (θ + 2π) = f (θ)
In the same way, sin2θ and sin3θ and any sin(nθ) (with n integer) are odd and periodic.
If you add two - or more - odd periodic functions together, then the result is another odd periodic
function. The figure shows 0.4sin2θ + 0.3sin7θ. The most general function we can write like this is
X
an sin(nθ) = f (θ)
n
where the an are just coefficients like the 0.4 and 0.3 above (and some of them can be zero) and f (θ) is an
odd periodic function of θ. This is obvious and looks trivial. The point of Fourier theory is that you can
write this equation the other way round
f (θ) =
X
an sin(nθ)
n
Not only does a sum of sin(nθ) terms give an odd periodic function, any odd periodic function can be written
as a sum of sin(nθ) oscillations, if the an coefficients are chosen correctly. And that’s the fundamental point
of Fourier theory: any repeating waveform can be built up out of the fundamental oscillation at the base
frequency and higher harmonics of that frequency, if you add them up in the right way.
As an example, take a sawtooth function: f = θ between −π and π, and then repeating periodically.
The successive plots show a single sine wave 2sin(x), then 2sin(x) − sin(2x), then 2sin(x) − sin(2x) +
( 32 )sin(3x) and so on up to inclusion of sin(7θ) term, where the coefficient is an = −(−1)n n2 . As further
terms are included it gets better and better, and an infinite number of terms will make a perfect match.
P
How to find these coefficients? It’s a neat trick. Given some f (θ) = n an sin(nθ) we want a particular
am . Multiply both sides by sin(mθ) and integrate over the range −π to π. This gives
Z
π
−π
f (θ)sin(mθ)dθ =
X
n
an
Z
π
−π
sin(mθ)sin(nθ)dθ
Lecture 8 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Fourier Analysis
The left hand side is some number which you can evaluate (algebraically or numerically). The right
hand side can be integrated using after using the trig identity for sinAsinB.
Z
Z
Z
1
1 sin(n − m)θ)
1
1 sin(n + m)θ)
−2
sin(nθ) sin(mθ)dθ = 2 cos(n − m)θdθ − 2 cos(n + m)θdθ = 2
n−m
n+m
The limits are −π and π so all those sines are zero and we get zero - unless n = m. That
R π gives 0/0 in the
first bracket, which is not zero but undefined. To evaluate it we have to go back to −π sin2 mθdθ which
R
is 21 (1 − cos(2mθ) dθ = 12 (2π − 0) = π. So the n = m Rterm is π and all the n 6= m terms are zero: the
n
functions sin(nθ) are orthogonal over the range −π to π, sin(nθ)sin(mθ) dθ = πδm
.
So this multiplication and integration projects out the appropriate component, and we have the rule for
finding the coefficients
Z
1 π
an =
f (θ)sin(nθ)dθ
π −π
R
π
π
So for that sawtooth: an = π1 −π θsin(nθ)dθ = π1 nθ cos(nθ) + n12 sin(nθ) −π = n2 Cos(nπ).
2. Even Functions
Sine waves are odd functions, cosines are even functions - and any periodic even function can be written
X
f (θ) =
bn cos(nθ)
with the coefficients found by multiplying by cosnθ and integrating. The only extra feature is that the sum
has to start at n = 0 as cos0x = cos0 = 1 is significant and sensible, whereas sin0x = sin0 = 0 does nothing.
And the integral of cos2 0x is not π but 2π, so
Z
Z π
1
1 π
f (θ)cosnθdθ
(n > 0)
b0 =
f (θ)dθ
bn =
π −π
2π −π
3. General functions
If a function is neither odd nor even, it can always be written as the sum of an odd and an even function
f (θ) =
1
2
[f (θ) + f (−θ)] +
1
2
[f (θ) − f (−θ)] ≡ feven (θ) + fodd (θ)
so the general function will have an expansion as a sum of sin and cos terms
X
f (θ) =
an sin(nθ) + bn cos(nθ)
n
R
The aRn and bn coefficients are to be found as before. And in fact to evaluate an we need sin(nθ)fodd (θ)dθ.
But sin(nθ)feven (θ)dθ is zero, as must any integral of an Rodd function times an even function over a
symmetric range. So we can find the coefficients from an = π1 sin(nθ)f (θ)dθ - and the same is true for the
bn . We don’t actually need to separate f into its odd and even parts, just to know that it can be done.
Z
Z π
∞
∞
X
X
1 π
1
f (θ) =
an sin(nθ) +
bn cos(nθ)
an =
f (θ)sin(nθ)dθ
bn =
f (θ)cos(nθ)dθ
π −π
(2)π −π
1
0
where the (2) applies for k = 0
If you dislike that optional 2, you can write it as 1 + δn0 or get rid of it by including coefficients of
negative integers. cos(−nθ) is just the same as cos(nθ) and so if we include +n and −n we have to divide
by a factor of 2 to compensate, except for n = 0, but that has the 2 already!
It also works for the sine terms (two minuses multiplying). So we have an equivalent form
Z π
Z π
∞
∞
X
X
1
1
f (θ) =
an sin(nθ) +
bn cos(nθ)
ak =
f (θ)sinkθdθ
bk =
f (θ)coskθdθ
2π −π
2π −π
−∞
−∞
4. Changing the range
If the range does not go from −π to π but from, say, -L to L then we just have to make the replacement
θ = πx/L (and dθ = πdx/L) to get
Z L
Z L
∞
X
nπx
nπx
1
nπx
1
nπx
an sin(
f (x) =
) + bn cos(
)
an =
f (x)sin(
)dθ
bn =
f (x)cos(
)dθ
L
L
2L
L
2L
L
−L
−L
−∞
Often such series are for a position −L < x < L, often for a time −T < t < T .
–2–