CubicSpline('Expression','X','Y')
Arguments
|
'Expression' |
Auxiliary signal to determine the sampling rate of the result |
|
'X' |
X-coordinates (sampling points) that define the spline |
|
'Y' |
Y-coordinates that define the spline |
Description
As a result, this function returns a cubic spline that is aligned with the sampling points 'X' with the associated values 'Y'. The sampling rate and the weighting points of the result are determined by 'Expression'.
The X-coordinates do not have to be unambiguous and sorted. If there are several value pairs with the same X-coordinate, only the last value pair will be used for calculating the spline. The remaining value pairs are automatically sorted by X-coordinates.
Example
For a series of points, the function delivers a smoothed signal along the calculated spline as a result. The function can be used for interpolating a compensation curve for a signal with few samples:
A curve has only 17 samples over a time of 5000 s (Y-values, red curve). The corresponding X-coordinates – also only 17 values – are depicted as blue curve. The compensation curve as smoothed signal is to receive a significantly higher resolution (more samples). Therefore, the CubicSpline function is transferred a linear function with 5000 samples at an interval of 1 s as 'Expression' parameter.
With a high zoom level, the calculated samples of the compensation curve can be seen (green). The original X-Y coordinates form the knots of the splines (purple).

