27 #ifndef HIGH_PASS_FILTER_H
28 #define HIGH_PASS_FILTER_H
57 float tau,
float sample_time,
float value)
122 filter->
i[0] = filter->
i[1] = filter->
i[2] = filter->
i[3] = filter->
o[0] = filter->
o[1] = filter->
o[2] = filter->
o[3] = value;
133 double out = filter->
b[0] * value
134 + filter->
b[1] * filter->
i[0]
135 + filter->
b[2] * filter->
i[1]
136 + filter->
b[3] * filter->
i[2]
137 + filter->
b[0] * filter->
i[3]
138 - filter->
a[0] * filter->
o[0]
139 - filter->
a[1] * filter->
o[1]
140 - filter->
a[2] * filter->
o[2]
141 - filter->
a[3] * filter->
o[3];
143 filter->
i[3] = filter->
i[2];
144 filter->
i[2] = filter->
i[1];
145 filter->
i[1] = filter->
i[0];
146 filter->
i[0] = value;
147 filter->
o[3] = filter->
o[2];
148 filter->
o[2] = filter->
o[1];
149 filter->
o[1] = filter->
o[0];
static double update_fourth_order_high_pass(struct FourthOrderHighPass *filter, double value)
Update fourth order high pass filter state with a new value.
double b[4]
numerator gains
static void init_fourth_order_high_pass(struct FourthOrderHighPass *filter, double *a, double *b, double value)
Init fourth order high pass filter.
double a[4]
denominator gains
static void init_first_order_high_pass(struct FirstOrderHighPass *filter, float tau, float sample_time, float value)
Init first order high pass filter.
static float get_first_order_high_pass(struct FirstOrderHighPass *filter)
Get current value of the first order high pass filter.
static float update_first_order_high_pass(struct FirstOrderHighPass *filter, float value)
Update first order high pass filter state with a new value.
double o[4]
output history
static double get_fourth_order_high_pass(struct FourthOrderHighPass *filter)
Get current value of the fourth order high pass filter.
First order high pass filter structure.
Fourth order filter structure.
Paparazzi fixed point algebra.