signal.bsplines

Module Contents

Functions

factorial(n)
spline_filter(Iin,lmbda=5.0) Smoothing spline (cubic) filtering of a rank-2 array.
_bspline_piecefunctions(order) Returns the function defined over the left-side pieces for a bspline of
bspline(x,n) B-spline basis function of order n.
gauss_spline(x,n) Gaussian approximation to B-spline basis function of order n.
cubic(x) A cubic B-spline.
quadratic(x) A quadratic B-spline.
_coeff_smooth(lam)
_hc(k,cs,rho,omega)
_hs(k,cs,rho,omega)
_cubic_smooth_coeff(signal,lamb)
_cubic_coeff(signal)
_quadratic_coeff(signal)
cspline1d(signal,lamb=0.0) Compute cubic spline coefficients for rank-1 array.
qspline1d(signal,lamb=0.0) Compute quadratic spline coefficients for rank-1 array.
cspline1d_eval(cj,newx,dx=1.0,x0=0) Evaluate a spline at the new set of points.
qspline1d_eval(cj,newx,dx=1.0,x0=0) Evaluate a quadratic spline at the new set of points.
factorial(n)
spline_filter(Iin, lmbda=5.0)

Smoothing spline (cubic) filtering of a rank-2 array.

Filter an input data set, Iin, using a (cubic) smoothing spline of fall-off lmbda.

_bspline_piecefunctions(order)

Returns the function defined over the left-side pieces for a bspline of a given order.

The 0th piece is the first one less than 0. The last piece is a function identical to 0 (returned as the constant 0). (There are order//2 + 2 total pieces).

Also returns the condition functions that when evaluated return boolean arrays for use with numpy.piecewise.

bspline(x, n)

B-spline basis function of order n.

Uses numpy.piecewise and automatic function-generator.

gauss_spline(x, n)

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

cubic(x)

A cubic B-spline.

This is a special case of bspline, and equivalent to bspline(x, 3).

quadratic(x)

A quadratic B-spline.

This is a special case of bspline, and equivalent to bspline(x, 2).

_coeff_smooth(lam)
_hc(k, cs, rho, omega)
_hs(k, cs, rho, omega)
_cubic_smooth_coeff(signal, lamb)
_cubic_coeff(signal)
_quadratic_coeff(signal)
cspline1d(signal, lamb=0.0)

Compute cubic spline coefficients for rank-1 array.

Find the cubic spline coefficients for a 1-D signal assuming mirror-symmetric boundary conditions. To obtain the signal back from the spline representation mirror-symmetric-convolve these coefficients with a length 3 FIR window [1.0, 4.0, 1.0]/ 6.0 .

signal : ndarray
A rank-1 array representing samples of a signal.
lamb : float, optional
Smoothing coefficient, default is 0.0.
c : ndarray
Cubic spline coefficients.
qspline1d(signal, lamb=0.0)

Compute quadratic spline coefficients for rank-1 array.

Find the quadratic spline coefficients for a 1-D signal assuming mirror-symmetric boundary conditions. To obtain the signal back from the spline representation mirror-symmetric-convolve these coefficients with a length 3 FIR window [1.0, 6.0, 1.0]/ 8.0 .

signal : ndarray
A rank-1 array representing samples of a signal.
lamb : float, optional
Smoothing coefficient (must be zero for now).
c : ndarray
Cubic spline coefficients.
cspline1d_eval(cj, newx, dx=1.0, x0=0)

Evaluate a spline at the new set of points.

dx is the old sample-spacing while x0 was the old origin. In other-words the old-sample points (knot-points) for which the 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.

qspline1d_eval(cj, newx, dx=1.0, x0=0)

Evaluate a quadratic spline at the new set of points.

dx is the old sample-spacing while x0 was the old origin. In other-words the old-sample points (knot-points) for which the 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.