26 template <
class T, u
int8_t FILTER_SIZE>
36 if (_timestamps[i1] == timestamp) {
42 _timestamps[i] = timestamp;
51 template <
class T, u
int8_t FILTER_SIZE>
62 #define f(i) FilterWithBuffer<T,FILTER_SIZE>::samples[(((FilterWithBuffer<T,FILTER_SIZE>::sample_index-1)+i+1)+3*FILTER_SIZE/2) % FILTER_SIZE] 63 #define x(i) _timestamps[(((FilterWithBuffer<T,FILTER_SIZE>::sample_index-1)+i+1)+3*FILTER_SIZE/2) % FILTER_SIZE] 65 if (_timestamps[FILTER_SIZE-1] == _timestamps[FILTER_SIZE-2]) {
71 switch (FILTER_SIZE) {
73 result = 2*2*(
f(1) -
f(-1)) / (
x(1) -
x(-1))
74 + 4*1*(
f(2) -
f(-2)) / (
x(2) -
x(-2));
78 result = 2*5*(
f(1) -
f(-1)) / (
x(1) -
x(-1))
79 + 4*4*(
f(2) -
f(-2)) / (
x(2) -
x(-2))
80 + 6*1*(
f(3) -
f(-3)) / (
x(3) -
x(-3));
84 result = 2*14*(
f(1) -
f(-1)) / (
x(1) -
x(-1))
85 + 4*14*(
f(2) -
f(-2)) / (
x(2) -
x(-2))
86 + 6* 6*(
f(3) -
f(-3)) / (
x(3) -
x(-3))
87 + 8* 1*(
f(4) -
f(-4)) / (
x(4) -
x(-4));
91 result = 2*42*(
f(1) -
f(-1)) / (
x(1) -
x(-1))
92 + 4*48*(
f(2) -
f(-2)) / (
x(2) -
x(-2))
93 + 6*27*(
f(3) -
f(-3)) / (
x(3) -
x(-3))
94 + 8* 8*(
f(4) -
f(-4)) / (
x(4) -
x(-4))
95 + 10* 1*(
f(5) -
f(-5)) / (
x(5) -
x(-5));
104 if (isnan(result) || isinf(result)) {
115 template <
class T, u
int8_t FILTER_SIZE>
void update(T sample, uint32_t timestamp)
virtual T apply(T sample)