Fourier Interpolation. The Fourier Method of Interpolation is a way a interpolating data that uses...

7
Fourier Interpolation

Transcript of Fourier Interpolation. The Fourier Method of Interpolation is a way a interpolating data that uses...

Page 1: Fourier Interpolation. The Fourier Method of Interpolation is a way a interpolating data that uses combinations of sin( px ) and cos( px ) where p is.

Fourier Interpolation

Page 2: Fourier Interpolation. The Fourier Method of Interpolation is a way a interpolating data that uses combinations of sin( px ) and cos( px ) where p is.

Fourier Interpolation

The Fourier Method of Interpolation is a way a interpolating data that uses combinations of sin(px) and cos(px) where p is an integer. This method of interpolation has several major advantages over polynomial interpolation that we have previously studied.

1. This will be able data that occurs in cycles more naturally than polynomial interpolation. This is especially useful in modeling certain physical phenomenon such as temperature, thermal and electrical energy.

2. When it is applied to more than one variable it does not restrict the data being modeled to be a function like Newton’s and Lagrange’s methods.

Trigonometric Polynomials

A trigonometric polynomial of degree m (am0 or bm0) is a polynomial of the form:

m

kk

m

kk

a

m

ma

tkbtka

mtbtbtbtb

mtatatatatf

112

321

3212

)sin()cos(

)sin()3sin()2sin()sin(

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

0

0

Page 3: Fourier Interpolation. The Fourier Method of Interpolation is a way a interpolating data that uses combinations of sin( px ) and cos( px ) where p is.

Data Sets for Fourier Interpolation

Data for Fourier Interpolation is always assumes to be at evenly spaced intervals of the independent variable (we usually refer to as t). For ease of calculation we will assume the variable t is in the half closed interval [0,2). The data set with n data items is usually given in the form {x0, x1, x2, …,xn-1}, but it really represents the data:

1)1(222

41

20 ,,...,,,...,,,,,,0

nn

nkn

knn xxxxx

Degree of a Trigonometric Interpolating Polynomial

For a data set of the with n data above the degree of the polynomial depends on if n is even or odd. If m is the degree of the trigonometric polynomial the relation between n and m is that:

n = 2m+1 (if n is odd) and n = 2m (if n is even)

)(2

1oddisnif

nm

)(

2evenisnif

nm

For example the data set {1,3,-5,2} will be of degree 2 (i.e. n = 4) while {1,3,-5,2,6,-1,4} will be of degree 3 (n = 7).

Page 4: Fourier Interpolation. The Fourier Method of Interpolation is a way a interpolating data that uses combinations of sin( px ) and cos( px ) where p is.

Interpolating Polynomials

Because of the distinction between even and odd the interpolating polynomials take on two different forms. One if the data set has an even number of data items another if it is odd.

This is the form if n (the number of data points) is odd:

)sin()3sin()2sin()sin(

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

321

32120

mtbtbtbtb

mtatatatatf

m

ma

This is the form if n (the number of data points) is even (notice the am term):

)sin()3sin()2sin()sin(

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

321

232120

mtbtbtbtb

mttatatatf

m

aa m

In either case the aj and bj terms are given by:

1

0

21

0

2 sin2

cos2 n

knk

kj

n

knk

kj jxn

bandjxn

a

Page 5: Fourier Interpolation. The Fourier Method of Interpolation is a way a interpolating data that uses combinations of sin( px ) and cos( px ) where p is.

Example: Let’s use a Fourier Interpolation of the data {1,3,-5,2}

This gives n=4 so m=4/2=2 as before. We begin by computing a0, a1, a2, b1, b2. (Notice from the formula we can assume b0 is always 0.)

2

12531

2

10cos20cos50cos30cos1

2

1

0cos20cos50cos30cos14

2

0

432

422

412

402

0

a

a

305012

1cos2cos5cos30cos1

2

1

1cos21cos51cos31cos14

2

23

21

432

422

412

402

1

a

a

2

92531

2

13cos22cos5cos30cos1

2

1

2cos22cos52cos32cos14

2

2

432

422

412

402

2

a

a

000002

10sin20sin50sin30sin1

2

1

0sin20sin50sin30sin14

2

0

432

422

412

402

0

b

b

2

12030

2

1sin2sin5sin30sin1

2

1

1sin21sin51sin31sin14

2

23

21

432

422

412

402

1

b

b

000002

13sin22sin5sin30sin1

2

1

2sin22sin52sin32sin14

2

2

432

422

412

402

2

b

b

The interpolating polynomial is:

)sin(2

1)2cos(

4

9)cos(3

4

1)2sin()sin()2cos()cos()( 21212

20 ttttbtbttatf aa

Page 6: Fourier Interpolation. The Fourier Method of Interpolation is a way a interpolating data that uses combinations of sin( px ) and cos( px ) where p is.

Substituting the angle values:2

3,,

2,0

14

93

4

10sin

2

10cos

4

90cos3

4

10 f

34

12

2

1

4

9

4

1sin2

1cos4

9cos3

4

1222 f

54

93

4

1sin2

12cos

4

9cos3

4

1 f

24

8

2

1

4

9

4

1sin2

13cos

4

9cos3

4

123

23

23 f

Page 7: Fourier Interpolation. The Fourier Method of Interpolation is a way a interpolating data that uses combinations of sin( px ) and cos( px ) where p is.

Algorithm for Fourier Interpolation of data set {x0, x1, x2, …,xn-1}.

If Mod[n,2]==0 then m = n/2else m = (n-1)/2

cossum=0sinsum=0For[j=0, jm, j++,

ajsum = 0bjsum = 0For[k=0, k(n-1), k++,

ajsum = ajsum + xk Cos[j(2k)/n]bjsum = bjsum + xk Sin[j(2k)/n]]

If j==0 then ajsum = ajsum/2If j==m and Mod[n,2]==0 then ajsum=ajsum/2cossum=cossum+ajsum*(2/n)Cos[jt]sinsum=sinsum+bjsum*(2/n)Sin[jt]]

f(t) = cossum + sinsum