13 #include <wpi/ArrayRef.h>
15 #include "frc/circular_buffer.h"
16 #include "frc/filters/Filter.h"
106 double timeConstant,
double period);
146 double timeConstant,
double period);
160 double timeConstant,
double period);
176 double Get()
const override;
177 void Reset()
override;
190 std::vector<double> m_inputGains;
191 std::vector<double> m_outputGains;
Definition: SPIAccelerometerSim.h:18
PIDSource interface is a generic sensor source for the PID class.
Definition: PIDSource.h:20
LinearDigitalFilter(PIDSource &source, wpi::ArrayRef< double > ffGains, wpi::ArrayRef< double > fbGains)
Create a linear FIR or IIR filter.
ArrayRef - Represent a constant reference to an array (0 or more elements consecutively in memory)...
Definition: ArrayRef.h:41
void Reset() override
Reset the filter state.
double PIDGet() override
Calculates the next value of the filter.
static LinearDigitalFilter HighPass(PIDSource &source, double timeConstant, double period)
Creates a first-order high-pass filter of the form: y[n] = gain * x[n] + (-gain) * x[n-1] + gain * y...
static LinearDigitalFilter SinglePoleIIR(PIDSource &source, double timeConstant, double period)
Creates a one-pole IIR low-pass filter of the form: y[n] = (1 - gain) * x[n] + gain * y[n-1] where ...
double Get() const override
Returns the current filter estimate without also inserting new data as PIDGet() would do...
static LinearDigitalFilter MovingAverage(PIDSource &source, int taps)
Creates a K-tap FIR moving average filter of the form: y[n] = 1/k * (x[k] + x[k-1] + … + x[0]) ...
This class implements a linear, digital filter.
Definition: LinearDigitalFilter.h:70
Interface for filters.
Definition: Filter.h:19