Previous Up Next

5.27.27  Trigonometric interpolation : triginterp

triginterp(y,x=a..b) or triginterp(y,a,b,x) returns the trigonometric polynomial that interpolates data given in the list y . It is assumed that the list y contains ordinate components of the points with equidistant abscissa components between a and b such that the first element from y corresponds to a and the last element to b .

For example, y may be a list of experimental measurements of some quantity taken in regular intervals, with the first observation in the moment t=a and the last observation in the moment t=b . The resulting trigonometric polynomial has the period

n (ba)

where n is the number of observations ( n =size(y)). For example, assume that the following data is obtained by measuring the temperature every three hours:

hour of the day036912151821
temperature (deg C)1110172432262319

Furthermore, assume that an estimate of the temperature at 13:45 is required. To obtain a trigonometric interpolation of the data, input :


Output :


Now a temperature at 13:45 hrs can be approximated with the value of tp for x=13.75 . Input :

tp | x=13.75

Output :


If one of the input parameters is inexact, the result will be inexact too. For example, input :


Output :


Previous Up Next