# 2.8.13 interp1xy

Analysis: Mathematics: Interpolate/Extrapolate

## Brief Information

Perform interpolation/extrapolation of XY data with multiple methods

## Command Line Usage

 

1. interp1xy iy:=Col(2) method:=spline npts:=50; 

2. interp1xy iy:=Col(2) method:=bspline sf:=0.5; 

3. interp1xy iy:=Col(2) method:=bspline npts:=50 coef:=Col(3); 

## Variables

Display
Name
Variable
Name
I/O
and
Type
Default
Value
Description
Input iy

Input

XYRange

<active>
Specifies the XY range to be interpolated.
Method method

Input

int

0
Interpolation methods

Option list:

• linear:Linear
method:=0, Linear interpolation is a fast method of estimating a data point by constructing a line between two neighboring data points. The resulting point may not be an accurate estimation of the missing data.
• spline:Cubic Spline
method:=1, This method splits the input data into a given number of pieces, and fits each segment with a cubic polynomial. The second derivative of each cubic function is set equal to zero. With these boundary conditions met, an entire function can be constructed in a piece-wise manner.
• bspline:Cubic B-Spline
method:=2, This method also splits the input data into pieces, each segment is fitted with discrete Bezier splines.
• akima:Akima Spline
method:=3, This method is based on a piecewise function composed of a set of polynomials. The akima interpolation is stable to outliers.

You could refer to the algorithm of each interpolation methods.

Number of Points npts

Input

int

100
Specifies the number of interpolated points
X Minimum xmin

Input

double

<auto>
The minimum X value of interpolated curve
X Maximum xmax

Input

double

<auto>
The maximum X value of interpolated curve
Boundary boundary

Input

int

1
Boundary condition only available in cubic spline method

Option list:

• natural:Natural
2nd derivatives are 0 on both end
• notaknot:Not-A-Knot
3rd derivatives are continuous on the second and last-second point
Smoothing Factor sf

Input

double

<auto>
A non-negative parameter that specifies the smoothness of the interpolated curve in Cubic B-Spline interpolation. The factor helps user control the balance between the smoothing and closeness. Larger values will result in smoother curves.
Apparent Interpolation apparent

Input

int

0
It is available only when the interpolation is performed on a graph. It specifies whether to use the apparent values for interpolation if the types of the axes scales have been changed to other types.
Output oy

Output

XYRange

(<autoX>,<new>)
Specifies the output XY data range

See the syntax here.

Coefficients coef

Output

vector

<optional>
Show the coefficients or not, and show them in which column.

## Examples

1. Import Interpolation.dat on \Samples\Mathematics folder.

2. Highlight column B and select Analysis: Mathematics: Interpolation/Extrapolation... from menu to bring up the dialog box.

3. Select the Cubic B-spline interpolation method, and enter 50 in the Number of Points edit box.

4. Click OK to execute. Origin will generate a new Y column with 50 interpolated points.