Euler Identities i - Cal Polydhartig/Pages/344/FourierSeriesHandouts/Complexl... · The complex...

7

Click here to load reader

Transcript of Euler Identities i - Cal Polydhartig/Pages/344/FourierSeriesHandouts/Complexl... · The complex...

Page 1: Euler Identities i - Cal Polydhartig/Pages/344/FourierSeriesHandouts/Complexl... · The complex Fourier series is obtained from (1) ... It consists of the points ... The function

Math 344 Complex Fourier SeriesMay 24, 2012 Part I: Introduction

The Fourier series representation for a function f of period P ,

f(t) =a02

+

∞∑k=1

ak cos(kωt) + bk sin(kωt) , ω = 2π/P , (1)

can be expressed more simply using complex exponentials. Moreover, because of the unique properties of theexponential function, Fourier series are often easier to manipulate in complex form. We will see one interestingexample in Part II of this handout. More will be discussed in Week 10.

The transition from the real form to the complex form of a Fourier series is made using the following identities,called Euler Identities,

ei θ = cos(θ) + i sin(θ)

ande−i θ = cos(θ)− i sin(θ) .

Adding these identities, and then dividing by 2, or subtracting them, and then dividing by 2i, will show that

cos(θ) =eiθ + e−iθ

2and sin(θ) =

eiθ − e−iθ

2i. (2)

These formulas for the sine and cosine should be compared to the definitions of the hyperbolic cosine and sine, coshand sinh:

cosh(θ) =eθ + e−θ

2and sinh(θ) =

eθ − e−θ

2.

The complex Fourier series is obtained from (1) by writing cos(kωt) and sin(kωt) in their complex exponentialform and rearranging as follows:

f(t) =a02

+

∞∑k=1

akeikωt + e−ikωt

2+ bk

eikωt − e−ikωt

2i

=a02

+

∞∑k=1

12 (ak − ibk)eikωt + 1

2 (ak + ibk)e−ikωt

= c0 +

∞∑k=1

ckeikωt + c−ke

−ikωt .

The last line is obtained by making the definitions

c0 = 12a0 , ck = 1

2 (ak − ibk) , c−k = 12 (ak + ibk) . (3)

Observe that c−k is the complex conjugate of ck: c−k = ck.

The complex sum that was just obtained can also be written in one of the following three equivalent forms.

Alternate Forms for a Complex Fourier Series

f(t) = c0 +

∞∑k=1

2<(ckeikωt) (4a)

f(t) = c0 +

∞∑k=−∞k 6=0

ckeikωt (4b)

f(t) =

∞∑k=−∞

ckeikωt (4c)

The first form, (4a), is a consequence of the fact that c−ke−ikωt is the complex conjugate of cke

ikωt. This impliesthat

ckeikωt + c−ke

−ikωt = 2<(ckeikωt)

1

Page 2: Euler Identities i - Cal Polydhartig/Pages/344/FourierSeriesHandouts/Complexl... · The complex Fourier series is obtained from (1) ... It consists of the points ... The function

where <(ckeikωt) denotes the real part of the expression cke

ikωt.

Some comments:

1. Formula (4a) makes the transition from the complex series to its real form. Its use is recommended whenploting partial sum approximations in complex form using a computer algebra system like Maple.

2. An explicit complex Fourier series is usually written using formula (4b). This is because the constant term, c0 ,is almost never equal the formula obtained by substituting k = 0 into the formula for ck. On the other hand,it is always the case that c−k can be obtained from the formula for ck by replacing k with −k.

3. Comment 2 does not preclude the possibility of writing the complex series in the form given in (4c) and addingseparate formulas for c0 and ck. This is worth emphasizing because (4c) is clearly the nicest of these threealternatives. What makes it even nicer is the fact that there is just one integral formula for the computationof all of the complex coefficients, ck. This will be shown below.

4. A word of caution: If partial sums for (4b) or (4c) are used to approximate the function f , then the sum must

be in the symmetric form Sn(x, t) =

n∑k=−n

ckeikωt because this will yield the nth Fourier approximation.

An integral formula for ck

The kth complex coefficient ck can always be obtained from the real coefficients using the formula

ck = 12 (ak − ibk) .

This would require two integrations. However, ck can also be obtained directly from the function f with just oneintegration. This is because

ck =1

P

∫ P

0

f(t)e−ikωt dt . (5)

To see why, observe that

ck =1

2(ak − ibk) =

1

2

(2

P

∫ P

0

f(t) cos(kωt) dt− i · 2

P

∫ P

0

f(t) sin(kωt) dt

)

=1

2· 2

P

∫ P

0

f(t)(cos(kωt)− i sin(kωt)) dt

=1

P

∫ P

0

f(t)e−ikωt dt .

When the calculation of ck is made using (5), the integral can be evaluated over any periodic interval. Moreover,once ck has been found, both real Fourier series coefficients can then be obtained by solving the defining equationck = 1

2 (ak − ibk) for ak and bk as follows.

ak = 2<(ck) and bk = −2=(ck) . (6)

Here, <(ck) and =(ck) denote the real part and the imaginary part of ck.The following example illustrates these observations.

Example 1. Obtain the complex Fourier series representation for the function f of period P = 2 defined as followsfor 0 < t < 2.

f(t) =

{t , 0 < t < 10 , 1 < t < 2

Sketch the approximation S3(t) and analyze the error. Use the complex coefficient formula to obtain the real Fourierseries coefficients for f .

Solution. Let’s begin with a picture of the waveform.

2

Page 3: Euler Identities i - Cal Polydhartig/Pages/344/FourierSeriesHandouts/Complexl... · The complex Fourier series is obtained from (1) ... It consists of the points ... The function

tK3 K2 K1 0 1 2 3 4

0.5

1.0

The function f has period 2.

Since P = 2, the fundamental frequency is ω = 2π/P = π, therefore f(t) =∑∞k=−∞ cke

ikπt . By inspection of the

graph, c0 = (0 + 1/2)/2 = 1/4 and using integration-by-parts with u = t and dv = e−ikπt dt,

ck =1

2

∫ 2

0

f(t)e−ikπt dt =1

2

∫ 1

0

te−ikπt dt

=1

2

(te−ikπt

−ikπ+

1

ikπ

∫e−ikπt dt

) ∣∣∣∣t=1

t=0

=1

2

(e−ikπ

−ikπ+e−ikπ − 1

−i2k2π2

)=

1

2

((−1)k

kπi+

(−1)k − 1

k2π2

)The transition to the final formula was aided by the fact that e±ikπ = (−1)k when k is an integer.

The following plot shows the function and its third Fourier approximation, S3(t).

tK3 K2 K1 0 1 2 3 4

0.5

1.0

The function f and S3(t).

Error Analysis

The family of complex exponential functions{eikωt

}∞k=−∞ is orthogonal on [0, P ] with respect to the complex inner

product 〈f, g〉 =∫ P0f(t)g(t) dt. Moreover, ‖eikωt‖2 = P .1 Because of this, the complex form of the nth mean square

error has the following simple form. Compare formula (7) below to the MSE formula for a real Fourier series in theClassical Fourier Series handout.

MSE =1

P

∫ P

0

f(t)2 dt−n∑

k=−n

|ck|2 . (7)

The calculation of MSE for the nth approximation for this example proceeds as follows.2

MSE =1

2

∫ 2

0

f(t)2 dt−n∑

k=−n

|ck|2

=1

2

∫ 1

0

t2 dt−

(c20 + 2

n∑k=1

|ck|2)

=1

6−

(1

16+ 2

n∑k=1

1

4

(1

k2π2+

((−1)k − 1)2

k4π4

))

=5

48− 1

2

n∑k=1

(1

k2π2+

((−1)k − 1)2

k4π4

)1This is an integral calculation.

2n∑

k=−n

|ck|2 = c20 + 2

n∑k=1

|ck|2 because c0 is real and |ck| = |c−k|.

3

Page 4: Euler Identities i - Cal Polydhartig/Pages/344/FourierSeriesHandouts/Complexl... · The complex Fourier series is obtained from (1) ... It consists of the points ... The function

When n = 3, MSE = 0.0144 yielding a relative RSE error of√

2 ·MSE/‖f‖ = 0.294, or about 30%. This is ratherlarge, reflecting the error at the jump discontinuity. However, in terms of the average power in one cycle, the relativeMSE error associated with S3(t) is less than 9%:

MSE/

12

∫ 2

0

f(t)2 dt = 0.0866 = 8.66% .

The large difference in the two relative errors is also clearly evident from the amplitude and power spectra of f .

The Amplitude and Power Spectra for the Complex Series

When the complex Fourier series is used to represent a periodic function, then the amplitude spectrum, sketchedbelow, is two-sided. It consists of the points (kω, |ck|) for k = 0,±1,±2,±3, . . . .

K8 p K6 p K4 p K2 p 0 2 p 4 p 6 p 8 p

0.1

0.2

The two-sided amplitude spectrum of the function f in Example 1.

The power spectrum for f is also two-sided, consisting of the points (kω, |ck|2) for k = 0,±1,±2,±3, . . . .

K8 p K6 p K4 p K2 p 0 2 p 4 p 6 p 8 p

0.02

0.04

0.06

The two-sided power spectrum of the function f in Example 1.

Calculation of the real coefficients.

Repeating the formula for ck, but in standard form for a complex number,

ck =1

2· (−1)k − 1

k2π2+

1

2· (−1)k

kπi ,

shows that

ak = 2<(ck) =(−1)k − 1

k2π2and bk = −2=(ck) = − (−1)k

kπ.

The following example is related to Example 5 in the Classical Fourier Seried handout.

Example 2. Obtain the complex Fourier series representation for the function of period P = 2π defined as f(t) = sin(t)for 0 < t < π and 0 for π < t < 2π. See its graph below. Plot f and S3(t), make an error analysis, including theamplitude and power spectra, and obtain the real Fourier series coefficients.

tKp 0 p 2 p 3 p

0.5

1.0

The function f is neither even nor odd.

4

Page 5: Euler Identities i - Cal Polydhartig/Pages/344/FourierSeriesHandouts/Complexl... · The complex Fourier series is obtained from (1) ... It consists of the points ... The function

Solution. Since P = 2π, the fundamental frequency is ω = 2π/P = 1. Therefore,

f(t) =

∞∑k=−∞

ckeikt .

The kth coefficient, ck, will be calculated using the complex formula for sin(t). This simplifies the integrationconsiderably.

ck =1

∫ 2π

0

f(t)e−ikt dt =1

∫ π

0

1

2i(eit − e−it)e−ikt dt

=1

4πi

∫ π

0

eit(1−k) − e−it(1+k) dt (line 2)

=1

4πi

(eit(1−k)

(1− k)i+e−it(1+k)

(1 + k)i

) ∣∣∣∣∣t=π

t=0

=1

4πi2

(eiπ(1−k) − 1

1− k+e−iπ(1+k) − 1

1 + k

)(line 4)

=1 + (−1)k

(1

1− k+

1

1 + k

)(line 5)

=1 + (−1)k

2π(1− k2)

Some comments on this calculation:

1. The transition from line 4 to line 5 used the fact that, because k is an integer, eiπ(1−k) = e−iπ(1+k) = −(−1)k.

2. The final formula for ck shows that c0 = 1/π.

3. The value of c1 must be obtained using a separate calculation. Working from line 2, substitute k = 1 to obtain

c1 =1

4πi

∫ π

0

1− e−2it dt =1

4πi

(t+

e−2it

2i

) ∣∣∣∣π0

4πi= − i

4.

Putting this all together, we get the following complex Fourier series representation. Note that c−1 = c1 = i/4.

f(t) =1

π− i

4eit +

i

4e−it +

1

∞∑k=−∞k 6=0,±1

1 + (−1)k

1− k2eikt .

The plot of f along with S1, S2, and S3 is displayed below. S3 is the same as S2, and is hardly visible.

tKp 0 p 2 p 3 p

0.5

1.0

The function f and its approximations S1 (dotted),S2 (dashed), and S3 (same as S2).

Error Analysis

5

Page 6: Euler Identities i - Cal Polydhartig/Pages/344/FourierSeriesHandouts/Complexl... · The complex Fourier series is obtained from (1) ... It consists of the points ... The function

The calculation of MSE for the nth approximation proceeds as follows.

MSE =1

∫ 2π

0

f(t)2 dt−n∑

k=−n

|ck|2

=1

∫ π

0

sin2(t) dt−

(c20 + 2

n∑k=1

|ck|2)

=1

4−

(1

π2+ 2 · 1

16+ 2 · 1

4π2

n∑k=2

(1 + (−1)k)2

(1− k2)2

)

=1

8− 1

π2+

1

2π2

n∑k=2

(1 + (−1)k)2

(1− k2)2

When n = 3, MSE = 0.00116 yielding a relative RSE error of√

2π ·MSE/‖f‖ = 0.0682, or about 7%. This is small,reflecting the excellent quality of the approximation. See the amplitude spectrum for f , sketched below.

K10 K9 K8 K7 K6 K5 K4 K3 K2 K1 0 1 2 3 4 5 6 7 8 9 10

0.1

0.2

0.3

The two-sided amplitude spectrum of the function f .

In terms of the average power in one cycle, the relative MSE error associated with S3(t) is less than 0.5%:

MSE/

12π

∫ 2π

0

f(t)2 dt = 0.00465 = 0.465% .

The power spectrum for f , sketched below, shows that S2(t) carries essentially all of the power in this waveform.

K10 K9 K8 K7 K6 K5 K4 K3 K2 K1 0 1 2 3 4 5 6 7 8 9 10

0.04

0.08

The two-sided power spectrum of the function f .

Calculation of the real coefficients.

Since c1 = −i/4, it has no real part. Therefore, a1 = 0 and b1 = −2=(c1) = 1/2. On the other hand, when k ≥ 2,ck is real so bk = 0, and ak = 2ck = (1 + (−1)k)/π(1− k2).

Using this information, the real Fourier series for f is

f(t) =1

π+

1

2sin(t) +

1

π

∞∑k=2

1 + (−1)k

1− k2cos(kt)

=1

π+

1

2sin(t) +

2

π

∞∑k=1

cos(2kt)

1− 4k2.

If this looks familiar, it should. In Example 5 of the Classical Fourier Series handout we derived the Fourier seriesfor the similar waveform sketched below.

tKp 0 p 2 p 3 p

0.5

1.0

The function g(t) = sin(t), 0 < x < π, period P = π.

6

Page 7: Euler Identities i - Cal Polydhartig/Pages/344/FourierSeriesHandouts/Complexl... · The complex Fourier series is obtained from (1) ... It consists of the points ... The function

There it was shown that g has the following Fourier series representation.

g(t) =2

π+

4

π

∞∑k=1

cos(2kt)

1− 4k2

These two waveforms are particularly useful in engineering applications.

7