Sponsored Links

Senin, 28 Mei 2018

Sponsored Links

Trig Interpolation 1 - YouTube
src: i.ytimg.com

In mathematics, trigonometric interpolation is interpolation with trigonometric polynomials. Interpolation is the process of finding a function which goes through some given data points. For trigonometric interpolation, this function has to be a trigonometric polynomial, that is, a sum of sines and cosines of given periods. This form is especially suited for interpolation of periodic functions.

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


Video Trigonometric interpolation



Formulation of the interpolation problem

A trigonometric polynomial of degree K has the form

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

p ( x n ) = y n , n = 0 , ... , N - 1. {\displaystyle p(x_{n})=y_{n},\quad n=0,\ldots ,N-1.\,}

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

0 <= x 0 < x 1 < x 2 < ... < x N - 1 < 2 ? . {\displaystyle 0\leq x_{0}<x_{1}<x_{2}<\ldots <x_{N-1}<2\pi .\,}

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


Maps Trigonometric interpolation



Formulation in the complex plane

The problem becomes more natural if we formulate it in the complex plane. We can rewrite the formula for a trigonometric polynomial as p ( x ) = ? k = - K K c k e i k x , {\displaystyle p(x)=\sum _{k=-K}^{K}c_{k}e^{ikx},\,} where i is the imaginary unit. If we set z = eix, then this becomes

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

with

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

This reduces the problem of trigonometric interpolation to that of polynomial interpolation on the unit 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 , p135 Interpolation using Fourier Polynomials.


Efficacy of Interpolation-Enhanced Schemes in Random Wind Field ...
src: ascelibrary.org


Solution of the problem

Under the above conditions, there exists a solution to the problem for any given set of data points {xk, yk} as long as N, 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 if N>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

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

where

t k ( x ) = e - i K x + i K x k ? m = 0 , m ? k 2 K e i x - e i x m e i x k - e i x m . {\displaystyle t_{k}(x)=e^{-iKx+iKx_{k}}\prod _{m=0,m\neq k}^{2K}{\frac {e^{ix}-e^{ix_{m}}}{e^{ix_{k}}-e^{ix_{m}}}}.}

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

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

Even number of points

If the number of points N is even, say N=2K, applying the Lagrange formula for polynomial interpolation to the polynomial formulation in the complex plane yields that the solution can be written in the form

where

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 times cos ( K x ) {\displaystyle \cos(Kx)} , i.e. the sin ( K x ) {\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 we written in the form

t k ( x ) = cos ( K x - 1 2 ? k + 1 2 ? m = 0 , m ? k 2 K - 1 x m ) + ? m = - ( K - 1 ) K - 1 c k e i m x 2 N sin ( x k - ? k 2 ) ? m = 0 , m ? k 2 K - 1 sin ( x k - x m 2 ) . {\displaystyle t_{k}(x)={\frac {\cos \left(Kx-{\frac {1}{2}}\alpha _{k}+{\frac {1}{2}}\sum \limits _{m=0,m\neq k}^{2K-1}x_{m}\right)+\sum \limits _{m=-(K-1)}^{K-1}c_{k}e^{imx}}{2^{N}\sin({\frac {x_{k}-\alpha _{k}}{2}})\prod \limits _{m=0,m\neq k}^{2K-1}\sin({\frac {x_{k}-x_{m}}{2}})}}.}

This yields

? k = ? m = 0 , m ? k 2 K - 1 x m - 2 ? K {\displaystyle \alpha _{k}=\sum _{m=0,m\neq k}^{2K-1}x_{m}-2\varphi _{K}}

and

t k ( x ) = sin 1 2 ( x - ? k ) sin 1 2 ( x k - ? k ) ? m = 0 , m ? k 2 K - 1 sin 1 2 ( x - x m ) sin 1 2 ( x k - x m ) . {\displaystyle t_{k}(x)={\frac {\sin {\frac {1}{2}}(x-\alpha _{k})}{\sin {\frac {1}{2}}(x_{k}-\alpha _{k})}}\prod _{m=0,m\neq k}^{2K-1}{\frac {\sin {\frac {1}{2}}(x-x_{m})}{\sin {\frac {1}{2}}(x_{k}-x_{m})}}.}

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


finite difference - Interpolation of velocities on staggered grid ...
src: i.stack.imgur.com


Equidistant nodes

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

x m = 2 ? m N , {\displaystyle x_{m}={\frac {2\pi m}{N}},}

see Zygmund for more details.

Odd number of points

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

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

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

D ( x m , N ) = { 0  for  m ? 0 1  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 coefficients t k ( x ) {\displaystyle t_{k}(x)} in (5), it follows that

t k ( x ) = D ( x - x k , N ) = { sin 1 2 N ( x - x k ) N sin 1 2 ( x - x k )  for  x ? x k lim x -> 0 sin 1 2 N x N sin 1 2 x = 1  for  x = x k = s i n c 1 2 N ( x - x k ) s i n c 1 2 ( x - x k ) . {\displaystyle {\begin{aligned}t_{k}(x)&=D(x-x_{k},N)={\begin{cases}{\frac {\sin {\frac {1}{2}}N(x-x_{k})}{N\sin {\frac {1}{2}}(x-x_{k})}}{\text{ for }}x\neq x_{k}\\\lim \limits _{x\to 0}{\frac {\sin {\frac {1}{2}}Nx}{N\sin {\frac {1}{2}}x}}=1{\text{ for }}x=x_{k}\end{cases}}\\&={\frac {\mathrm {sinc} \,{\frac {1}{2}}N(x-x_{k})}{\mathrm {sinc} \,{\frac {1}{2}}(x-x_{k})}}.\end{aligned}}}

Here, the sinc-function prevents any singularities and is defined by

s i n c x = sin x x . {\displaystyle \mathrm {sinc} \,x={\frac {\sin x}{x}}.}

Even number of points

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

D ( x , N ) = 1 N + 1 N cos 1 2 N x + 2 N ? k = 1 1 2 N - 1 cos ( k x ) = sin 1 2 N x N tan 1 2 x . {\displaystyle D(x,N)={\frac {1}{N}}+{\frac {1}{N}}\cos {\frac {1}{2}}Nx+{\frac {2}{N}}\sum _{k=1}^{{\frac {1}{2}}N-1}\cos(kx)={\frac {\sin {\frac {1}{2}}Nx}{N\tan {\frac {1}{2}}x}}.}

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

D ( x m , N ) = { 0  for  m ? 0 1  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 coefficients t k ( x ) {\displaystyle t_{k}(x)} in (6) are given by

t k ( x ) = D ( x - x k , N ) = { sin 1 2 N ( x - x k ) N tan 1 2 ( x - x k )  for  x ? x k lim x -> 0 sin 1 2 N x N tan 1 2 x = 1  for  x = x k . = s i n c 1 2 N ( x - x k ) N s i n c 1 2 ( x - x k ) cos 1 2 ( x - x k ) {\displaystyle {\begin{aligned}t_{k}(x)&=D(x-x_{k},N)={\begin{cases}{\frac {\sin {\frac {1}{2}}N(x-x_{k})}{N\tan {\frac {1}{2}}(x-x_{k})}}{\text{ for }}x\neq x_{k}\\\lim \limits _{x\to 0}{\frac {\sin {\frac {1}{2}}Nx}{N\tan {\frac {1}{2}}x}}=1{\text{ for }}x=x_{k}.\end{cases}}\\&={\frac {\mathrm {sinc} \,{\frac {1}{2}}N(x-x_{k})}{N\mathrm {sinc} \,{\frac {1}{2}}(x-x_{k})}}\cos {\frac {1}{2}}(x-x_{k})\end{aligned}}}

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

Implementation

A MATLAB implementation of the above can be found here and is given by:

Relation with the discrete Fourier transform

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

x n = 2 ? n N , 0 <= n < N . {\displaystyle x_{n}=2\pi {\frac {n}{N}},\qquad 0\leq n<N.}

The transformation that maps the data points yn to the coefficients ak, bk is obtained from the discrete Fourier transform (DFT) of order N.

Y k = ? n = 0 N - 1 y n   e - i 2 ? n k N {\displaystyle Y_{k}=\sum _{n=0}^{N-1}y_{n}\ e^{-i2\pi {\frac {nk}{N}}}\,}
y n = p ( x n ) = 1 N ? k = 0 N - 1 Y k   e i 2 ? n k N {\displaystyle y_{n}=p(x_{n})={\frac {1}{N}}\sum _{k=0}^{N-1}Y_{k}\ e^{i2\pi {\frac {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 the Nyquist frequency.)

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


CMSC 455 illustrations
src: www.csee.umbc.edu


Applications in numerical computing

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 in Chebfun; several examples are available here.


CMSC 455 illustrations
src: www.csee.umbc.edu


References

  • Kendall E. Atkinson, An Introduction to Numerical Analysis (2nd edition), Section 3.8. John Wiley & Sons, New York, 1988. ISBN 0-471-50023-2.
  • M. T. Heideman, D. H. Johnson, and C. S. Burrus, "Gauss and the history of the fast Fourier transform," IEEE ASSP Magazine 1 (4), 14-21 (1984).
  • G.B. Wright, M. Javed, H. Montanelli, and L.N. Trefethen, "Extension of Chebfun to periodic functions," SIAM. J. Sci. Comput., 37 (2015), C554-C573
  • A. Zygmund, Trigonometric Series Volume II, Chapter X, Cambridge University Press, 1988.

CMSC 455 illustrations
src: www.csee.umbc.edu


External links

  • www.chebfun.org

Source of the article : Wikipedia

Comments
0 Comments