The Akima algorithm for
one-dimensional interpolation, described in [1] and [2], performs cubic
interpolation to produce piecewise polynomials with continuous first-order derivatives (C1).
The algorithm avoids excessive local undulations.
If is the slope on interval , then the value of the derivative at the sample point is a weighted average of nearby slopes:
In Akima's original formula, the weights are:
The original Akima algorithm gives equal weight to the points on both sides, evenly
dividing an undulation.
When two flat regions with different slopes meet, the modification made to the original
Akima algorithm gives more weight to the side where the slope is closer to zero. This
modification gives priority to the side that is closer to horizontal, which is more
intuitive and avoids overshoot. In particular, whenever there are three or more consecutive
collinear points, the algorithm connects them with a straight line and thus avoids an
overshoot.
The weights used in the modified Akima algorithm are:
Compared to the spline
algorithm, the Akima algorithm produces
fewer undulations and is better suited to deal with quick changes between flat regions.
Compared to the pchip
algorithm, the Akima algorithm is not as
aggressively flattened and is therefore still able to deal with oscillatory data.