matlabinterpolationquadratic-programmingbsplinebasis

What is the meaning of evaluating a spline's basis function?


I'm trying to understand the workflow for implementing the bspline basis function.

tauf    Vd
0        0
0.048   502.8944826
0.072   743.5034753
0.096   791.2514106
0.12    825.3244319
0.144   858.1731717
0.168   889.1381766
0.192   922.4214306
0.216   952.9989296
0.24    982.8650001

Result of basisValueMat_f:

1.000   0.000   0.000   0.000   0.000   0.000
0.000   0.076   0.551   0.364   0.009   0.000
0.000   0.013   0.393   0.533   0.062   0.000
0.000   0.000   0.234   0.596   0.170   0.000
0.000   0.000   0.121   0.547   0.331   0.001
0.000   0.000   0.057   0.420   0.496   0.027
0.000   0.000   0.023   0.273   0.591   0.114
0.000   0.000   0.007   0.140   0.570   0.283
0.000   0.000   0.001   0.044   0.408   0.547
0.000   0.000   0.000   0.001   0.085   0.914
0.000   0.000   0.000   0.000   0.000   1.000

Graphical representation:

Chart

Code:

norder = 4;    % degree - 1
nbreaks = 2;
nbasis = nbreaks + norder - 2;
breaks = linspace(0,taufmax,nbreaks)';
wtaubasis = create_bspline_basis([0,max(breaks)], nbasis, norder, breaks);
basisValueMat_f = full(eval_basis(wtaubasis, tauf)); 

Please help me understand what do the create_bspline_basis and the eval_basis functions do. I need to have a mathematical interpretation of this information.


Solution

  • Basis functions are like "building blocks" for approximating functions in an interval. As you can see from your plot, several basis functions are used to approximate your source function. The more complex the original function, the more basis functions would be needed to approximate it with some given error. Take a look at this animation explaining the Fourier series of a square wave:

    enter image description here

    The Fourier transform (FT; shown in the animation above as the blue S(f)) shows the same sort of information as a "slice" of your chart:

    enter image description here

    The difference is that in Wikipedia's FT example, the magnitudes of the basis functions (which sines and/or cosines) are constant throughout the entire interval, but in your spline interpolation example, the magnitudes of the basis functions (which are polynomials) change smoothly throughout the interval.

    Finally, to answer your question, evaluating the basis functions can tell you which is the most dominant basis function at a given point (or interval). One use I can think of for this is - if some function is far more dominant than the others (as is the case in point "1" in your chart), the "unimportant" functions could be neglected entirely while keeping the overall interpolation fairly accurate - which might have some computational benefits.