Simple Operations on Periodic Splines

How to add a delay, add a constant, multiply by a constant, negate, and mirror a one-dimensional spline.


Purpose

Let \(f:{\mathbb{R}}\rightarrow{\mathbb{R}},x\mapsto f(x)\) represent some polynomial periodic spline. It is a parametric real function that is characterized not only by spline coefficients that allow one to fit data, but also by overall parameters that encode its integer period, its integer degree, and its delay. What we want to do is to build another spline \(g\) as a transformed version of \(f.\) Here, we shall consider only trivial transformations.

Additional Delay

The delay of \(f\) can be manipulated so that \(g\) is a translated version of \(f,\) with \(g:{\mathbb{R}}\rightarrow{\mathbb{R}},x\mapsto g(x)=f(x+\lambda).\) There, \(\lambda\in{\mathbb{R}}\) is the additional delay. The instance function delayed_by can be used for that purpose.

Addition of a Constant

The spline coefficients of \(f\) can be manipulated so that \(g\) is a value-offset version of \(f,\) with \(g:{\mathbb{R}}\rightarrow{\mathbb{R}},x\mapsto g(x)=\lambda+f(x).\) There, \(\lambda\in{\mathbb{R}}\) is the constant value offset. The instance function plus can be used for that purpose.

Multiplication by a Constant

The spline coefficients of \(f\) can be manipulated so that \(g\) is a value-scaled version of \(f,\) with \(g:{\mathbb{R}}\rightarrow{\mathbb{R}},x\mapsto g(x)=\lambda\,f(x).\) There, \(\lambda\in{\mathbb{R}}\) is the constant value-scaling factor. The instance function times can be used for that purpose.

Negation

The need may arise to have \(g\) represent \(f\) multiplied by the specific constant \(\lambda=\left(-1\right),\) with \(g:{\mathbb{R}}\rightarrow{\mathbb{R}},x\mapsto g(x)=\left(-f(x)\right).\) The instance function negated can be used for that purpose.

Mirroring

The spline coefficients of \(f,\) along with its delay, can be manipulated so that \(g\) is a mirrored version of \(f,\) with \(g:{\mathbb{R}}\rightarrow{\mathbb{R}},x\mapsto g(x)=f(-x).\) The instance function mirrored can be used for that purpose.

Jupyter Lab notebook

Simple operations