fbpx
Wikipedia

Trigonometric interpolation

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.

Formulation of the interpolation problem edit

A trigonometric polynomial of degree K has the form

 

(1)

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:

 

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

 

(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.

Formulation in the complex plane edit

The problem becomes more natural if we formulate it in the complex plane. We can rewrite the formula for a trigonometric polynomial as   where i is the imaginary unit. If we set z = eix, then this becomes

 

with

 

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 p. 156 of Interpolation using Fourier Polynomials.

Solution of the problem edit

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 edit

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

 

(5)

where

 

The factor   in this formula compensates for the fact that the complex plane formulation contains also negative powers of   and is therefore not a polynomial expression in  . The correctness of this expression can easily be verified by observing that   and that   is a linear combination of the right powers of  . Upon using the identity

 

(2)

the coefficient   can be written in the form

 

(4)

Even number of points edit

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

 

(6)

where

 

(3)

Here, the constants   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  , i.e. the   term vanishes, but in general the phase of the highest frequency can be chosen to be  . To get an expression for  , we obtain by using (2) that (3) can be written on the form

 

This yields

 

and

 

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 nodes   are equidistant, i.e.

 

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 the Dirichlet kernel

 

where   is odd. It can easily be seen that   is a linear combination of the right powers of   and satisfies

 

Since these two properties uniquely define the coefficients   in (5), it follows that

 

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

 

Even number of points edit

For   even, we define the Dirichlet kernel as

 

Again, it can easily be seen that   is a linear combination of the right powers of  , does not contain the term   and satisfies

 

Using these properties, it follows that the coefficients   in (6) are given by

 

Note that   does not contain the   as well. Finally, note that the function   vanishes at all the points  . Multiples of this term can, therefore, always be added, but it is commonly left out.

Implementation edit

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

function P = 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)); for k = 1:N  P = P + y(k)*trigcardinal(xi-x(k),N); end function tau = trigcardinal(x,N) ws = warning('off','MATLAB:divideByZero'); % Form is different for even and odd N. if rem(N,2)==1 % odd  tau = sin(N*pi*x/2) ./ (N*sin(pi*x/2)); else  % even  tau = sin(N*pi*x/2) ./ (N*tan(pi*x/2)); end warning(ws) tau(x==0) = 1; % fix value at x=0 

Relation with the discrete Fourier transform edit

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

 

The transformation that maps the data points yn to the coefficients ak, bk is obtained from the discrete Fourier transform (DFT) of order 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).

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

References edit

  • 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, "," 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.

External links edit

  • www.chebfun.org

trigonometric, interpolation, mathematics, trigonometric, interpolation, interpolation, with, trigonometric, polynomials, interpolation, process, finding, function, which, goes, through, some, given, data, points, trigonometric, interpolation, this, function, . 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 Contents 1 Formulation of the interpolation problem 2 Formulation in the complex plane 3 Solution of the problem 3 1 Odd number of points 3 2 Even number of points 4 Equidistant nodes 4 1 Odd number of points 4 2 Even number of points 4 3 Implementation 4 4 Relation with the discrete Fourier transform 5 Applications in numerical computing 6 References 7 External linksFormulation of the interpolation problem editA trigonometric polynomial of degree K has the form p x a 0 k 1 K a k cos k x k 1 K b k sin k x displaystyle p x a 0 sum k 1 K a k cos kx sum k 1 K b k sin kx nbsp 1 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 nbsp Since the trigonometric polynomial is periodic with period 2p the N points can be distributed and ordered in one period as 0 x 0 lt x 1 lt x 2 lt lt x N 1 lt 2 p displaystyle 0 leq x 0 lt x 1 lt x 2 lt ldots lt x N 1 lt 2 pi nbsp 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 Formulation in the complex plane editThe 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 nbsp 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 nbsp with q e i x p x displaystyle q e ix triangleq p x nbsp 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 p 156 of Interpolation using Fourier Polynomials Solution of the problem editUnder 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 gt 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 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 p x k 0 2 K y k t k x displaystyle p x sum k 0 2K y k t k x nbsp 5 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 begin aligned m amp 0 4mu m amp neq k end aligned 2K frac e ix e ix m e ix k e ix m nbsp The factor e i K x i K x k displaystyle e iKx iKx k nbsp in this formula compensates for the fact that the complex plane formulation contains also negative powers of e i x displaystyle e ix nbsp and is therefore not a polynomial expression in e i x displaystyle e ix nbsp The correctness of this expression can easily be verified by observing that t k x k 1 displaystyle t k x k 1 nbsp and that t k x displaystyle t k x nbsp is a linear combination of the right powers of e i x displaystyle e ix nbsp Upon using the identity e i z 1 e i z 2 2 i sin 1 2 z 1 z 2 e z 1 z 2 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 nbsp 2 the coefficient t k x displaystyle t k x nbsp can be written in the form t k x m 0 m k 2 K sin 1 2 x x m sin 1 2 x k x m displaystyle t k x prod begin aligned m amp 0 4mu m amp neq k end aligned 2K frac sin tfrac 1 2 x x m sin tfrac 1 2 x k x m nbsp 4 Even number of points edit 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 p x k 0 2 K 1 y k t k x displaystyle p x sum k 0 2K 1 y k t k x nbsp 6 where t k x e i K x i K x k e i x e i a k e i x k e i a k m 0 m k 2 K 1 e i x e i x m e i x k e i x m 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 amp 0 4mu m amp neq k end aligned 2K 1 frac e ix e ix m e ix k e ix m nbsp 3 Here the constants a k displaystyle alpha k nbsp 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 nbsp i e the sin K x displaystyle sin Kx nbsp term vanishes but in general the phase of the highest frequency can be chosen to be f K displaystyle varphi K nbsp To get an expression for a k displaystyle alpha k nbsp we obtain by using 2 that 3 can be written on the form t k x cos 1 2 2 K x a k m 0 m k 2 K 1 x m m K 1 K 1 c k e i m x 2 N sin 1 2 x k a k m 0 m k 2 K 1 sin 1 2 x k x m 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 nbsp This yields a k m 0 m k 2 K 1 x m 2 f K displaystyle alpha k sum begin aligned m amp 0 4mu m amp neq k end aligned 2K 1 x m 2 varphi K nbsp and t k x sin 1 2 x a k sin 1 2 x k a 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 tfrac 1 2 x alpha k sin tfrac 1 2 x k alpha k prod begin aligned m amp 0 4mu m amp neq k end aligned 2K 1 frac sin tfrac 1 2 x x m sin tfrac 1 2 x k x m nbsp Note that care must be taken in order to avoid infinities caused by zeros in the denominators Equidistant nodes editFurther simplification of the problem is possible if nodes x m displaystyle x m nbsp are equidistant i e x m 2 p m N displaystyle x m frac 2 pi m N nbsp 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 the Dirichlet kernel D x N 1 N 2 N k 1 N 1 2 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 N 1 2 cos kx frac sin tfrac 1 2 Nx N sin tfrac 1 2 x nbsp where N gt 0 displaystyle N gt 0 nbsp is odd It can easily be seen that D x N displaystyle D x N nbsp is a linear combination of the right powers of e i x displaystyle e ix nbsp 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 nbsp Since these two properties uniquely define the coefficients t k x displaystyle t k x nbsp 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 amp 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 amp frac mathrm sinc tfrac 1 2 N x x k mathrm sinc tfrac 1 2 x x k end aligned nbsp 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 nbsp Even number of points edit For N displaystyle N nbsp even we define the Dirichlet kernel as D x N 1 N 1 N cos 1 2 N x 2 N k 1 N 1 2 cos k x sin 1 2 N x N tan 1 2 x 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 nbsp Again it can easily be seen that D x N displaystyle D x N nbsp is a linear combination of the right powers of e i x displaystyle e ix nbsp does not contain the term sin 1 2 N x displaystyle sin tfrac 1 2 Nx nbsp 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 nbsp Using these properties it follows that the coefficients t k x displaystyle t k x nbsp 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 s i n c 1 2 x x k cos 1 2 x x k displaystyle begin aligned t k x amp 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 amp 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 nbsp Note that t k x displaystyle t k x nbsp does not contain the sin 1 2 N x displaystyle sin tfrac 1 2 Nx nbsp as well Finally note that the function sin 1 2 N x displaystyle sin tfrac 1 2 Nx nbsp vanishes at all the points x m displaystyle x m nbsp Multiples of this term can therefore always be added but it is commonly left out Implementation edit A MATLAB implementation of the above can be found here and is given by function P 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 for k 1 N P P y k trigcardinal xi x k N end function tau trigcardinal x N ws warning off MATLAB divideByZero Form is different for even and odd N if rem N 2 1 odd tau sin N pi x 2 N sin pi x 2 else even tau sin N pi x 2 N tan pi x 2 end warning ws tau x 0 1 fix value at x 0 Relation with the discrete Fourier transform edit The special case in which the points xn are equally spaced is especially important In this case we have x n 2 p n N 0 n lt N displaystyle x n 2 pi frac n N qquad 0 leq n lt N nbsp 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 p n k N displaystyle Y k sum n 0 N 1 y n e i2 pi nk N nbsp y n p x n 1 N k 0 N 1 Y k e i 2 p n k N displaystyle y n p x n frac 1 N sum k 0 N 1 Y k e i2 pi nk N nbsp 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 Applications in numerical computing editChebfun 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 References editKendall E Atkinson An Introduction to Numerical Analysis 2nd edition Section 3 8 John Wiley amp 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 External links editwww chebfun org Retrieved from https en wikipedia org w index php title Trigonometric interpolation amp oldid 1181962889, wikipedia, wiki, book, books, library,

article

, read, download, free, free download, mp3, video, mp4, 3gp, jpg, jpeg, gif, png, picture, music, song, movie, book, game, games.