|
PX4 Firmware
PX4 Autopilot Software http://px4.io
|
First order "alpha" IIR digital filter with input saturation. More...
#include <InnovationLpf.hpp>
Public Member Functions | |
| InnovationLpf ()=default | |
| ~InnovationLpf ()=default | |
| void | reset (float val=0.f) |
| float | update (float val, float alpha, float spike_limit) |
| Update the filter with a new value and returns the filtered state The new value is constained by the limit set in setSpikeLimit. More... | |
Static Public Member Functions | |
| static float | computeAlphaFromDtAndTauInv (float dt, float tau_inv) |
| Helper function to compute alpha from dt and the inverse of tau. More... | |
Private Attributes | |
| float | _x {} |
| current state of the filter More... | |
First order "alpha" IIR digital filter with input saturation.
Definition at line 40 of file InnovationLpf.hpp.
|
default |
|
default |
|
inlinestatic |
Helper function to compute alpha from dt and the inverse of tau.
| dt | sampling time in seconds |
| tau_inv | inverse of the time constant of the filter |
Definition at line 72 of file InnovationLpf.hpp.
References math::constrain(), and f().
Referenced by PreFlightChecker::update().
|
inline |
Definition at line 46 of file InnovationLpf.hpp.
References _x.
Referenced by PreFlightChecker::reset().
|
inline |
Update the filter with a new value and returns the filtered state The new value is constained by the limit set in setSpikeLimit.
| val | new input |
| alpha | normalized weight of the new input |
| spike_limit | the amplitude of the saturation at the input of the filter |
Definition at line 56 of file InnovationLpf.hpp.
References _x, and math::constrain().
Referenced by PreFlightChecker::preFlightCheckHeadingFailed(), PreFlightChecker::preFlightCheckHeightFailed(), PreFlightChecker::preFlightCheckHorizVelFailed(), and PreFlightChecker::preFlightCheckVertVelFailed().
|
private |
current state of the filter
Definition at line 78 of file InnovationLpf.hpp.