Safe Haskell | None |
---|

Special interpolations defined in terms of Module operations.

- data T t y
- constant :: T t y
- linear :: C t y => T t y
- cubic :: (C t, C t y) => T t y
- cubicAlt :: (C t, C t y) => T t y
- piecewise :: C t y => Int -> [t -> t] -> T t y
- piecewiseConstant :: C t y => T t y
- piecewiseLinear :: C t y => T t y
- piecewiseCubic :: (C t, C t y) => T t y
- function :: C t y => (Int, Int) -> (t -> t) -> T t y

# Documentation

Consider the signal to be piecewise constant, where the leading value is used for filling the interval [0,1).

cubic :: (C t, C t y) => T t ySource

Consider the signal to be piecewise cubic,
with smooth connections at the nodes.
It uses a cubic curve which has node values
x0 at 0 and x1 at 1 and derivatives
(x1-xm1)*2 and (x2-x0)*2, respectively.
You can see how it works
if you evaluate the expression for t=0 and t=1
as well as the derivative at these points.

cubicAlt :: (C t, C t y) => T t ySource

The interpolators for module operations do not simply compute a straight linear combination of some vectors. Instead they add then scale, then add again, and so on. This is efficient whenever scaling and addition is cheap. In this case they might save multiplications. I can't say much about numeric cancellations, however.

piecewiseConstant :: C t y => T t ySource

piecewiseLinear :: C t y => T t ySource

piecewiseCubic :: (C t, C t y) => T t ySource