Movatterモバイル変換


[0]ホーム

URL:


Jump to content
WikipediaThe Free Encyclopedia
Search

Trigonometric interpolation

From Wikipedia, the free encyclopedia
Interpolation with trigonometric polynomials

Inmathematics,trigonometric interpolation isinterpolation withtrigonometric polynomials. Interpolation is the process of finding a function which goes through some givendata points. For trigonometric interpolation, this function has to be a trigonometric polynomial, that is, a sum ofsines and cosines of given periods. This form is especially suited for interpolation ofperiodic functions.

An important special case is when the given data points are equally spaced, in which case the solution is given by thediscrete Fourier transform.

Formulation of the interpolation problem

[edit]

A trigonometric polynomial of degreeK has the form

p(x)=a0+k=1Kakcos(kx)+k=1Kbksin(kx).{\displaystyle p(x)=a_{0}+\sum _{k=1}^{K}a_{k}\cos(kx)+\sum _{k=1}^{K}b_{k}\sin(kx).\,}1

This expression contains 2K + 1 coefficients,a0,a1, …aK,b1, …,bK, and we wish to compute those coefficients so that the function passes throughN points:

p(xn)=yn,n=0,,N1.{\displaystyle p(x_{n})=y_{n},\quad n=0,\ldots ,N-1.\,}

Since the trigonometric polynomial is periodic with period 2π, theN points can be distributed and ordered in one period as

0x0<x1<x2<<xN1<2π.{\displaystyle 0\leq x_{0}<x_{1}<x_{2}<\ldots <x_{N-1}<2\pi .\,}

(Note that we donot in general require these points to be equally spaced.) The interpolation problem is now to find coefficients such that the trigonometric polynomialp satisfies the interpolation conditions.

Formulation in the complex plane

[edit]

The problem becomes more natural if we formulate it in thecomplex plane. We can rewrite the formula for a trigonometric polynomial asp(x)=k=KKckeikx,{\displaystyle p(x)=\sum _{k=-K}^{K}c_{k}e^{ikx},\,}wherei is theimaginary unit. If we setz =eix, then this becomes

q(z)=k=KKckzk,{\displaystyle q(z)=\sum _{k=-K}^{K}c_{k}z^{k},\,}

with

q(eix)p(x).{\displaystyle q(e^{ix})\triangleq p(x).\,}

This reduces the problem of trigonometric interpolation to that of polynomial interpolation on theunit circle. Existence and uniqueness for trigonometric interpolation now follows immediately from the corresponding results for polynomial interpolation.

For more information on formulation of trigonometric interpolating polynomials in the complex plane, see p. 156 ofInterpolation using Fourier Polynomials.

Solution of the problem

[edit]

Under the above conditions, there exists a solution to the problem forany given set of data points {xk,yk} as long asN, the number of data points, is not larger than the number of coefficients in the polynomial, i.e.,N ≤ 2K+1 (a solution may or may not exist ifN>2K+1 depending upon the particular set of data points). Moreover, the interpolating polynomial is unique if and only if the number of adjustable coefficients is equal to the number of data points, i.e.,N = 2K + 1. In the remainder of this article, we will assume this condition to hold true.

Odd number of points

[edit]

If the number of pointsN is odd, sayN=2K+1, applying theLagrange formula for polynomial interpolation to the polynomial formulation in the complex plane yields that the solution can be written in the form

p(x)=k=02Kyktk(x),{\displaystyle p(x)=\sum _{k=0}^{2K}y_{k}\,t_{k}(x),}5

where

tk(x)=eiKx+iKxkm=0mk2Keixeixmeixkeixm.{\displaystyle t_{k}(x)=e^{-iKx+iKx_{k}}\prod _{\begin{aligned}m&=0\\[-4mu]m&\neq k\end{aligned}}^{2K}{\frac {e^{ix}-e^{ix_{m}}}{e^{ix_{k}}-e^{ix_{m}}}}.}

The factoreiKx+iKxk{\displaystyle e^{-iKx+iKx_{k}}} in this formula compensates for the fact that the complex plane formulation contains also negative powers ofeix{\displaystyle e^{ix}} and is therefore not a polynomial expression ineix{\displaystyle e^{ix}}. The correctness of this expression can easily be verified by observing thattk(xk)=1{\displaystyle t_{k}(x_{k})=1} and thattk(x){\displaystyle t_{k}(x)} is a linear combination of the right powers ofeix{\displaystyle e^{ix}}.Upon using the identity

eiz1eiz2=2isin12(z1z2)e(z1+z2)i/2,{\displaystyle e^{iz_{1}}-e^{iz_{2}}=2i\sin {\tfrac {1}{2}}(z_{1}-z_{2})\,e^{(z_{1}+z_{2})i/2},}2

the coefficienttk(x){\displaystyle t_{k}(x)} can be written in the form

tk(x)=m=0mk2Ksin12(xxm)sin12(xkxm).{\displaystyle t_{k}(x)=\prod _{\begin{aligned}m&=0\\[-4mu]m&\neq k\end{aligned}}^{2K}{\frac {\sin {\tfrac {1}{2}}(x-x_{m})}{\sin {\tfrac {1}{2}}(x_{k}-x_{m})}}.}4

Even number of points

[edit]

If the number of pointsN is even, sayN=2K, applying theLagrange formula for polynomial interpolation to the polynomial formulation in the complex plane yields that the solution can be written in the form

p(x)=k=02K1yktk(x),{\displaystyle p(x)=\sum _{k=0}^{2K-1}y_{k}\,t_{k}(x),}6

where

tk(x)=eiKx+iKxkeixeiαkeixkeiαkm=0mk2K1eixeixmeixkeixm.{\displaystyle t_{k}(x)=e^{-iKx+iKx_{k}}{\frac {e^{ix}-e^{i\alpha _{k}}}{e^{ix_{k}}-e^{i\alpha _{k}}}}\prod _{\begin{aligned}m&=0\\[-4mu]m&\neq k\end{aligned}}^{2K-1}{\frac {e^{ix}-e^{ix_{m}}}{e^{ix_{k}}-e^{ix_{m}}}}.}3

Here, the constantsαk{\displaystyle \alpha _{k}} can be chosen freely. This is caused by the fact that the interpolating function (1) contains an odd number of unknown constants. A common choice is to require that the highest frequency is of the form a constant timescos(Kx){\displaystyle \cos(Kx)}, i.e. thesin(Kx){\displaystyle \sin(Kx)} term vanishes, but in general the phase of the highest frequency can be chosen to beφK{\displaystyle \varphi _{K}}. To get an expression forαk{\displaystyle \alpha _{k}}, we obtain by using (2) that (3) can be written on the form

tk(x)=cos12(2Kxαk+m=0,mk2K1xm)+m=(K1)K1ckeimx2Nsin12(xkαk)m=0,mk2K1sin12(xkxm).{\displaystyle t_{k}(x)={\frac {\cos {\tfrac {1}{2}}{\Biggl (}2Kx-\alpha _{k}+\displaystyle \sum \limits _{m=0,\,m\neq k}^{2K-1}x_{m}{\Biggr )}+\sum \limits _{m=-(K-1)}^{K-1}c_{k}e^{imx}}{2^{N}\sin {\tfrac {1}{2}}(x_{k}-\alpha _{k})\displaystyle \prod \limits _{m=0,\,m\neq k}^{2K-1}\sin {\tfrac {1}{2}}(x_{k}-x_{m})}}.}

This yields

αk=m=0mk2K1xm2φK{\displaystyle \alpha _{k}=\sum _{\begin{aligned}m&=0\\[-4mu]m&\neq k\end{aligned}}^{2K-1}x_{m}-2\varphi _{K}}

and

tk(x)=sin12(xαk)sin12(xkαk)m=0mk2K1sin12(xxm)sin12(xkxm).{\displaystyle t_{k}(x)={\frac {\sin {\tfrac {1}{2}}(x-\alpha _{k})}{\sin {\tfrac {1}{2}}(x_{k}-\alpha _{k})}}\prod _{\begin{aligned}m&=0\\[-4mu]m&\neq k\end{aligned}}^{2K-1}{\frac {\sin {\tfrac {1}{2}}(x-x_{m})}{\sin {\tfrac {1}{2}}(x_{k}-x_{m})}}.}

Note that care must be taken in order to avoid infinities caused by zeros in the denominators.

Equidistant nodes

[edit]

Further simplification of the problem is possible if nodesxm{\displaystyle x_{m}} are equidistant, i.e.

xm=2πmN,{\displaystyle x_{m}={\frac {2\pi m}{N}},}

see Zygmund for more details.

Odd number of points

[edit]

Further simplification by using (4) would be an obvious approach, but is obviously involved. A much simpler approach is to consider theDirichlet kernel

D(x,N)=1N+2Nk=1(N1)/2cos(kx)=sin12NxNsin12x,{\displaystyle D(x,N)={\frac {1}{N}}+{\frac {2}{N}}\sum _{k=1}^{(N-1)/2}\cos(kx)={\frac {\sin {\tfrac {1}{2}}Nx}{N\sin {\tfrac {1}{2}}x}},}

whereN>0{\displaystyle N>0} is odd. It can easily be seen thatD(x,N){\displaystyle D(x,N)} is a linear combination of the right powers ofeix{\displaystyle e^{ix}} and satisfies

D(xm,N)={0 for m01 for m=0.{\displaystyle D(x_{m},N)={\begin{cases}0{\text{ for }}m\neq 0\\1{\text{ for }}m=0\end{cases}}.}

Since these two properties uniquely define the coefficientstk(x){\displaystyle t_{k}(x)} in (5), it follows that

tk(x)=D(xxk,N)={sin12N(xxk)Nsin12(xxk) for xxklimx0sin12NxNsin12x=1 for x=xk=sinc12N(xxk)sinc12(xxk).{\displaystyle {\begin{aligned}t_{k}(x)&=D(x-x_{k},N)={\begin{cases}{\dfrac {\sin {\tfrac {1}{2}}N(x-x_{k})}{N\sin {\tfrac {1}{2}}(x-x_{k})}}{\text{ for }}x\neq x_{k}\\[10mu]\lim \limits _{x\to 0}{\dfrac {\sin {\tfrac {1}{2}}Nx}{N\sin {\tfrac {1}{2}}x}}=1{\text{ for }}x=x_{k}\end{cases}}\\&={\frac {\mathrm {sinc} \,{\tfrac {1}{2}}N(x-x_{k})}{\mathrm {sinc} \,{\tfrac {1}{2}}(x-x_{k})}}.\end{aligned}}}

Here, thesinc-function prevents any singularities and is defined by

sincx=sinxx.{\displaystyle \mathrm {sinc} \,x={\frac {\sin x}{x}}.}

Even number of points

[edit]

ForN{\displaystyle N} even, we define the Dirichlet kernel as

D(x,N)=1N+1Ncos12Nx+2Nk=1(N1)/2cos(kx)=sin12NxNtan12x.{\displaystyle D(x,N)={\frac {1}{N}}+{\frac {1}{N}}\cos {\tfrac {1}{2}}Nx+{\frac {2}{N}}\sum _{k=1}^{(N-1)/2}\cos(kx)={\frac {\sin {\tfrac {1}{2}}Nx}{N\tan {\tfrac {1}{2}}x}}.}

Again, it can easily be seen thatD(x,N){\displaystyle D(x,N)} is a linear combination of the right powers ofeix{\displaystyle e^{ix}}, does not contain the termsin12Nx{\displaystyle \sin {\tfrac {1}{2}}Nx} and satisfies

D(xm,N)={0 for m01 for m=0.{\displaystyle D(x_{m},N)={\begin{cases}0{\text{ for }}m\neq 0\\1{\text{ for }}m=0\end{cases}}.}

Using these properties, it follows that the coefficientstk(x){\displaystyle t_{k}(x)} in (6) are given by

tk(x)=D(xxk,N)={sin12N(xxk)Ntan12(xxk) for xxklimx0sin12NxNtan12x=1 for x=xk.=sinc12N(xxk)sinc12(xxk)cos12(xxk){\displaystyle {\begin{aligned}t_{k}(x)&=D(x-x_{k},N)={\begin{cases}{\dfrac {\sin {\tfrac {1}{2}}N(x-x_{k})}{N\tan {\tfrac {1}{2}}(x-x_{k})}}{\text{ for }}x\neq x_{k}\\[10mu]\lim \limits _{x\to 0}{\dfrac {\sin {\tfrac {1}{2}}Nx}{N\tan {\tfrac {1}{2}}x}}=1{\text{ for }}x=x_{k}.\end{cases}}\\&={\frac {\mathrm {sinc} \,{\tfrac {1}{2}}N(x-x_{k})}{\mathrm {sinc} \,{\tfrac {1}{2}}(x-x_{k})}}\cos {\tfrac {1}{2}}(x-x_{k})\end{aligned}}}

Note thattk(x){\displaystyle t_{k}(x)} does not contain thesin12Nx{\displaystyle \sin {\tfrac {1}{2}}Nx} as well. Finally, note that the functionsin12Nx{\displaystyle \sin {\tfrac {1}{2}}Nx} vanishes at all the pointsxm{\displaystyle x_{m}}. Multiples of this term can, therefore, always be added, but it is commonly left out.

Implementation

[edit]

AMATLAB implementation of the above can be foundhere and is given by:

functionP=triginterp(xi,x,y)% TRIGINTERP Trigonometric interpolation.% Input:%   xi  evaluation points for the interpolant (vector)%   x   equispaced interpolation nodes (vector, length N)%   y   interpolation values (vector, length N)% Output:%   P   values of the trigonometric interpolant (vector)N=length(x);% Adjust the spacing of the given independent variable.h=2/N;scale=(x(2)-x(1))/h;x=x/scale;xi=xi/scale;% Evaluate interpolant.P=zeros(size(xi));fork=1:NP=P+y(k)*trigcardinal(xi-x(k),N);endfunctiontau=trigcardinal(x,N)ws=warning('off','MATLAB:divideByZero');% Form is different for even and odd N.ifrem(N,2)==1% oddtau=sin(N*pi*x/2)./(N*sin(pi*x/2));else% eventau=sin(N*pi*x/2)./(N*tan(pi*x/2));endwarning(ws)tau(x==0)=1;% fix value at x=0

Relation with the discrete Fourier transform

[edit]

The special case in which the pointsxn are equally spaced is especially important. In this case, we have

xn=2πnN,0n<N.{\displaystyle x_{n}=2\pi {\frac {n}{N}},\qquad 0\leq n<N.}

The transformation that maps the data pointsyn to the coefficientsak,bk is obtained from thediscrete Fourier transform (DFT) of order N.

Yk=n=0N1yn ei2πnk/N{\displaystyle Y_{k}=\sum _{n=0}^{N-1}y_{n}\ e^{-i2\pi nk/N}\,}
yn=p(xn)=1Nk=0N1Yk ei2πnk/N{\displaystyle y_{n}=p(x_{n})={\frac {1}{N}}\sum _{k=0}^{N-1}Y_{k}\ e^{i2\pi nk/N}\,}

(Because of the way the problem was formulated above, we have restricted ourselves to odd numbers of points. This is not strictly necessary; for even numbers of points, one includes another cosine term corresponding to theNyquist frequency.)

The case of the cosine-only interpolation for equally spaced points, corresponding to a trigonometric interpolation when the points haveeven symmetry, was treated byAlexis Clairaut in 1754. In this case the solution is equivalent to adiscrete cosine transform. The sine-only expansion for equally spaced points, corresponding to odd symmetry, was solved byJoseph Louis Lagrange in 1762, for which the solution is adiscrete sine transform. The full cosine and sine interpolating polynomial, which gives rise to the DFT, was solved byCarl Friedrich Gauss in unpublished work around 1805, at which point he also derived afast Fourier transform algorithm to evaluate it rapidly. Clairaut, Lagrange, and Gauss were all concerned with studying the problem of inferring theorbit ofplanets,asteroids, etc., from a finite set of observation points; since the orbits are periodic, a trigonometric interpolation was a natural choice. See also Heidemanet al. (1984).

Applications in numerical computing

[edit]

Chebfun, a fully integrated software system written in MATLAB for computing with functions, uses trigonometric interpolation and Fourier expansions for computing with periodic functions. Many algorithms related to trigonometric interpolation are readily available inChebfun; several examples are availablehere.

References

[edit]

External links

[edit]
Retrieved from "https://en.wikipedia.org/w/index.php?title=Trigonometric_interpolation&oldid=1304478376"
Categories:
Hidden categories:

[8]ページ先頭

©2009-2026 Movatter.jp