Linear Interpolation Filter Reference
The interpolation filter interpolates the channels of each pixel linearly. The primary use case is to resample the wavelengths in HSI and spectroscopy data to a newly defined grid.
Category |
|
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 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. It creates a set of line segments that connect the original data points sequentially, and uses the line segments to evaluate the function on specified grid.
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 linear interpolation filter to interpolate the data onto a regular wavelength grid with the following wavelength values:
400, 404, 408, 412, 416
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 outer-most line segments will be extended beyond the range of the original data and used to evaluate the grid points that reside outside of the original range.
This filter performs a similar operation to the Akima Interpolation Filter, but using a much simpler algorithm. The advantage is that performing a linear interpolation is significantly faster, but has the disadvantage of being far more sensitive to any noise in the system.
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 Linear
, 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.