qspline1d_eval(cj, newx, dx=1.0, x0=0)
dx
is the old sample-spacing while :None:None:`x0`
was the old origin. In other-words the old-sample points (knot-points) for which the :None:None:`cj`
represent spline coefficients were at equally-spaced points of:
oldx = x0 + j*dx j=0...N-1, with N=len(cj)
Edges are handled using mirror-symmetric boundary conditions.
Quadratic spline coefficients
New set of points.
Old sample-spacing, the default value is 1.0.
Old origin, the default value is 0.
Evaluated a quadratic spline points.
Evaluate a quadratic spline at the new set of points.
qspline1d
Compute quadratic spline coefficients for rank-1 array.
We can filter a signal to reduce and smooth out high-frequency noise with a quadratic spline:
>>> import matplotlib.pyplot as pltSee :
... from scipy.signal import qspline1d, qspline1d_eval
... rng = np.random.default_rng()
... sig = np.repeat([0., 1., 0.], 100)
... sig += rng.standard_normal(len(sig))*0.05 # add noise
... time = np.linspace(0, len(sig))
... filtered = qspline1d_eval(qspline1d(sig), time)
... plt.plot(sig, label="signal")
... plt.plot(time, filtered, label="filtered")
... plt.legend()
... plt.show()
The following pages refer to to this document either explicitly or contain code examples using this.
scipy.signal._bsplines.qspline1d
scipy.signal._bsplines.qspline1d_eval
Hover to see nodes names; edges to Self not shown, Caped at 50 nodes.
Using a canvas is more power efficient and can get hundred of nodes ; but does not allow hyperlinks; , arrows or text (beyond on hover)
SVG is more flexible but power hungry; and does not scale well to 50 + nodes.
All aboves nodes referred to, (or are referred from) current nodes; Edges from Self to other have been omitted (or all nodes would be connected to the central node "self" which is not useful). Nodes are colored by the library they belong to, and scaled with the number of references pointing them