scipy.signal.gauss_spline#

scipy.signal.gauss_spline(x, n)[source]#

Gaussian approximation to B-spline basis function of order n.

Parameters:
xarray_like

a knot vector

nint

The order of the spline. Must be non-negative, i.e., n >= 0

Returns:
resndarray

B-spline basis function values approximated by a zero-mean Gaussian function.

Notes

The B-spline basis function can be approximated well by a zero-mean Gaussian function with standard-deviation equal to \(\sigma=(n+1)/12\) for large n :

\[\frac{1}{\sqrt {2\pi\sigma^2}}exp(-\frac{x^2}{2\sigma})\]

References

[1]

Bouma H., Vilanova A., Bescos J.O., ter Haar Romeny B.M., Gerritsen F.A. (2007) Fast and Accurate Gaussian Derivatives Based on B-Splines. In: Sgallari F., Murli A., Paragios N. (eds) Scale Space and Variational Methods in Computer Vision. SSVM 2007. Lecture Notes in Computer Science, vol 4485. Springer, Berlin, Heidelberg

Examples

We can calculate B-Spline basis functions approximated by a gaussian distribution:

>>> import numpy as np
>>> from scipy.signal import gauss_spline, bspline
>>> knots = np.array([-1.0, 0.0, -1.0])
>>> gauss_spline(knots, 3)
array([0.15418033, 0.6909883, 0.15418033])  # may vary
>>> bspline(knots, 3)
array([0.16666667, 0.66666667, 0.16666667])  # may vary