scipy.signal.quadratic#
- scipy.signal.quadratic(x)[source]#
quadratic
is deprecated!scipy.signal.quadratic
is deprecated in SciPy 1.11 and will be removed in SciPy 1.13.The exact equivalent (for a float array x) is
>>> from scipy.interpolate import BSpline >>> out = BSpline.basis_element([-1.5, -0.5, 0.5, 1.5])(x) >>> out[(x < -1.5 | (x > 1.5)] = 0.0
A quadratic B-spline.
This is a special case of
bspline
, and equivalent tobspline(x, 2)
.- Parameters:
- xarray_like
a knot vector
- Returns:
- resndarray
Quadratic B-spline basis function values
Examples
We can calculate B-Spline basis function of several orders:
>>> import numpy as np >>> from scipy.signal import bspline, cubic, quadratic >>> bspline(0.0, 1) 1
>>> knots = [-1.0, 0.0, -1.0] >>> bspline(knots, 2) array([0.125, 0.75, 0.125])
>>> np.array_equal(bspline(knots, 2), quadratic(knots)) True
>>> np.array_equal(bspline(knots, 3), cubic(knots)) True