hack gt final code
Dependencies: 4DGL-uLCD-SE BMP085 PinDetect SDFileSystem mbed wave_player
statistics.h@14:23390a020d1c, 2016-09-28 (annotated)
- Committer:
- otis22894
- Date:
- Wed Sep 28 00:16:16 2016 +0000
- Revision:
- 14:23390a020d1c
- Parent:
- 12:b301cb3cef44
initial commit;
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
otis22894 | 12:b301cb3cef44 | 1 | #include "mbed.h" |
otis22894 | 12:b301cb3cef44 | 2 | |
otis22894 | 12:b301cb3cef44 | 3 | class RunningStatistics { |
otis22894 | 12:b301cb3cef44 | 4 | public: |
otis22894 | 12:b301cb3cef44 | 5 | |
otis22894 | 12:b301cb3cef44 | 6 | RunningStatistics(int numSamples); |
otis22894 | 12:b301cb3cef44 | 7 | double addSample(double newSample); |
otis22894 | 12:b301cb3cef44 | 8 | double getAverage(); |
otis22894 | 12:b301cb3cef44 | 9 | double getStandardDeviation(); |
otis22894 | 12:b301cb3cef44 | 10 | void reset(); |
otis22894 | 12:b301cb3cef44 | 11 | int getCount(); |
otis22894 | 12:b301cb3cef44 | 12 | double getSum(); |
otis22894 | 12:b301cb3cef44 | 13 | |
otis22894 | 12:b301cb3cef44 | 14 | double sum; |
otis22894 | 12:b301cb3cef44 | 15 | double sumSquares; |
otis22894 | 12:b301cb3cef44 | 16 | double average; |
otis22894 | 12:b301cb3cef44 | 17 | double *samples; |
otis22894 | 12:b301cb3cef44 | 18 | |
otis22894 | 12:b301cb3cef44 | 19 | int sampleSize; |
otis22894 | 12:b301cb3cef44 | 20 | int currentNdx; |
otis22894 | 12:b301cb3cef44 | 21 | int count; |
otis22894 | 12:b301cb3cef44 | 22 | }; |