View Full Version : Cubic splines

Glen Niebur
07-24-1995, 11:49 PM
Neil Glossop wrote:

>Jesus Dapena wrote in a recent summary about splines,

>> I would advise you very strongly to stay away from CUBIC splines.
>> Usually (always?) they force the second derivative to be zero at the
>> beginning and end of the data set. When that is not the case in the
>> activity being analyzed (i.e., almost always), the result is very distorted
>> data in the early and late parts of the trial (and even the middle parts can
>> get messed up too).

>I am not sure how much I agree with this statement, and would ask for a
>little feedback from list members. While it is true that cubic splines
>force the second derivitives to be zero, cubics and piecewise cubics are
>often used to interpolate data.

Cubic splines need not force a zero second derivative at the end points of the
curve. This is only the case for "Natural" end conditions. Other end
conditions are possible, such as clamped end conditions where we can
apply a known first derivative.

A more useful end condition is the "Quadratic" end condition which sets
the second derivative at the final point equal to the second derivative
and the next to last point at the 2nd derivative at the first point
equal to the second derivative at the second point. For "reasonably"
high sampling rates, this should be a good approximation.

Another good choice is the "not a knot" end condition. This end condition
will cause the first two segments and the last two segments to interpolate
a single cubic curve.

Finally, for cyclic events, you can specify that the second derivatives
are equal at the first and last points.

In summary, it isn't necessarily cubic splines which are bad, it is the
common "natural" end condition implementation that isn't particularly
appropriate to many problems.

A good reference for spline interpolation is:

Farin, Gerald, 1988, "Curves and Surfaces for Computer Aided Geometric
Design," Academic Press


Glen Niebur |
Mayo Clinic | This space intentionally left blank.
Biomechanics Lab |
gln@hercules.mayo.edu |