Skip to main content

CosineResampler

Inputs: i1
Outputs: o1

The CosineResampler operator resamples the input stream using the provided value (dt). The implemented algorithm can be found on http://paulbourke.net/miscellaneous/interpolation/ and it has been labeled as Cosine Interpolation.

The CosineResampler operator holds a message buffer on i1 with a size of 2. Once the message buffer on i1 gets filled it resamples the interval and emits a vector of messages through o1 right after the message buffer on i1 gets filled. The amount of messages returned in the resulting vector depend on how many dt intervals fall into the analized buffer.

Parameters

id: The id of the operator

dt: The size to transform the input grid steps, if any, on dt steps

Usage

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

const id = "id";
const dt = 5;

const program = new Program();
program.addOperator(new CosineResampler(id, dt));