38 Lowpass(
float gain = 1,
float sampleTime = 0.1,
float timeconstant = 1.0) {
40 this->Ts = sampleTime;
41 this->tau = timeconstant;
88 cb_data = (
float *)malloc(windowSize *
sizeof(
float));
102 for (
size_t i = 0; i <
M; i++) {
Simple discrete IIR lowpass filter.
Definition filters.h:21
float updateState(float u)
Update the filter state. Must be called with the constant period Ts.
Definition filters.h:49
Lowpass(float gain=1, float sampleTime=0.1, float timeconstant=1.0)
Constucts and initializes the Lowpass filter.
Definition filters.h:38
void resetState(void)
Resets the filter state x to 0.0.
Definition filters.h:58
float tau
Filter timeconstant.
Definition filters.h:26
float K
Filter gain.
Definition filters.h:24
float x
Filter state.
Definition filters.h:27
float Ts
Filter sampling time.
Definition filters.h:25
Simple FIR moving maximum filter.
Definition filters.h:68
float * cb_data
Pointer to ring buffer holding the data.
Definition filters.h:73
unsigned int cb_index
Current ringbuffer index.
Definition filters.h:74
unsigned int M
Window Size.
Definition filters.h:71
MovMax(float windowSize)
Constucts and initializes the MovMax filter.
Definition filters.h:85
float updateState(float u)
Update and return the filter state.
Definition filters.h:95
Joint firmware.
Definition filters.h:15