sensorfw: sensors/contextplugin/avgvarfilter.h Source File

sensorfw

avgvarfilter.h
Go to the documentation of this file.
1
25#ifndef AVGVARFILTER_H
26#define AVGVARFILTER_H
27
28#include "filter.h"
29
30#include <QPair>
31#include <QVector>
32#include <QMutex>
33
34 class AvgVarFilter : public QObject, public Filter<double, AvgVarFilter, QPair<double, double> >
35{
36 Q_OBJECT
37
38public:
39 AvgVarFilter(int samples);
40 void reset();
41
42private:
43 int size;
44 int samplesReceived;
45 int current;
46 QVector<double> samples;
47 QVector<double> samplesSquared;
48 double sampleSum;
49 double sampleSquareSum;
50 QMutex mutex;
51
52 void interpret(unsigned, const double* data);
53};
54
55#endif
AvgVarFilter
Definition: avgvarfilter.h:35
AvgVarFilter::AvgVarFilter
AvgVarFilter(int samples)
AvgVarFilter::reset
void reset()