42#if defined(__cplusplus)
53 A_INLINE
void zero() {
output = 0; }
56#if defined(__cplusplus)
59typedef struct a_lpf lpf;
63#if defined(__cplusplus)
64#define A_LPF_INIT(alpha) {a_float_c(alpha), 0}
65#define A_LPF_INIT2(fc, ts) {A_LPF_GEN(fc, ts), 0}
67#define A_LPF_INIT(alpha) (a_lpf){a_float_c(alpha), 0}
68#define A_LPF_INIT2(fc, ts) (a_lpf){A_LPF_GEN(fc, ts), 0}
71#define A_LPF_GEN(fc, ts) (a_float_c(ts) / (A_FLOAT_1_TAU / a_float_c(fc) + a_float_c(ts)))
#define A_FLOAT_1_TAU
Definition math.h:249
#define a_float
Definition a.h:785
struct a_lpf a_lpf
instance structure for Low Pass Filter
double a_lpf_iter(a_lpf *ctx, double x)
calculate for Low Pass Filter
Definition lpf.h:111
void a_lpf_init(a_lpf *ctx, double alpha)
initialize for Low Pass Filter
Definition lpf.h:96
void a_lpf_zero(a_lpf *ctx)
zeroing for Low Pass Filter
Definition lpf.h:122
double a_lpf_gen(double fc, double ts)
generate for Low Pass Filter
Definition lpf.h:86
mathematical algorithm library
instance structure for Low Pass Filter
Definition lpf.h:39
double alpha
filter coefficient [0,1]
Definition lpf.h:40
double output
filter output
Definition lpf.h:41