36
Da-Chuan Cheng, PhD 1 111/06/10 Da-Chuan Cheng, PhD 1 Chapter 3: Fourier Series • Introduction – In 1808, Fourier wrote the first version of his celebrated memoir on the theory of heat “Theorie Analytique de la Chaleur”. He made a detailed study of trigonometric series, which he used to solve a variety of heat conduction problems. – Nearly two centuries after Fourier’s work, the series that bears his name is still important, practically and theoretically, and still a topic of current research.

Chapter 3: Fourier Series

  • Upload
    tarika

  • View
    83

  • Download
    6

Embed Size (px)

DESCRIPTION

Chapter 3: Fourier Series. Introduction In 1808, Fourier wrote the first version of his celebrated memoir on the theory of heat “Theorie Analytique de la Chaleur”. He made a detailed study of trigonometric series, which he used to solve a variety of heat conduction problems. - PowerPoint PPT Presentation

Citation preview

Page 1: Chapter 3: Fourier Series

Da-Chuan Cheng, PhD 1112/04/20 Da-Chuan Cheng, PhD 1

Chapter 3: Fourier Series

• Introduction– In 1808, Fourier wrote the first version of his

celebrated memoir on the theory of heat “Theorie Analytique de la Chaleur”. He made a detailed study of trigonometric series, which he used to solve a variety of heat conduction problems.

– Nearly two centuries after Fourier’s work, the series that bears his name is still important, practically and theoretically, and still a topic of current research.

Page 2: Chapter 3: Fourier Series

Da-Chuan Cheng, PhD 2Da-Chuan Cheng, PhD 2

Computation of Fourier series : Real form

1 10 )sin()cos()(

:seriesFourier in the , and ts,coefficienFourier thecompute we interval On the

k kkk

kk

kxbkxaaxf

baπ,x-π

Important properties of Fourier series:

otherwise0

0 if2

1 if1

)cos()cos(1

kn

kn

dxkxnx(1)

otherwise0

1 if1)sin()sin(

1 kndxkxnx(2)

.,integer allfor 0)sin()cos(

1kndxkxnx

integers. are ,kn

(3)

,2,1k

Page 3: Chapter 3: Fourier Series

Da-Chuan Cheng, PhD 3112/04/20 Da-Chuan Cheng, PhD 3

Computation of Fourier series : Real form

,

)2sin(,

)sin(,

2

1,

)cos(,

)2cos( ,

xxxx

An equivalent way of starting this theorem is that the collection

is an orthonormal set of functions in ]),([2 L

Page 4: Chapter 3: Fourier Series

Da-Chuan Cheng, PhD 4

Matlab program

Da-Chuan Cheng, PhD 4

% Confirm page 3.L=37; % L can be any positive integer.t=[-pi:(2*pi)/L:pi]; % range is from -pi to (pi- dt)t=t(1:end-1);y=cos(t)/sqrt(L/2); % equation in page 3. y=cos(t).disp(['The length of vector y=cos(t) is : ']);sum(y.^2) % confirm the length=1.figure(1); plot(t,y); hold on;

長度不是 π﹐而是 L/2

The length of vector y=cos(t) is :

ans =

1.0000

Page 5: Chapter 3: Fourier Series

Da-Chuan Cheng, PhD 5Da-Chuan Cheng, PhD 5

Page 6: Chapter 3: Fourier Series

Da-Chuan Cheng, PhD 6Da-Chuan Cheng, PhD 6

z1=sin(t)/sqrt(L/2); % equation in page 3. y=sin(t).disp(['The length of vector y=sin(t) is : ']);sum(z1.^2) % confirm the length=1.figure(1); plot(t,z1); hold on;

The length of vector y=sin(t) is :

ans =

1.0000

Page 7: Chapter 3: Fourier Series

Da-Chuan Cheng, PhD 7Da-Chuan Cheng, PhD 7

y1=cos(2*t)/sqrt(L/2); % y=cos(2t).disp(['The length of vector y1=cos(2t) is : ']);sum(y1.^2) % confirm the length=1.figure(1); plot(t,y1,'y');

The length of vector y1=cos(2t) is :

ans =

1

Page 8: Chapter 3: Fourier Series

Da-Chuan Cheng, PhD 8Da-Chuan Cheng, PhD 8

% Confirm cos(t)sin(t)=0z = cos(t).*sin(t);sum(z)

ans =

4.9960e-016

% confirm cos(t)*sin(2t)=0z = cos(t).*sin(2*t);sum(z)

ans =

-1.1102e-015

Page 9: Chapter 3: Fourier Series

Da-Chuan Cheng, PhD 9

Computation of Fourier series : Real form

Da-Chuan Cheng, PhD 9

Proof of the properties on page 2:

The derivations of the first two equalities use the following identities:

.sinsincoscos))cos((sinsincoscos))cos((kxnxkxnxxknkxnxkxnxxkn

) if(0)sin()sin(

2

1

)))cos(())(cos((2

1coscos

knkn

xkn

kn

xkn

dxxknxknkxdxnx

Page 10: Chapter 3: Fourier Series

Da-Chuan Cheng, PhD 10112/04/20 Da-Chuan Cheng, PhD 10

Computation of Fourier series : Real form

dxnxnxdxkn )2cos1)(2/1(cos then,1 If 2

proof.) the(Complete.21)/1( then ,0 If

dxkn

Equation (2) and (3) can be proved in a similar way.

Fourier coefficients computation:

1 1

0 )sin()cos()(k k

kk kxbkxaaxfAssume

nxdxkxbkxaanxdxxfa

k kkn cos)sin()cos(1

cos)(1

: find To10

Note that k starts from 1, why? (Hint: see page 2, Eq.(1))

Page 11: Chapter 3: Fourier Series

Da-Chuan Cheng, PhD 11112/04/20 Da-Chuan Cheng, PhD 11

Computation of Fourier series : Real form

nn

kk

kk

kk

kk

k kk

aa

dxnxkxb

dxnxkxanxn

a

dxnxkxb

dxnxkxadxnxa

dxnxkxbkxaa

00

)cos()sin(1

)cos()cos(1

|)sin(11

)cos()sin(1

)cos()cos(1

)cos(1

)cos()sin()cos(1

1

10

1

10

10

Page 12: Chapter 3: Fourier Series

Da-Chuan Cheng, PhD 12112/04/20 Da-Chuan Cheng, PhD 12

Computation of Fourier series : Real form

1)cos()(1

nadxnxxf n

1)sin()(1

Similarly,

nbdxnxxf n

000 2

1)(

2

1: find To adxadxxfa

實際上就是訊號 f(x)的平均值

Page 13: Chapter 3: Fourier Series

Da-Chuan Cheng, PhD 13112/04/20 Da-Chuan Cheng, PhD 13

Computation of Fourier series : Real form

Theorem:

1 1

0 )sin()cos()(k k

kk kxbkxaaxfIf

then,

dxxfa )(

2

10

1)cos()(1

ndxnxxfan

1)sin()(1

ndxnxxfbn

The Fourier coefficients for a given function are unique.

Page 14: Chapter 3: Fourier Series

Da-Chuan Cheng, PhD 14

Matlab implementation

Da-Chuan Cheng, PhD 14

% Page 13.L=64; % L can be any positive integer.t=[-pi:(2*pi)/L:pi]; % range is from -pi to (pi- dt)t=t(1:end-1); f=rand(1,L).*sin(rand(1,L)*2); figure; plot(t,f); a0=mean(f) a1=sum(f.*cos(t))/L/2b1=sum(f.*sin(t))/L/2

Page 15: Chapter 3: Fourier Series

Da-Chuan Cheng, PhD 15

Change the representation form

)]cos(,),[cos(),cos(; kkkxx see p.13

)]cos(,),[cos(),cos(;

kka

xkaxa

)]cos(,),[cos(),2

2cos(;

kk

a

xkaxa

or

Page 16: Chapter 3: Fourier Series

Da-Chuan Cheng, PhD 16

Computation of Fourier series : Real form

Theorem:

1 10 )/sin()/cos()(

k kkk axkbaxkaaxfIf

then, a

adxxf

aa )(

2

10

1)2

2cos()(

1

ndx

a

nxxf

aa

a

an

1)2

2sin()(

1

ndx

a

nxxf

ab

a

an

Page 17: Chapter 3: Fourier Series

Da-Chuan Cheng, PhD 17112/04/20 Da-Chuan Cheng, PhD 17

Computation of Fourier series : Real form

Even and odd functions

).()( if odd is );()( ifeven is

function; a be :Let :Definition

xfxffxfxffRRf

The following properties follow from the definition.

Even X Even = EvenEven X Odd = OddOdd X Odd = Even

If F is an even function, then

aa

adxxFdxxF

0)(2)(

If F is an odd function, then 0)( a

adxxF

Page 18: Chapter 3: Fourier Series

Da-Chuan Cheng, PhD 18112/04/20 Da-Chuan Cheng, PhD 18

Computation of Fourier series : Real form

Theorem:

a

k

a

kk

dxaxkxfa

a

dxxfa

a

axkaaxf

0

00

10

)/cos()(2

)(1

with)/cos()(

cosines. haveonly will][ interval on the seriesFourier its then function,even an is )( If

-a,axf

sines. haveonly will][ interval on the seriesFourier its then function, oddan is )( If

-a,axf

a

k

kk

dxaxkxfa

b

axkbxf

0

1

)/sin()(2

with)/sin()(

Page 19: Chapter 3: Fourier Series

Da-Chuan Cheng, PhD 19112/04/20 Da-Chuan Cheng, PhD 19

Computation of Fourier series : Real form

Gibbs phenomenon

Approximation of square wave in 5 steps

The height of the blip is approximately the same no matter how many terms are considered in the partial sum.

Page 20: Chapter 3: Fourier Series

Da-Chuan Cheng, PhD 20112/04/20 Da-Chuan Cheng, PhD 20

Computation of Fourier series (1) : Complex form

Complex form of Fourier Series

Often, it is more convenient to express Fourier series in complex form using the complex exponentials due to the simple computational properties of these functions.

Definition:

1 where)sin()cos(

:is lexponentiacmplex thenumber t, realany For

ititeit

This definition is motivated by substituting x=it into the Taylor series for xe

)sin()cos()!5!3

()!4!2

1(

!4

)(

!3

)(

!2

)()(1

with !4!3!2

1

5342

432

432

tittt

titt

itititite

itxxxx

xe

it

x

Page 21: Chapter 3: Fourier Series

Da-Chuan Cheng, PhD 21112/04/20 Da-Chuan Cheng, PhD 21

Computation of Fourier series (2) : Complex form

Lemma:

itit

stiisit

stiisit

itit

it

itti

ieedt

deeeeee

eee

ee

)(

/

1||

)(

)(

)2(

Theorem:

]).,([Lin lorthonorma is ,2,1,0,1,2, ,2

functions ofset The 2

ne int

Proof:

mnmn

mni

edtedteeee

tmnitmniimtimt

if2 if0

)(,

)()(intint

Page 22: Chapter 3: Fourier Series

Da-Chuan Cheng, PhD 22112/04/20 Da-Chuan Cheng, PhD 22

Computation of Fourier series (3) : Complex form

Theorem:

dtetfa

teatf

n

nn

int

int

)(2

1then

, interval on the )( If

Combine with the previous theorem in Chap2 p.7, we get the following theorem:

Proof: To find na we simply substitute f(t) into:

dtntmtntmtintmtintmta

dtntintmtimtadteea

nn

nn

tin

n

imtn

))sin()sin()sin()cos()cos()sin()cos()(cos(2

1

))sin()))(cos(sin()(cos(2

1

2

1

Use the properties in p.2.

Page 23: Chapter 3: Fourier Series

Da-Chuan Cheng, PhD 23112/04/20 Da-Chuan Cheng, PhD 23

.,integer allfor 0)sin()cos(

1mndxmxnx

dtntmtntmtintmtintmtann

))sin()sin()sin()cos()cos()sin()cos()(cos(2

1

Property (3)

0 0

(1) n≠m

otherwise0

0 if2

1 if1

)cos()cos(1

mn

mn

dxmxnx

otherwise0

1 if1)sin()sin(

1 mndxmxnx

=0

Page 24: Chapter 3: Fourier Series

Da-Chuan Cheng, PhD 24112/04/20 Da-Chuan Cheng, PhD 24

dtntmtntmtann

))sin()sin()cos()(cos(2

1

(2) n=m=0 000 22

1)0cos(

2

1aadta

(3) n=m 1≧ nnn adtadtntnta

2

1))(sin)((cos

2

1 22

Page 25: Chapter 3: Fourier Series

Da-Chuan Cheng, PhD 25112/04/20 Da-Chuan Cheng, PhD 25

Computation of Fourier series (4) : Complex form

So the complex Fourier series of f is

k

tki

n

tinn e

k

iea )12(

)12(

2

Example:

0 if1

0 if1)(

t

ttf

The n-th complex Fourier coefficients is:

even isn if0

odd isn if2]1)[cos(

))]cos(1(1)[cos(2

]||[)(

1

2

1

2

1

2

1)(

2

1 00

0

0

n

i

n

ninn

n

i

eein

dtedtedtetfa tintintintinntin

Page 26: Chapter 3: Fourier Series

Da-Chuan Cheng, PhD 26112/04/20 Da-Chuan Cheng, PhD 26

Computation of Fourier series (5) : Complex form

t=[-pi:2*pi/1024:pi];t=t(1:end-1);fs=zeros(1,length(t));N=100;K=[-N:N];for k=K; fs=fs+2/((2*k+1)*pi)*sin((2*k+1)*t);end; figure(1); subplot(121); plot(t,fs); fc=zeros(1,length(t));for k=K, fc=fc-2/((2*k+1)*pi)*cos((2*k+1)*t);end;figure(1); subplot(122); plot(t,fc);

Matlab implementation

k

tkiek

i )12(

)12(

2

0 if1

0 if1)(

t

ttf

Page 27: Chapter 3: Fourier Series

Da-Chuan Cheng, PhD 27112/04/20 Da-Chuan Cheng, PhD 27

Computation of Fourier series (6) : Complex form

Result: k=-10:10

real part imaginary part

Page 28: Chapter 3: Fourier Series

Da-Chuan Cheng, PhD 28112/04/20 Da-Chuan Cheng, PhD 28

Computation of Fourier series (7) : Complex form

Result: k=-50:50

real part imaginary part

Page 29: Chapter 3: Fourier Series

Da-Chuan Cheng, PhD 29112/04/20 Da-Chuan Cheng, PhD 29

Computation of Fourier series (8) : Complex form

Result: k=-100:100

real part imaginary part

Page 30: Chapter 3: Fourier Series

Da-Chuan Cheng, PhD 30112/04/20 Da-Chuan Cheng, PhD 30

Computation of Fourier series (9) : Complex form

Result: k=-10000:10000

real part imaginary part

Page 31: Chapter 3: Fourier Series

Da-Chuan Cheng, PhD 31112/04/20 Da-Chuan Cheng, PhD 31

Computation of Fourier series (10) : Complex form

Theorem: The set of functions

]).,([Lfor basis lorthonormaan is ,2,1,0,1,2, ,2

2 aana

e a

t/in

a

a

atinn

n

atinn dtetf

aαetf // )(

2

1 then ,)( If

Example:

01 if1

10 if1)(

t

ttf

n

ni

ninninn

i

eein

dtedtedtetfa

ndst

tintintintintnin

]1)[cos(

]))sin()(cos()01()01())sin()(cos([2

]||[)(

1

2

1

2

1

2

1)(

2

1

term2 term1

01

10

0

1

1

0

1

1

Page 32: Chapter 3: Fourier Series

Da-Chuan Cheng, PhD 32112/04/20 Da-Chuan Cheng, PhD 32

Computation of Fourier series (11) : Complex form

Relation between the real and complex Fourier series

If f is a real valued function, the real form of its Fourier series can be derived from its complex form and vice versa. For simplicity, we discuss this derivation on the interval -π t π, but this discussion also holds for other ≦ ≦intervals as well.

.)(2

1 where)(

termpositive

10

termnegative

1

dtetfeetf tin

nn

tinn

n

tinn

If f is real valued, then because nn

ntintin

n dtetfdtetf

)(2

1)(

2

1

n≠0

Page 33: Chapter 3: Fourier Series

Da-Chuan Cheng, PhD 33112/04/20 Da-Chuan Cheng, PhD 33

Computation of Fourier series (12) : Complex form

termnegative

1

termpositive

10)(

n

tinn

n

tinn eetf

10 Re2)(

}Re{2

n

tinnetf

zzz

Page 34: Chapter 3: Fourier Series

Da-Chuan Cheng, PhD 34112/04/20 Da-Chuan Cheng, PhD 34

Computation of Fourier series (13) : Complex form

00 )(2

1adttf

)(2

1

))sin())(cos((2

1

1for )(2

1

nn

tinn

iba

dtntinttf

ndtetf

similar to p. 13

(see p. 13)

Page 35: Chapter 3: Fourier Series

Da-Chuan Cheng, PhD 35112/04/20 Da-Chuan Cheng, PhD 35

Computation of Fourier series (14) : Complex form

10

10

10

)sin()cos(

))sin())(cos((Re

Re2)( Recall

nnn

nnn

n

tinn

ntbnta

ntintiba

etf

Exactly the same to page 13.

Page 36: Chapter 3: Fourier Series

Da-Chuan Cheng, PhD 36

Homework

• 請自行找出一個長 32的信號﹐寫 Matlab程式將其 Fourier series的係數 (a0, an, bn)找出。

• Issue date: 5/5

• Due date: 19/5