FiniteImpulseResponse
The Finite Impulse Response (FIR) operator implements a classical FIR filter, computing the weighted sum of a sliding window of input values.
Buffer Size
The buffer size equals the length of the coefficient vector. For N coefficients, the operator maintains an N-sample buffer.
Output Computation
For input sequence x[n] and coefficients b[k], the output y[n] is computed as:
Example Operation
Time series showing input values and corresponding outputs for coefficients [0.5, 0.3, 0.2]:
| Time | Input | Output | Notes |
|---|---|---|---|
| 1 | 1.0 | - | Buffering |
| 2 | 2.0 | - | Buffering |
| 3 | 3.0 | 1.6 | 3.0×0.5 + 2.0×0.3 + 1.0×0.2 |
| 5 | 4.0 | 2.4 | 4.0×0.5 + 3.0×0.3 + 2.0×0.2 |
| 6 | 5.0 | 3.2 | 5.0×0.5 + 4.0×0.3 + 3.0×0.2 |
Note how output starts after buffer fills and continues with constant throughput.
Error Handling
Throws std::runtime_error if:
- Coefficient vector is empty
- Input message has invalid type