12 lines
260 B
C
12 lines
260 B
C
|
#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;
|
||
|
};
|
||
|
|