cubic spline interpolation
Suppose we are given data points suchthat
(1) |
Then the function is called a cubic spline interpolation ifthere exists cubic polynomials with coefficients such that the following hold.
- 1.
- 2.
- 3.
- 4.
- 5.
The set of points are called the knots. The set ofcubic splines on a fixed set of knots, forms a vector space forcubic spline addition and scalar multiplication.
So we see that the cubic spline not only interpolates the data but matches the first and second derivativesat the knots. Notice, from the above definition, one is free tospecify constraints on the endpoints. One common end pointconstraint is ,which is called the natural spline. Other popular choices are theclamped cubic spline, parabolically terminated spline andcurvature-adjusted spline. Cubic splines are frequently used innumerical analysis to fit data. Matlab uses the command spline tofind cubic spline interpolations with not-a-knot end pointconditions. For example, the following commands would find thecubic spline interpolation of the curve and plot thecurve and the interpolation marked with o’s.
x = 0:2*pi;y = 4*cos(x)+1; xx = 0:.001:2*pi;yy = spline(x,y,xx);plot(x,y,'o',xx,yy)