Performs one-dimensional interpolation using a selected method based on the lookup table defined by arrays of values of dependent and independent variables.
A Boolean that specifies whether the values of the independent variable are increasing monotonically with the index.
True | Does not sort the independent variable or reorder the dependent variable. |
False | Sorts the independent variable to be in ascending order and reorders the dependent variable accordingly. |
Default: False
Interpolation method.
Name | Value | Description |
---|---|---|
nearest | 0 | Chooses the Y value corresponding to the X value that is nearest to the current xi value. This node sets the interpolated value to the nearest data point. |
linear | 1 | Sets the interpolated values to points along the line segments connecting the X and Y data points. |
spline | 2 | Guarantees that the first and second derivatives of the cubic interpolating polynomials are continuous, even at the data points. |
cubic Hermite | 3 | Guarantees that the first derivative of the cubic interpolating polynomials is continuous and sets the derivative at the endpoints to certain values in order to preserve the original shape and monotonicity of the Y data. |
Lagrange | 4 | Uses the barycentric Lagrange interpolation algorithm. |
Choosing the Interpolation Method
You can refer to the following facts when you choose among the five interpolation methods:
The Nearest Method
The Linear Method
The linear method interpolates yi on the line segment that connects the two points (x_{j}, x_{j + 1}) when xi is located between the two points (x_{j}, x_{j + 1}) in X, as shown in the following graph.
In the previous graph, the following equation is true:
The Spline Method
The spline method refers to the cubic spline method. With this method, the node derives a third-order polynomial for each interval between two adjacent points. The polynomials meet the following conditions:
The following graph illustrates the cubic spline method.
In the previous graph, P_{j}(x) is the third-order polynomial between two adjacent points, (x_{j}, y_{j}) and (x_{j + 1}, y_{j + 1}).
The Cubic Hermite Method
The cubic Hermitian spline method is the piecewise cubic Hermitian interpolation. This method derives a third-order polynomial in Hermitian form for each interval and ensures only the first derivatives of the interpolation polynomials are continuous. Compared to the cubic spline method, the cubic Hermitian method has better local property. In other words, if you change one data point x_{j}, the effect on the interpolation result lies in the range between [x_{j - 1}, x_{j}] and [x_{j}, x_{j + 1}].
The Lagrange Method
The Lagrange method derives a polynomial of order N - 1 that passes all the N points specified in X and Y, where N is the length of X and Y. This method is a reformulation of the Newton polynomial that avoids the computation of divided differences. The following equation defines the Lagrange method:
where
Default: linear
Tabulated values of the dependent variable.
Tabulated values of the independent variable.
The length of X must equal the length of Y.
Locations of the interpolation points.
This input yields interpolated values between every Y element when xi is empty. Interpolation between Y elements is repeated ntimes.The node ignores ntimes if you wire the xi input.
Error conditions that occur before this node runs. The node responds to this input according to standard error behavior.
Default: No error
Array of values of the independent variable at which this node computes the interpolated values of the dependent variable.
Output array of interpolated values that correspond to the independent variable values.
1D array of values of the independent variable at which interpolated values of the dependent variable are computed.
If xi is empty, xi used returns 2^{ntimes} *(N - 1) + 1 points with (2^{ntimes} - 1) points located evenly between each two adjacent elements in X, where N is the length of X. If you wire the xi input, this node ignores ntimes, and xi used is the same as xi.
Where This Node Can Run:
Desktop OS: Windows
FPGA: Not supported