avr-fw-modules/core/src/fp4816_smoother.c

12 lines
260 B
C
Executable File

#include <fixpoint/fp4816.h>
fp4816_t fp4816_smoother(struct _fp4816_smoother *smoother,fp4816_t sample) {
smoother->sum += sample;
smoother->value = fp4816_mul(smoother->sum,smoother->k);
smoother->sum -= smoother->value;
return smoother->value;
};