Trigonometric Fitting and Interpolation
Trigonometric Fitting and Interpolation
Trigonometric functions might be the best choice for fitting or interpolating periodic data. If the highest order (period) of the trigonometric function is less than 10, then the least-squares fit to the 10 points is shown. If the order is 10, then the interpolating trigonometric function is plotted. The values of the 10 data points are controlled by the 10 sliders. The checkbox adds a polynomial interpolation to the plot for comparison.
Details
Details
Because of the orthogonality of trigonometric functions, coefficients obtained from the discrete Fourier transform give the proper weights for both least-squares fitting and interpolation. From[1], if is the order of the trigonometric polynomial and is the number of data points, then
m
n
p(t)=[cos(πmt)Re()+Re()]+[cos(2πkt)Re()-sin(2πkt)Im()]
1
n
y
n/2+1
y
1
2
n
m/2-1
∑
k=1
y
k+1
y
k+1
is the least-squares fit of the data if and the interpolating function if . In this equation, is the discrete Fourier transform of the data.
m<n
m=n
y
References
References
[1] T. Sauer, Numerical Analysis, 2nd ed., Boston: Pearson, 2012.
Permanent Citation
Permanent Citation
Bruce Atwood, Rikley Buckingham
"Trigonometric Fitting and Interpolation"
http://demonstrations.wolfram.com/TrigonometricFittingAndInterpolation/
Wolfram Demonstrations Project
Published: June 27, 2017