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
- TypeScript
- Python
- C++
- YAML
- Json
import { Program, CosineResampler } from "@rtbot-dev/rtbot";
const id = "id";
const dt = 5;
const program = new Program();
program.addOperator(new CosineResampler(id, dt));
import rtbot as rb
id = "id";
dt = 5;
program = rb.Program()
program.addOperator(rb.CosineResampler(id, dt))
#include "rtbot/CosineResampler.h"
auto id = "id";
auto dt = 5;
auto op = CosineResampler<std::uint64_t, double>(id, dt)
# minimal RtBot program
operators:
- type: CosineResampler
id: "id"
dt: 5
{
"operators": [
{ "type": "CosineResampler", "id": "id", "dt": 5 }
]
}