LinearSplines

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

  <module
      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.

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

Parameters

NameDescriptionTypeDefault
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

Inputs

NameDescription
INPUTInput signal

Outputs

NameDescription
OUTPUTThe output

Author

Christian Balkenius
christian.balkenius@lucs.lu.se
Lund University Cognitive Science

Files

LinearSplines.h
LinearSplines.cc
LinearSplines.ikc

blog comments powered by Disqus