PeriodicSpline (FPScript)

21.09.2021

Interpolates a data set using a periodic spline curve and samples the spline curve at definable points.

Syntax

PeriodicSpline(DataSet, N, SamplingMode)
or
PeriodicSpline(Amplitude, Time, N, SamplingMode)

 

The syntax of the PeriodicSpline function consists of the following parts:

Part

Description

DataSet

The data set with a constant sampling interval, which is interpolated. If you specify a data series, then the X component will be generated automatically.

Permitted data structures are data series, data matrix, signal, signal series und signal series with two-dimensional X-component. All numeric data types are permitted.

For complex data types the absolute value is formed.

If the argument is a list, then the function is executed for each element of the list and the result is also a list.

Amplitude

The Y component of the signal to be interpolated. If you specify a signal, then its Y component is used.

Permitted data structures are data series, data matrix, signal, signal series und signal series with two-dimensional X-component. All numeric data types are permitted.

For complex data types the absolute value is formed.

If the argument is a list, then the first element in the list is taken. If this is also a list, then the process is repeated.

Time

The X component of the signal to be interpolated. If you specify a signal, then its Y component is used.

Permitted data structures are data series, data matrix, signal, signal series und signal series with two-dimensional X-component. All numeric data types are permitted.

For complex data types the absolute value is formed.

If the argument is a list, then the first element in the list is taken. If this is also a list, then the process is repeated.

N

Specifies the total number of points or per X interval of the signal.

Permitted data structures are scalar value. All integral data types are permitted.

The value must be greater or equal to 0.

If the argument is a list, then the first element in the list is taken. If this is also a list, then the process is repeated.

SamplingMode

Specifies how the calculated spline curve is to be sampled and which boundary conditions are used.

The argument SamplingMode can have the following values:

Constant

Meaning

SPLINE_EQUIDISTANT

N values equidistantly sampled.

SPLINE_INTERVAL

N values per original X interval. The number of values of the result is (NumberOfRows(DataSet) - 1) * N + 1.

...plus a constant, which determines the boundary conditions.

Constant

Meaning

+ SPLINE_PERIODICAPPEND

The signal to be interpolated must be periodic, i.e. the last value in the Y component must be equal to the first value. If this is not the case, FlexPro forces periodicity using one of two methods:

If you add this constant, then, if there is no periodicity, the first value is appended to the end of DataSet. The X value of the original last point plus the difference between the last and next to last X value is used as the X value for this extra point.

If the argument is a list, then the first element in the list is taken. If this is also a list, then the process is repeated.

Remarks

The result always has the data type 64-bit floating point.

The result has the same unit as the argument DataSet.

A spline curve consists of cubic polynomials that are appended to one another to provide as smooth a course as possible. For the periodic spline curve, the boundary conditions are set so that the spline curve matches on the left and right in gradient and curvature.

The Y component of the data set to be interpolated must contain at least four values, and the X component must be strictly increasing. If the latter is not the case (e.g., with a locus curve), then you should use the ParametricSpline function. The X values, however, do not have to be equidistant. Before the spline interpolation, void values in the Y component are eliminated by linear interpolation.

The following illustration shows the difference between a periodic and a natural spline curve:

Available in

FlexPro Basic, Professional, Developer Suite

Examples

PeriodicSpline({0, 1, 0, 0, 1}, 20, SPLINE_EQUIDISTANT)

Results in an equidistantly sampled spline curve with 20 values.

PeriodicSpline({0, 1, 0, 0, 1}, 20, SPLINE_INTERVAL)

Results in a spline curve with 81 values.

PeriodicSpline({0, 1, 0, 0, 1}, 20, SPLINE_EQUIDISTANT+SPLINE_PERIODICAPPEND)

Results in an equidistantly sampled periodic spline curve with 20 values.

The following illustration shows the periodic spline curves for the three examples:

See Also

BicubicSpline Function

CompensatingSpline Function

CompensatingSpline2D Function

ParametricSpline Function

Spline Function

Spline2D Function

Spline Interpolation Analysis Object

Surface Interpolation Analysis Object

References

[1] "Carl de Boor": "A Practical Guide to Splines, Revised Edition". "Springer-Verlag, New York",2001.ISBN 0-387-95366-3.

Share article or send as email:

You might be interested in these articles