Go to the documentation of this file.00001
00025 #ifndef AVGVARFILTER_H
00026 #define AVGVARFILTER_H
00027
00028 #include "filter.h"
00029
00030 #include <QPair>
00031 #include <QVector>
00032 #include <QMutex>
00033
00034 class AvgVarFilter : public QObject, public Filter<double, AvgVarFilter, QPair<double, double> >
00035 {
00036 Q_OBJECT
00037
00038 public:
00039 AvgVarFilter(int samples);
00040 void reset();
00041
00042 private:
00043 int size;
00044 int samplesReceived;
00045 int current;
00046 QVector<double> samples;
00047 QVector<double> samplesSquared;
00048 double sampleSum;
00049 double sampleSquareSum;
00050 QMutex mutex;
00051
00052 void interpret(unsigned, const double* data);
00053 };
00054
00055 #endif