Skip to content

Cubic Spline

Sambit Paul edited this page Dec 2, 2023 · 5 revisions

cubic

The cubic spline is a B-spline of order 3. JDSP provides the CubicSpline class as a child class of BSpline. The output for a spline with 201 points for a signal with 41 points is shown in the image.

computeFunction() accepts two arguments - a monotonoically increasing interval (x) and their values (y).

getValue() accepts one argument - a monotonically increasing interval with the same extremes as x but with different samples.

Code
CubicSpline cbs = new CubicSpline();
cbs.computeFunction(this.x, this.y);
double[] xnew = UtilMethods.linspace(0.0, 10.0, 201, true);
double[] result = cbs.getValue(xnew);
Clone this wiki locally