Implemented getMetrics()
This commit is contained in:
44
buildResult/dataAcquisition.h
Normal file
44
buildResult/dataAcquisition.h
Normal file
@@ -0,0 +1,44 @@
|
||||
#ifndef DATA_ACQUISITION_H
|
||||
#define DATA_ACQUISITION_H
|
||||
|
||||
#include <stdbool.h>
|
||||
#include <math.h>
|
||||
#include <stdlib.h>
|
||||
|
||||
typedef struct {
|
||||
float mean;
|
||||
float standardDeviation;
|
||||
int possibleFaultySensor;
|
||||
} Metrics;
|
||||
|
||||
typedef struct {
|
||||
int sensorsNumber;
|
||||
int slidingWindowSize;
|
||||
} Matrix;
|
||||
|
||||
void initializeReadings(int numSensors, float deltaTime);
|
||||
bool freeReadings();
|
||||
|
||||
int getSensorsNumber();
|
||||
int getSlidingWindowSize();
|
||||
bool isFull(int sensorIndex);
|
||||
|
||||
void addReading(float value);
|
||||
|
||||
float getAverageOnSensor(int sensorIndex);
|
||||
float getAverageOnAllSensors();
|
||||
float getOverallAverage();
|
||||
|
||||
float getStandardDeviationOnSensor(int sensorIndex);
|
||||
float getStandardDeviationOnAllSensors();
|
||||
float getOverallStandardDeviation();
|
||||
|
||||
float getLastReading(int sensorIndex);
|
||||
|
||||
bool anomalyDetect(float average, float standardDeviation);
|
||||
|
||||
int getOutlierCount();
|
||||
|
||||
Metrics getMetrics(float **readings, int sensorNumber, int slidingWindow);
|
||||
|
||||
#endif // DATA_ACQUISITION_H
|
||||
Reference in New Issue
Block a user