The triginterp command computes a trigonometric polynomial which interpolates given data.
Example.
For example, y may be a list of experimental measurements
of some quantity taken in regular intervals, with the first
observation at time t=a and the last observation at time
t=b. The resulting trigonometric polynomial has period
T= |
| , |
where n is the number of observations (n=size(y)). As a specific example, assume that the following data is obtained by measuring the temperature every three hours:
hour of the day | 0 | 3 | 6 | 9 | 12 | 15 | 18 | 21 |
temperature (∘C) | 11 | 10 | 17 | 24 | 32 | 26 | 23 | 19 |
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:
Output:
29.4863181684 |
If one of the input parameters is inexact, the result will be inexact
too. For example:
Input:
Digits:=3:; |
triginterp([11,10,17,24,32,26,23,19],x=0..21.0) |
Output:
|