2.8.13 interp1xy

Menu Information

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);

X-Function Execution Options

Please refer to the page for additional option switches when accessing the x-function from script

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.


Generate X Data by xby

Input

int

0
It supplies two options for generating X Data.

Option list:

  • 0=npts: Number of Points
    Specifies the number of interpolated points.
  • 1=inc: Increment
    Specifies the increment when interpolate by Sampling Interval
X Increment inc

Input

double

0
This is available only when Generate X Data by is Increment. Specifies the x increment when interpolate by Sampling Interval
Number of Points npts

Input

int

<auto>
This is available only when Generate X Data by is Number of Points. Specifies the number of interpolated points. If npts is not specified, default <auto> = min( n*5, 1000), where n is the number of input points. i.e. if number of points n is less than 200, npts=5*n, otherwise npts=1000.
X Start xmin

Input

double

<auto>
The minimum X value of interpolated curve
X End 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.

More Information

Please refer to this page in the User Guide for more information:

  • Description
  • Algorithm

Related X-Functions

interp1, interp1q, spline, bspline, interp1trace


Keywords:interpolate, extrapolate