forked from dndubins/QuickStats
-
Notifications
You must be signed in to change notification settings - Fork 0
/
QuickStats.h
32 lines (28 loc) · 951 Bytes
/
QuickStats.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
/* QuickStats.h - Library for quick descriptive statistics of an array samples[] of size m,
* assuming a normal distribution.
* Created by David Dubins, January 10th, 2016.
* Released into the public domain.
*/
#ifndef QuickStats_h
#define QuickStats_h
#include <Arduino.h>
class QuickStats {
public:
QuickStats();
~QuickStats();
int average(int samples[],int m);
uint8_t average(uint8_t samples[],uint8_t m);
int g_average(int samples[],int m);
int minimum(int samples[],int m);
int maximum(int samples[],int m);
int stdev(int samples[],int m);
uint8_t stdev(uint8_t samples[],uint8_t m);
int stderror(int samples[],int m);
int CV(int samples[],int m);
void bubbleSort(int A[],int len);
int fabs(int sample);
int median(int samples[],int m);
uint8_t median(uint8_t samples[],uint8_t m);
int mode(int samples[],int m,int epsilon);
};
#endif