The module LinearSplines computes linear spline functions of its input. A separate spline function can be given for each element in the input array.

The splines are specified in the parameter points as (x, y) pairs which must be sorted from lower to higher values on x. If different functions should be applied to the different elements, several (x, y) pairs can be listed after each other on each row. Unused parts of the point matrix can be padded with zeros.

When there are more elements in the input than twice the columns in the point data, the index wraps around and starts from the beginning again. For example, if there are four columns in the point parameter, corresponding to two spline functions, and three elements in the input, the first and the last input element will use the first spine function and the second input will use the second spline function.

The image above illustrates the splines for the first exmaple below.

Example XML definition

A simple example

      class = "LinearSplines"
      name = "LinearSplines"
      points = "3 5; 4 20; 7 25; 9 10"

Example with two different splines, the first with four control points and the second with three.

      class = "LinearSplines"
      name = "LinearSplines"
      points = "0 0 0 4; 1 10 5 0; 2 30 10 -1; 4 40 0 0"


classThe class name for the module; must be "LinearSplines".string
nameThe name of this instance of the module.string
points(x, y) pairs for the splines

Module Connections


INPUTInput signal


OUTPUTThe output


Christian Balkenius
Lund University Cognitive Science



blog comments powered by Disqus