Proper implementation of cubic spline interpolation

Cubic b-spline has been recently descried in a series of papers by Unser, Thévenaz et al., see among others

M. Unser, A. Aldroubi, M. Eden, “Fast B-Spline Transforms for Continuous Image Representation and Interpolation”, IEEE Trans. Pattern Anal. Machine Intell., vol. 13, n. 3, pp. 277-285, Mar. 1991.

M. Unser, “Splines, a Perfect Fit for Signal and Image Processing”, IEEE Signal Proc. Mag., pp. 22- 38, Nov. 1999.

and

P. Thévenaz, T. Blu, M. Unser, “Interpolation Revisited,” IEEE Trans. on Medical Imaging, vol. 19, no. 7, pp. 739-758, July 2000.

Here are some guidelines.

What are splines?

Splines are piecewise polynomials that are smoothly connected together. For a spline of degree n, each segment is a polynomial of degree n. The pieces are connected so that the spline is continuous up to its derivative of degree n-1 at the knots, namely, the joining points of the polynomial pieces.

How can splines be constructed?

The zero-th order spline is the following

enter image description here

All the other splines can be constructed as

enter image description here

where the convolution is taken n-1 times.

Cubic splines

The most popular splines are cubic splines, whose expression is

enter image description here

Spline interpolation problem

Given a function f(x) sampled at the discrete integer points k, the spline interpolation problem is to determine an approximation s(x) to f(x) expressed in the following way

enter image description here

where the ck‘s are interpolation coefficients and s(k) = f(k).

Spline prefiltering

Unfortunately, starting from n=3 on,

enter image description here

so that the ck‘s are not the interpolation coefficients. They can be determined by solving the linear system of equations obtained by forcing s(k) = f(k), namely,

enter image description here

Such an equation can be recast in a convolution form and solved in the transformed z-space as

enter image description here

where

enter image description here

Accordingly,

enter image description here

Proceeding this way is always preferable than affording the solution of a linear system of equations by, for example, LU decomposition.

The solution to the above equation can be determined by noticing that

enter image description here

where

enter image description here

The first fraction is representative of a causal filter, while the second one is representative of an anticausal filter. Both of them are illustrated in the figures below.

Causal filter

enter image description here

Anticausal filter

enter image description here

In the last figure,

enter image description here

The output of the filters can be expressed by the following recursive equations

enter image description here

The above equations can be solved by first determining “initial conditions” for c- and c+. On assuming a periodic, mirrored input sequence fk such that

enter image description here

then it can be shown that the initial condition for c+ can be expressed as

enter image description here

while the initial condition for c+ can be expressed as

enter image description here

Leave a Comment