chapter 3 fourier analysis

13
Chapter 3 Fourier Analysis Introduction to orthogonal polynomials Representing a periodic function as an infinite sum of sine and cosine functions. Finding the signal in the noise. f (x) defined on [-, ] and f (x +2)= f (x) f (x)= a 0 2 + a 1 cos x + a 2 cos 2x + a 3 cos 3x ··· ··· + b 1 sin x + b 2 sin 2x + b 3 sin 3x ··· (3.1) 3.1 A reminder of some wave basics Solutions of the wave equation take the form: u(x, t)= A sin 2λ (x - vt)+ φ . (3.2) Note that @ 2 u @t 2 = -! 2 u, so particle at any point x executes simple harmonic motion with frequency !. Here λ is the wavelength of the wave and this angular frequency ! is determined by ! = kv with k 2λ the “wave number” of the wave. If the endpoints of the medium in which the wave oscillates are fixed, such that u(0,t)= u(L, t) then λ can take only a discrete set of values: λ =2L, L, 2L/3, L/2, .... (3.3) We then have only the discrete set of states, oops, I mean modes: u n (x, t)= A sin h nL (x - vt)+ φ i . (3.4) In this situation n = 1 is the fundamental mode of the string (let’s say it’s a string) and n =2, 3,... are harmonics. Modern players tune to A at 440 Hz. With v = 330m/s for the sound wave this corresponds to a wavelength of the A sound wave in air of about 0.78 m. 24

Upload: others

Post on 03-Oct-2021

6 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Chapter 3 Fourier Analysis

Chapter 3

Fourier Analysis

Introduction to orthogonal polynomialsRepresenting a periodic function as an infinite sum of sine and cosine functions.

Finding the signal in the noise.

f(x) defined on [�⇡, ⇡] and f(x+ 2⇡) = f(x)

f(x) =a02

+ a1 cos x+ a2 cos 2x+ a3 cos 3x · · ·

· · ·+ b1 sin x+ b2 sin 2x+ b3 sin 3x · · · (3.1)

3.1 A reminder of some wave basics

Solutions of the wave equation take the form:

u(x, t) = A sin

2⇡

�(x� vt) + �

�. (3.2)

Note that @2u@t2 = �!2u, so particle at any point x executes simple harmonic motion

with frequency !. Here � is the wavelength of the wave and this angular frequency! is determined by ! = kv with k ⌘

2⇡� the “wave number” of the wave.

If the endpoints of the medium in which the wave oscillates are fixed, such thatu(0, t) = u(L, t) then � can take only a discrete set of values:

� = 2L,L, 2L/3, L/2, . . . . (3.3)

We then have only the discrete set of states, oops, I mean modes:

un(x, t) = A sinhn⇡L

(x� vt) + �i. (3.4)

In this situation n = 1 is the fundamental mode of the string (let’s say it’s a string) andn = 2, 3, . . . are harmonics. Modern players tune to A at 440 Hz. With v = 330m/sfor the sound wave this corresponds to a wavelength of the A sound wave in air ofabout 0.78 m.

24

Page 2: Chapter 3 Fourier Analysis

3.2 Fourier Series

Now we want to represent a given periodic function as a (possibly infinite) sum ofsine and cosine functions. This bears on the analysis of which modes are present in agiven signal. E.g., if the string is struck in a particular way do you excite the “puretone” or do you excite some ugly mix of many di↵erent notes. Such analysis can beapplied to nay function but we will begin by looking at functions defined in (�⇡, ⇡]and periodic with period 2⇡, i.e., f(x+ 2⇡) = f(x) for all real x.

The Fourier series of f is then defined to take the form (3.1). In 1807 Fouriershowed that this could be done for an arbitrary function f , although his paper wasrejected due to lack of rigor, since he did not prove that the series on the right-handside converged to the function on the left (see also below). For now we assume theseries converges to f(x). Then, by multiplying both sides by cos(mx) (resp. sin(mx))and integrating from �⇡ to ⇡ we pick out the coe�cient am (resp. bm) and find:

am =1

Z ⇡

�⇡

f(x) cos (mx) dx; m = 0, 1, 2, . . . (3.5)

bm =1

Z ⇡

�⇡

f(x) sin (mx) dx; m = 1, 2, . . . (3.6)

These are the Euler-Fourier formulae. The series that results when the coe�cientsthereby obtained from a given f are substituted back in to Eq. (3.1) represents theperiodic extension of f from (�⇡, ⇡] to (�1,1). I.e., even if f is not initiallyperiodic, if you calculate these integrals and stick them in the series definition thenthe resulting function will be 2⇡-periodic.

Note that if f has a finite discontinuity on (�⇡, ⇡] then we have to split theintegral into two bits: from �⇡ to the discontinuity and from the discontinuity to ⇡.

3.2.1 Proof of Fourier coe�cient relations and a first go atan orthogonal function expansion

To systematically determine an, we multiply equation (3.1) by cosmx and integrateover [�⇡, ⇡] w.r.t. x. (notation within parenthesis will be presented shortly)

Z ⇡

�⇡

f(x) cosmxdx = (f(x), cosmx) =

a02

Z ⇡

�⇡

cosmxdx+1X

n=1

an

Z ⇡

�⇡

cosnx cosmxdx+1X

n=1

bn

Z ⇡

�⇡

sinnx cosmxdx (3.7)

We look first at the second term on the right side:

1X

n=1

an

Z ⇡

�⇡

cosnx cosmxdx

25

Page 3: Chapter 3 Fourier Analysis

=1X

n=1

an2

Z ⇡

�⇡

cos (n+m)x+ cos (n�m)xdx

if n 6= m

=1X

n=1

an2

Z ⇡

�⇡

d

sin (n+m)x

n+m+

sin (n�m)x

n�m

=1X

n=1

an2

sin (n+m)x

n+m+

sin (n�m)x

n�m

�⇡

�⇡

= 0

if n = m

= an=m

Z ⇡

�⇡

cos2 nxdx

= an=m

Z ⇡

�⇡

1 + cos 2nx

2dx

= an=m

x

2+

sin 2nx

4n

�⇡

�⇡

= an=m

2�

�⇡

2

= an=m⇡

.We will now define a notation to expedite this process

(f, g) =1

Z ⇡

�⇡

f(x)g(x)dx (3.8)

using this notation to summarize the findings of for the previous section

1

Z ⇡

�⇡

cosnx cosmxdx = (cosnx, cosmx) =

⇢0 if n 6= m;1 if n = m.

(3.9)

Further conclusions can be written with this notation. First, we have:

1

Z ⇡

�⇡

sinnx cosmxdx = (sinnx, cosmx) = 0 (3.10)

This is true because

LHS =1

2⇡

Z ⇡

�⇡

[sin (n+m)x+ sin (n�m)x] dx

if n = m

=1

2⇡

Z ⇡

�⇡

sin 2nxdx

26

Page 4: Chapter 3 Fourier Analysis

=1

2⇡

✓�

1

2n

◆cos 2nx

����⇡

�⇡

= �1

4⇡n[cos (2n⇡)� cos (�2n⇡)] = 0

if n 6= m

=1

2⇡

Z ⇡

�⇡

d

�cos (n+m)x

n+m�

cos (n�m)x

n�m

�dx

= �1

2⇡

cos (n+m)⇡

n+m+

cos (n�m)⇡

n�m�

cos (�(n+m)⇡)

n+m�

cos (�(n�m)⇡)

n�m

�= 0

Next, we have:

1

Z ⇡

�⇡

sinnx sinmxdx = (sinnx, sinmx) =

⇢0 if n 6= m;1 if n = m.

(3.11)

if n = m

=1

Z ⇡

�⇡

sin2 nxdx = 1

if n 6= m

=1

2⇡

Z ⇡

�⇡

[cos (n�m)x� cos (n+m)x] dx

=1

2⇡

Z ⇡

�⇡

d

sin (n�m)x

n�m�

sin (n+m)x

n+m

�= 0

Careful to record factors of 1

⇡ , Equation 3.7 can now be rewritten using this notationas:

1

Z ⇡

�⇡

f(x) cosmxdx =

a02(1, cosmx) +

1X

n=1

(an cosnx, cosmx) +1X

n=1

(bn sinnx, cosmx) (3.12)

When m 6= 0, the first term = 0. All terms in the last summation and all termswith the exception of the one where the summation index n hits the value m in thepenultimate summation are zero as can be seen in equations (3.9) and (3.10). We areleft with an equation for am for m 6= 0

1

Z ⇡

�⇡

f(x) cosmxdx = am(cosmx, cosmx) = am (3.13)

27

Page 5: Chapter 3 Fourier Analysis

Whenm = 0, the first term is equal to a0 [(1,1) = 2]. Because n � 1, both summationsare zero as they become integrals [�⇡, ⇡] of trigonometric functions with periods whichare rational fractions of 2⇡ centered on x = 0. We thus must explicitly define thecoe�cient a0 in terms of equation (3.12) with m = 0.

1

Z ⇡

�⇡

f(x)dx = a0 (3.14)

Note that it is the desire to maintain this equation specifically due to its attractiveconformity to the pattern of an equations (3.13) that requires us to define the Fourierseries with a coe�cient of 1

2for a0.

We next wish to find the term bm within the sin series. To do this, we will similarlymultiply our function by sinmx and integrate over the symmetric interval [�⇡, ⇡].

1

Z ⇡

�⇡

f(x) sinmxdx = (f(x), sinmx)

a02(1, sinmx) +

1X

n=1

(an cosnx, sinmx) +1X

n=1

(bn sinnx, sinmx) (3.15)

From our previous discussions, the middle term is known to be always 0. The firstterm is zero (whether m = 0 or not) from the fact that

R ⇡

�⇡ sinmxdx = 0. This leavesus with the last summation which is 0 for all terms except m = n.

1

Z ⇡

�⇡

f(x) sinmxdx = bm(sinmx, sinmx) = bm (3.16)

To conclude, we will summarize our results from equations 3.13, 3.14, and 3.16. Fordetermining the coe�cients necessary to write an arbitrary function in terms of sineand cosine functions in the form of equation 3.1, we have found the equations

am = (f(x), cosmx) (3.17)

bm = (f(x), sinmx) (3.18)

a0 = (f(x), 1) (3.19)

These three equations (3.17 - 3.19) represent a succinct and general method used todecompose a function into its Fourier series.

3.2.2 Example 1

Supposef(x) = x [�⇡, ⇡]

f(x+ 2⇡) = f(x)

28

Page 6: Chapter 3 Fourier Analysis

We will first solve for am. Because the resulting function is odd, an integral over thesymmetric interval must be zero.

am = (f(x), cosmx) =1

Z ⇡

�⇡

x cosmxdx = 0

Checking also the results for a0, we once again find a symmetric integral of an oddfunction

a0 = (f(x), 1) =1

Z ⇡

�⇡

xdx = 0

Finally, we find the terms bm

bm = (f(x), sinmx) =1

Z ⇡

�⇡

x sinmxdx

= �2

Z ⇡

0

x dhcosmx

m

idx

= �2

x cosmx

m

���⇡

0

�1

m

Z ⇡

0

cosmxdx

= �2

⇡ cosm⇡

m�

1

m2sinmx|⇡

0

= �2

h⇡ cosm⇡

m

i

if m is even if m is oddbm = �

2

m bm = 2

m

thus,

bm =2(�1)m+1

m

f(x) =1X

1

bm sinmx =1X

1

2(�1)m+1

msinmx = 2

sin x�

sin 2x

2+

sin 3x

3� · · ·

3.2.3 Example 2

f(x) =

⇢0 x (�⇡, 0]

sin x x (0, ⇡]

We first find am:a = 0,

am=0 = (f(x), 1) =1

Z ⇡

0

sin xdx

29

Page 7: Chapter 3 Fourier Analysis

a0 = �1

⇡cosx

����⇡

0

=2

am 6=0 = (f(x), cosmx) =1

Z ⇡

0

sin x cosmxdx =1

2⇡

Z ⇡

0

sin (1 +m)x+sin (1�m)xdx

m = 1,

a1 =1

2⇡

Z ⇡

0

sin 2xdx = 0

m 6= 0,1

= �1

2⇡

Z ⇡

0

d

cos (1 +m)x

1 +m+

cos (1�m)x

1�m

�dx

= �1

2⇡

cos (1 +m)x

1 +m+

cos (1�m)x

1�m

�����⇡

0

= �1

2⇡

✓(�1)m+1

� 1

1 +m+

(�1)m�1� 1

1�m

◆�

=(�1)m + 1

2⇡

1

1 +m+

1

1�m

=(�1)m + 1

⇡(1�m2)

At this point, all coe�cients am are defined and we refocus on the coe�cients bm.

bm = (f(x), sinmx) =1

Z ⇡

0

sin x sinmxdx

m = 1,

b1 =1

Z ⇡

0

sin2 xdx =1

2⇡

Z ⇡

0

(1� cos 2x)dx =1

2

m 6= 0,1

=1

Z ⇡

0

cos (1�m)x� cos (1 +m)xdx

=1

sin (1�m)x

1�m�

sin (1 +m)x

1 +m

�⇡

0

= 0

Concluding with a summary of all non-zero coe�cients

f(x) =1

⇡+

1

2sin x+

1X

2

(�1)m + 1

⇡(1�m2)cos(mx)

30

Page 8: Chapter 3 Fourier Analysis

3.3 Dirichlet’s Theorem

(1) if f(x) is defined on [�⇡, ⇡], and satisfies f(x+ 2⇡) = f(x) (periodic)(2) if f(x) is continuous except at a finite number of points on [�⇡, ⇡](3) has a finite number of maxima and minima in [�⇡, ⇡] (counter-example sin 1

x)(4)R ⇡

�⇡ |f(x)|dx 1 (bounded)

Then, at x = x0, the Fourier series for f(x) converges to(a) f(x0) if f(x)is continuous at x0

(b) 1

2

hlimx!x+

0f(x) + limx!x�

0f(x)

iif f(x) is discontinuous at x0

3.4 Projections

This section should provide additional intuition for the notation defined earlier inequation (3.8). We will use the example of the conclusions within equation (3.11) tosee the relationship between this notation and the concept of projection.

Suppose there exists two orthogonal vectors �!u ,�!v . In the case that the notationof equation (3.8) is representative of the dot product of f(x) and g(x),

(�!u ,�!u ) = (�!v ,�!v ) = 1

(�!u ,�!v ) = (�!v ,�!u ) = 0

In defining an arbitrary vector, A = x�!u + y�!v which is a linear combination ofour �!u �

�!v basis vectors we find the coe�cients, x and y, through systematic dotproducts with the basis vectors. This is equivalent to determining the projections ofA onto the �!u and �!v basis vectors.

(�!A,�!u ) = (x�!u + y�!v ) ·�!u = x

(�!A,�!v ) = (x�!u + y�!v ) ·�!v = y

Compare these equations to that determined for the coe�cients of fourier seriesin equations (3.17 - 3.19). By using this notation, we are essentially treating f(x) asa vector in a high dimensional space with cos(mx) and sin(mx) for m = 1, 2, . . . aswell as the constant function 1/2 as basis vectors.

31

Page 9: Chapter 3 Fourier Analysis

3.5 Change of Interval

We can generalize the case of [�⇡, ⇡] to that of an arbitrary symmetric intervalthrough a change of variables. We wish to apply the change of variable x = z⇡

L wherez is the new variable of integration and L is the period of the function.consider the function f(x) defined on [�L,L] and f(x+2L) = f(x) We already knowthat f(x) can be written in the form

f(x) =a02

+1X

n=1

(an cosnx+ bn sinnx)

We also know that the coe�cients can be found through multiplication by trigono-metric functions and integration on the bounds [�⇡, ⇡] for a function with a periodof ⇡. For example,

an =1

Z ⇡

f(x) cosmxdx

Changing variables to accommodate a function with period 6= ⇡, we find

an =1

Z L

�L

f⇣z⇡L

⌘cos⇣mz⇡

L

⌘d⇣z⇡L

⌘=

1

L

Z L

�L

f(z) cosm⇡z

Ldz

Thus, for arbitrary period, the Fourier series can be written as

f(z) =a02

+1X

n=1

an cosn⇡z

L+ bn sin

n⇡z

L

For a non-symmetric interval [A,B], we will define x0 = A+B2

= 0 and L = B�A2

andcontinue the analysis as described above.

3.6 ddx and

Rdx ! Fourier series

We know from section 3.2.2 that

f(x) =1X

n=1

2(�1)n+1

nsinnx

We would like to determine whether the equality remains when we di↵erentiate eachside.

df(x)

dx= 1 = 2

1X

n=1

(�1)n+1 cosnx

To declare equality, the equation should hold true for any value of x. for x = 0,

1 = 2 [1 + (�1) + 1 + (�1) + · · · ]

32

Page 10: Chapter 3 Fourier Analysis

Because the left hand side obviously does not converge, the equality cannot be true.Thus, di↵erentiation does not work in this case. Di↵erentiation always makes aFourier series less convergent. Because it makes it more spiky. And spiky functionsare less well represented by sines and cosines.

We would next like to follow a similar procedure for the integration of a fourierseries. For this, we will take a step function centered on x = 0 which steps from -1to 1.

f(x) =

⇢1 if x [0, ⇡1];�1 if x [�⇡, 0].

=4

1X

n=1(odd)

sinnx

n

We knowRf(x) = |x|. Taking the integral of the right hand side, we find

C +4

1X

n=1(odd)

cosnx

n2(�1) = |x|

Determining the value of the integration constant can be done by solving for theconstant term in the fourier series:

a0 = (f(x), 1) =1

Z ⇡

�⇡

|x|dx =2

Z ⇡

0

xdx =x2

����⇡

0

= ⇡

Thus,

|x| =⇡

2�

4

1X

n=1(odd)

cosnx

n2

Note that integration made the series more convergent. Because it makes the functionsmoother. Once again, we look at this series when x is set to 0. If we solve for ⇡,

⇡2

8=

1X

n=1(odd)

1

n2

3.7 Alternative form: f (x) =P

1

�1Cne

in⇡xL

As we know, cosine and sine functions can be written using exponentials. We will usethis fact to rewrite the generalized fourier series with only one coe�cient.

f(x) =a02

+1X

n=1

an cosn⇡x

L+ bn sin

n⇡x

L

an cosn⇡x

L+ bn sin

n⇡x

L= an

e

in⇡xL + e

�in⇡xL

2

!+ bn

e

in⇡xL � e

�in⇡xL

2i

!

33

Page 11: Chapter 3 Fourier Analysis

f(x) =a02

+1

2

1X

n=1

h(an � ibn) e

in⇡xL + (an + ibn) e

�in⇡xL

i

Taking a stretch, we can write this in terms of one constant:

f(x) =1X

n=�1Cne

in⇡xL

where Cn is defined as

Cn>0 =1

2(an � ibn)

Cn<0 =1

2(an + ibn)

C0 =a02

Surprisingly, all of these requirements can be satisfied with a constant of the form:

Cn =1

2

1

L

Z L

�L

f(x) cosn⇡x

Ldx�

i

L

Z L

�L

f(x) sinn⇡x

Ldx

�=

1

2L

Z L

�L

f(x)e�in⇡x

L dx

3.8 Parseval’s Identity

consider (f(x),f(x))1

L

Z L

�L

[f(x)]2dx

=

a02

+1X

n=1

an cosn⇡x

L+ bn sin

n⇡x

L,a02

+1X

n=1

an cosn⇡x

L+ bn sin

n⇡x

L

!

In order to write this in a compact way without losing cross terms, we will first resortfor a moment to a generalized notation of orthogonal basis vectors, ex and ey to the

arbitrary vector�!A .

(�!A,

�!A ) = (Axex + Ayey, Axex + Ayey)

By definition of notation, (ex, ex) = (ey, ey) = 1 and (ex, ey) = (ey, ex) = 0.

=�A2

x + A2

y

Note that if there were additional orthogonal basis vectors (if we were in a higherdimensional space), that the squares of the coe�cients of these vectors would besummed. The above case of the fourier transform can thus be written as

1

L

Z L

�L

|f(x)|2dx =a20

2+

1X

n=1

⇥|an|

2 + |bn|2⇤= 2

1X

n=1

|Cn|2

34

Page 12: Chapter 3 Fourier Analysis

Note that the factor of 2 within the a0 term is not squared because of its origins. Re-member that it exists as a result of a normalization of the bounds of integration whichhave not changed. We have found that Parseval’s theorem results in the discoverythat a vector/function is defined by the sum of the squares of its components.

3.8.1 Example 4.3.3 (Wong)

We first derive the Fourier series of f(x) = x2. We can do that by integrating theFourier series of f(x) = x term by term. Integrating the results of example 3.2.2, wefind

x2 = 2

Zxdx = C + 4

1X

n=1

cosmx

m2(�1)m

The constant of integration can then be found by computing a0 according to theEuler-Fourier formulae:

a0 =

Z ⇡

�⇡

x2dx =2⇡2

3

This yields a Fourier series for x2 on (�⇡, ⇡]:

x2 =⇡2

3+ 4

1X

m=1

cosmx

m2(�1)m

Note that by choosing x = ⇡ and remembering that cos(m⇡) = (�1)m we can obtain

⇡2 =⇡2

3+ 4

1X

m=1

1

m2)

1X

m=1

1

m2=

⇡2

6. (3.20)

Suppose we were now charged with the problem of defining the value of the sumP1n=1

1

n4 . We could do this by integrating twice more, and obtaining the Fourier seriesfor x4. But it is much easier to apply Parseval’s identity to the Fourier series we justderived for x2:

(x2, x2) =1

Z ⇡

�⇡

x4dx =2⇡4

9+

1X

m=1

16

m4=

2⇡4

5

1X

m=1

1

m4=

1

16

✓2⇡4

5�

2⇡4

9

◆=

1

90⇡4

. In just two simple lines with no obnoxious writing out of significant portions of theseries, we have succinctly determined the value of this series.

35

Page 13: Chapter 3 Fourier Analysis

3.9 Odd and even extensions

For an odd function f(x), defined on (�⇡, ⇡] and as the 2⇡-periodic extension else-where:

an = 0; bn =2

Z ⇡

0

f(x) sin(nx) dx. (3.21)

While, for an even function f(x), defiFourier transformned in the same way:

an =2

Z ⇡

0

f(x) cos(nx) dx; bn = 0. (3.22)

Therefore, as already seen in some examples above, an odd function has only sinefunctions in its Fourier series, while an even function has only cosine functions (andthe constant function) in its Fourier series.

Now we turn this idea around, and suppose we have a function f(x) that isonly defined on [0, ⇡). We can define two di↵erent extensions of this to the interval(�⇡, ⇡). (Actually we can define many, but let’s stick to two for now.) fe(x) is the“even extension” of f(x), while fo(x) is the odd extension of f(x). These even andodd extensions have di↵erent Fourier series:

fe(x) =a02

+1X

n=1

an cos(nx) (3.23)

f0(x) =1X

n=1

bn sin(nx), (3.24)

where the an’s and bn’s are given by Eqs. (3.21) and (3.22).Very often in a physics problem you will only have f(x) on an interval [0, L].

Which Fourier series you want to use to extend the function to (�1,1) will dependon the physics problem at hand. Should your function be a function of period L? Inthis case you could write, for example,

f(x) =1X

n=�1cne

2in⇡xL ; cn =

Z L

0

f(x)e�2in⇡x

L dx. (3.25)

But you could also decide the period should be 2L, and that what you really want isthe even or odd extension of f(x) to (�L,L) and then the 2L periodic extension ofthat function to the rest of the real line. It’s worth thinking about what the physicsof your problem (boundary conditions, parity symmetry, etc.) tells you about theproperties of Fourier series you should use in that particular problem.

36