Akima Interpolation Filter Reference

The Akima interpolation filter interpolates the channels of each pixel using Akima polynomials. The primary use case is to resample the wavelengths in HSI and spectroscopy data to a newly defined grid.

Category

category_preprocessing Preprocessing

Node

akima_node

Parameters

RangeStart: the lower bound of the target inteprolation range

RangeEnd: the upper bound of the target interpolation range

Increment: the step size of the target interpolation grid

Tolerance: The minimum relative size of the denominator to use when fitting the Akima polynomials to an existing curve. If the denominator is smaller at various points in the curve, the denominator is assumed to be equal to 0 for the purpose of the calculation of the fit coefficients.

ExtrapolationBaseFraction: the fraction of the target range to use as the basis for extrapolation (see below)

DisableExtrapolation: whether to disable extrapolation and force the values to 0 instead (see below)

Inputs

Input: the input data

Outputs

Output: the the output data interpolated onto the new grid specified by the parameters

Effect of the Filter

When data represents a function that is given at specific points (e.g. a HSI cube describes the spectrum of each pixel as a function that has been provided for a certain set of discrete wavelengths) this filter allows for the reevaluation of that function onto a user-defined grid by fitting Akima polynomials onto the original function and then evaluating these at the newly defined grid.

The use of Akima polynomials has the advantage over other types of polynomials (e.g. splines) that high-frequency noise in the original data is suppressed. The algorithm is based on the algorithm published in the paper A Method of Univariate Interpolation that has the Accuracy of a Third–Degree Polynomial by Hiroshi Akima.

For example, if one has data that is provided for the following list of wavelengths:

401.967, 403.959, 405.952, 407.944, 409.937, 411.929, 413.922, 415.915

On could use the Akima filter to inteprolate the data onto a regular wavelength grid with the following wavelength values:

400, 404, 408, 412, 416

If the spacing of the new grid is significantly larger than the spacing of the original wavelengths, the Akima filter will have the additional effect to smooth out the provided data on the scale of the new grid.

In addition to the interpolation logic, sometimes the new grid may contain points that are outside the range of the original data. There is no manner in which data can be recovered, so the filter provides two possibilities:

  • When extrapolation is disabled (i.e. DisableExtrapolation is active) the data beyond the range of the original data will be set to zero.

  • When extrapolation is enabled (i.e. DisableExtrapolation is not active) the data will first be interpolated onto the part of the grid that lies within the original range of the data. For the points left of the range of the original data a polynomial of third degree will be fitted to the left-most points of the newly interpolated data that are still within the original data range, and that polynomial is then evaluated for the points to the left of the range. This is done analogously for any points to the right of the original data range. The amount of points used to fit the third-degree polynomial is given by the ExtrapolationBaseFraction parameter, which specifies this number relative to the total number of points of the new grid that reside within the original range. (A value of 0.1 indicates that the left 10% of all points will be used for the polynomial fit of the extrapolation.)

Extrapolating to points that are very close to the original range may often be quite useful – for example, if a device returns wavelengths that should be roughly in the range from 400nm to 600nm, but the actual wavelengths start at 401.23nm, extrapolating to 400nm will likely work quite well in that case. However, even extrapolating down to 390nm for this example will likely result in curves that start to diverge at that point, in which case it is often a better idea to disable extrapolation.

This filter performs a similar operation to the Linear interpolation filter, but using a more sophisticated algorithm. The advantage is that Akima polynomials provide a much better fit to measurement data, especially if noise is involved, but have the disadvantage that they take longer to compute than a simple linear inteprolation.

Additional Information

When using the source of a graph in hyperspectral camera mode, the data will be interpolated automatically by the software. If the interpolation mode of the source is set to Akima, the same algorithm as this filter will be used. As spectrometers and HSI cameras will underly manufacturing tolerances that will cause slight differences in the wavelengths of the data they return, this logic allows the user to normalize the data so that it is device-independent. This makes models the user creates portable between devices, as the models will all use the same grid.

See also