Splines, B-Splines, and Polynomials
How to build a monomial out of B-splines; which polynomial results from the sum of monomial-weighted integer-shifted B-splines; and convolution of a monomial with a B-spline.
Splines
The splinekit library focuses on uniform polynomial splines of nonnegative integer degree. These splines are real functions that map the domain \({\mathbb{R}}\) onto the image \({\mathbb{R}}.\)
Piecewise Polynomials What makes this particular mapping remarkable is that there exists some partition of the domain into intervals, each interval being such that, there, the piece of spline is a polynomial of a degree that never exceeds the degree of the spline—possibly, a different polynomial over each interval.
Smoothness Moreover, for the mapping to be called a spline, the polynomial pieces must match in the following sense: Consider three adjacent unit intervals of the partition of \({\mathbb{R}}\), namely, a central interval with another interval to the left and another one to the right. Now, remember that an independent polyomial is associated to each of the three intervals. With splines, at the boundary between the left interval and the central one, the respective polynomials must take the same value and the same value of their derivatives of all orders except, possibly, the derivative of the order equal to the degree of the spline. The same goes at the central-right boundary.
Uniform For uniform splines, each interval is assumed to have a unit diameter.
Splines of degree \(n\) are \(\left(n-1\right)\) times continuously differentiable and \(n\) times differentiable. They are the smoothest piecewise-polynomial functions one can get. It turns out that uniform splines always admit a convenient representation through an expression that involves synthesis functions; in the most practical form, uniform splines are written as
where \(c\) are the so-called spline coefficients and where the B-spline \(\beta^{n}\) is the synthesis function of the degree \(n,\) this degree being typeset as a superscript (not a power). The distinction between a B-spline (with a capital B) and a spline is that the first one is a nonparametric synthesis function, the second one being parameterized by \(c\) and the global delay \(\delta x.\) To simplify the current discussion, we assume henceforth that this delay is \(\delta x=0.\)
In this description, there is nothing to prevent one to call a spline any true (non-piecewise) polynomial. We are going now to establish relations between polynomials and spline coefficients.
Polynomials
Polynomial of Degree \(\left(-1\right)\)
The real function that maps every real number to zero is the polynomial \(\pi_{-1}:{\mathbb{R}}\rightarrow{\mathbb{R}},x\mapsto\pi_{-1}(x)=0.\) By convention, the polynomial \(\pi_{-1}\) is said to be of degree \(\left(-1\right).\) Trivially, it is also a spline since one can build it by letting \(c[k]=0\) for all \(k\in{\mathbb{Z}}.\) This is true for any spline degree; in what follows, we silently disregard this particular case and consider only polynomials (and monomials) of nonnegative degree.
Polynomials of Degree \(0\) and Partition of Unity
A polynomial of degree \(0\) is a real function \(\pi_{0}:{\mathbb{R}}\rightarrow{\mathbb{R}}\setminus\{0\},x\mapsto\pi_{0}(x)=a_{0}\) that maps every real number to the nonzero constant \(a_{0}.\) If we want to build a spline that does the same, we need to find spline coefficients \(c_{0}\) such that, for any argument \(x\in{\mathbb{R}},\) it holds that
Fortunately, B-splines of any degree \(n\) satisfy the partition-of-unity condition according to which
It is then enough to identify \(c_{0}[k]=a_{0}\) for all \(k\in{\mathbb{Z}}\) to ascertain that a polynomial of degree \(0\) can indeed be represented by a spline.
Partition of Monomials
The generic polynomial \(\pi_{n}:{\mathbb{R}}\rightarrow{\mathbb{R}},x\mapsto\pi_{n}(x)=a_{0}+\sum_{m=1}^{n}\,a_{m}\,x^{m}\) is a weighted linear sum of a constant term \(1\) and of canonic monomials \(x^{m},\) with respective weights \(a_{0}\) and \(a_{m}.\) If we want to discover the spline coefficients \(c\) needed to represent \(\pi_{n}\) as a spline, all we need to know is which are the spline coefficients \(c_{m}^{n}\) that will represent the monomial of degree \(m\) as the spline \(\sum_{k\in{\mathbb{Z}}}\,c_{m}^{n}[k]\,\beta^{n}(x-k)\) for \(x\in{\mathbb{R}},\) assuming that \(0<m\leq n.\) Then, the finite-support property of B-splines will alleviate concerns about the convergence of the sums involved and will allow us to write that
The identification \(c[k]=a_{0}+\sum_{m=1}^{n}\,a_{m}\,c_{m}^{n}[k]\) for \(k\in{\mathbb{Z}}\) will finally result in the desired representation \(\pi_{n}(x)=\sum_{k\in{\mathbb{Z}}}\,c[k]\,\beta^{n}(x-k)\) for \(x\in{\mathbb{R}}.\)
It turns out that the monomial-reproducing \(c_{m}^{n}[k]\) can itself be expressed as a polynomial in \(k.\) We give now a piece of code that returns the list of polynomials in \(k\) that one must use to weigh B-splines of degree \(n\) to build the monomial \(x^{m}\) of nonnegative degree \(m\leq n\), as in
Jupyter Lab notebook
Spline Coefficients Made of Discrete Monomials
As has been revealed just above, those spline coefficients that let a spline build a monomial have an expression that can be nontrivial. We now ask the converse question: What is the function reconstructed by a spline built with (trivial) monomial coefficients? The answer is a nontrivial polynomial of a degree equal to that of the monomial coefficients. Formally, we have that
for a weighting monomial of degree \(0,\) and
for \(m\in[1\ldots n],\) where \(\pi_{m}^{n}(x)\) is some polynomial in the free variable \(x.\) We give now a piece of code that returns the polynomial \(\pi_{m}^{n}\) for the spline degree \(n\) and the nonnegative monomial degrees \(m\leq n.\)
Jupyter Lab notebook
Monomial Convolved with a B-Spline
The convolution bewteen, on one hand, a monomial \(\left(\cdot\right)^{m}\) of nonnegative integer degree \(m\) and, on the other hand, a B-spline \(\beta^{n}\) of nonnegative integer degree \(n,\) turns out to be the polynomial \(\varpi_{n}^{m}\) of degree \(m\) defined by
We give now a piece of code that returns the polynomial \(\varpi_{m}^{n}.\)
Jupyter Lab notebook