FiniteImpulseResponse
Inputs: i1
Outputs: o1
Computes the finite impulse response (FIR) within the time window specified by the length of the provided vector (coeff).
The FiniteImpulseResponse operator holds a message buffer on i1 with a size defined by the length of the provided vector (coeff). Once the message buffer on i1 gets filled it calculates the FIR and emits a message through o1 right after the message buffer on i1 gets filled. The value field of the emitted message is the calculated FIR and the time field is the time of the newest message on the buffer.
Parameters
id: The id of the operator
coeff: The vector of coefficients to be combined with the buffered message values.
Usage
- TypeScript
- Python
- C++
- YAML
- Json
import { Program, FiniteImpulseResponse } from "@rtbot-dev/rtbot";
const id = "id";
const coeff = [1,0,-1];
const program = new Program();
program.addOperator(new FiniteImpulseResponse(id, coeff));
import rtbot as rb
id = "id";
coeff = [1,0,-1];
program = rb.Program()
program.addOperator(rb.FiniteImpulseResponse(id, coeff))
#include "rtbot/FiniteImpulseResponse.h"
auto id = "id";
auto coeff = {1,0,-1};
auto op = FiniteImpulseResponse<std::uint64_t, double>(id, coeff)
# minimal RtBot program
operators:
- type: FiniteImpulseResponse
id: "id"
coeff: [1,0,-1]
{
"operators": [
{ "type": "FiniteImpulseResponse", "id": "id", "coeff": [1,0,-1] }
]
}