Basis functions

class splinebox.basis_functions.BasisFunction(multigenerator, support)
eval(x, derivative=0)

Evaluate the function at position(s) x.

Parameters

xnumpy.array

The points where the function should be evaluated.

derivative[0, 1, 2], default = 0

Whether to evaluate the function (0) or its first (1) or second (2) derivative.

Returns

ynumpy.array

Values of the function or its first or second derivative at position(s) x.

filter_periodic(s)

???

Parameters

s?

?

filter_symmetric(s)

???

Parameters

s?

?

refinement_mask()

???

class splinebox.basis_functions.B1

Basis spline of degree 1.

\[\begin{split}f(x) = \begin{cases}1 - \lvert x \rvert & \text{for } -1 \leq x \leq 1 \\ 0 & \text{otherwise}\end{cases}\end{split}\]

(Source code, png, hires.png, pdf)

_images/plot_b1.png
class splinebox.basis_functions.B2

Basis spline of degree 2.

\[\begin{split}f(x) = \begin{cases}\frac{x^2}{2} + \frac{3}{2} x + \frac{9}{8} & \text{for } -\frac{3}{2} \leq x \leq -\frac{1}{2} \\ -x^2 + \frac{3}{4} & \text{for } -\frac{1}{2} < x \leq \frac{1}{2} \\ \frac{1}{2} x^2 - \frac{3}{2} x + \frac{9}{8} & \text{for } \frac{1}{2} < x \leq \frac{3}{2} \\ 0 & \text{otherwise}\end{cases}\end{split}\]

(Source code, png, hires.png, pdf)

_images/plot_b2.png
class splinebox.basis_functions.B3

Basis spline of degree 3.

\[\begin{split}f(x) = \begin{cases} \frac{2}{3} - \lvert x \rvert^2 + \frac{\lvert x \rvert^3}{2} & \text{for } 0 \leq \lvert x \rvert < 1 \\ \frac{1}{6}(2 - \lvert x \rvert)^3 & \text{for } 1 \leq \lvert x \rvert \leq 2 \\ 0 & \text{otherwise}\end{cases}\end{split}\]

(Source code, png, hires.png, pdf)

_images/plot_b3.png
class splinebox.basis_functions.Exponential(M, alpha)

???

\[\begin{split}f(x) = \begin{cases} \frac{L}{\alpha^2} 2 \sin(\frac{\alpha}{2} x) & \text{for } 0 \leq x < 1 \\ \frac{L}{\alpha^2} (\cos(\alpha (x - 2)) + \cos(\alpha (x - 1)) - 2 \cos(\alpha)) & \text{for } 1 \leq x < 2 \\ \frac{L}{\alpha^2} 2 \sin(\frac{\alpha}{2} (x- 3))^2 & \text{for } 2 \leq x \leq 3 \\ 0 & \text{otherwise}\end{cases}\end{split}\]
\[\text{where } L=(\frac{\sin(\pi / M)}{\pi / M})^{-2}\]

(Source code, png, hires.png, pdf)

_images/plot_exponential.png
class splinebox.basis_functions.CatmullRom

???

(Source code, png, hires.png, pdf)

_images/plot_catmullrom.png
class splinebox.basis_functions.CubicHermite

???

(Source code, png, hires.png, pdf)

_images/plot_cubichermite.png
class splinebox.basis_functions.ExponentialHermite(alpha)

???

(Source code, png, hires.png, pdf)

_images/plot_exponentialhermite.png