Skip to main content

Linear

Inputs: i1...iN where N is defined by the length of coeff.
Outputs: o1

Synchronizes input streams and emits a linear combination of the values for a given tnt_n.

The synchronization mechanism is inherited from the Join operator. The Linear operator holds a message buffer on i1...iN respectively, it emits a modified version of the synchronized messages from i1...iN as the linear combination of its values and the coefficients in coeff through o1 right after the synchronization takes place, if no synchronization occurs then an empty message {} is emitted through o1.

y(tn)=c1x1(tn)+c2x2(tn)+...+cNxN(tn)y(t_n)=c_1 x_1(t_n) + c_2 x_2(t_n) + ... + c_N x_N(t_n)

Parameters

id: The id of the operator

coeff: The list of coefficients.

Usage

import { Program, Linear } from "@rtbot-dev/rtbot";

const id = "id";
const coeff = [1,1,-1];

const program = new Program();
program.addOperator(new Linear(id, coeff));