Skip to content

B Spline

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

The B-spline can have orders from 2 to 5. Outputs are generated for a spline with 201 points for a signal with 41 points - first image is a B-spline of order 4, the second image is of order 5.

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.

b4

Code for Order 4 BSpline
CubicSpline cbs = new B-Spline(4);
cbs.computeFunction(this.x, this.y);
double[] xnew = UtilMethods.linspace(0.0, 10.0, 201, true);
double[] result = cbs.getValue(xnew);

b5

Code for Order 5 B-Spline
CubicSpline cbs = new BSpline(5);
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