This class can be used to apply a first order filter on a signal. It allows different acceleration and deceleration time constants. More...
#include <common.h>
Public Member Functions | |
FirstOrderFilter (double timeConstantUp, double timeConstantDown, T initialState) | |
T | updateFilter (T inputState, double samplingTime) |
This method will apply a first order filter on the inputState. | |
~FirstOrderFilter () | |
Protected Attributes | |
T | previousState_ |
double | timeConstantDown_ |
double | timeConstantUp_ |
This class can be used to apply a first order filter on a signal. It allows different acceleration and deceleration time constants.
Short reveiw of discrete time implementation of first order system: Laplace: X(s)/U(s) = 1/(tau*s + 1) continous time system: dx(t) = (-1/tau)*x(t) + (1/tau)*u(t) discretized system (ZoH): x(k+1) = exp(samplingTime*(-1/tau))*x(k) + (1 - exp(samplingTime*(-1/tau))) * u(k)
FirstOrderFilter< T >::FirstOrderFilter | ( | double | timeConstantUp, |
double | timeConstantDown, | ||
T | initialState | ||
) | [inline] |
FirstOrderFilter< T >::~FirstOrderFilter | ( | ) | [inline] |
T FirstOrderFilter< T >::updateFilter | ( | T | inputState, |
double | samplingTime | ||
) | [inline] |
T FirstOrderFilter< T >::previousState_ [protected] |
double FirstOrderFilter< T >::timeConstantDown_ [protected] |
double FirstOrderFilter< T >::timeConstantUp_ [protected] |