OSDN Git Service

Median filter implementation
[android-x86/hardware-intel-libsensors.git] / filtering.h
1 #ifndef FILTERING_H
2 #define FILTERING_H
3
4 #define SAMPLE_SIZE 7
5
6 struct circ_buff
7 {
8         float* buff;
9         unsigned int idx;
10         unsigned int count;
11         unsigned int size;
12 };
13
14 struct filter
15 {
16         struct circ_buff* x_buff;
17         struct circ_buff* y_buff;
18         struct circ_buff* z_buff;
19 };
20
21 void add_to_buff(struct circ_buff* circ_buff, float val);
22 float median(float* queue, unsigned int size);
23 void denoise_median(struct sensors_event_t* event, struct sensor_info_t* info);
24
25 #endif