29 #ifndef GRT_THRESHOLD_CROSSING_DETECTOR_HEADER
30 #define GRT_THRESHOLD_CROSSING_DETECTOR_HEADER
32 #include "../PreProcessingModules/MovingAverageFilter.h"
33 #include "../PreProcessingModules/Derivative.h"
51 ThresholdCrossingDetector(UINT analysisMode = RAW_DATA_ANALYSIS_MODE,UINT thresholdCrossingMode = UPPER_THRESHOLD_CROSSING,UINT detectionTimeoutMode = TIMEOUT_COUNTER,Float lowerThreshold = -1,Float upperThreshold = 1,Float hysteresisThreshold = 0,UINT searchWindowSize = 20,UINT searchTimeoutDuration = 1000,UINT offsetFilterSize = 10);
79 bool update(
const Float x );
249 Float lowerThreshold;
250 Float upperThreshold;
251 Float hysteresisThreshold;
253 bool thresholdCrossingDetected;
254 unsigned int analysisMode;
255 unsigned int thresholdCrossingMode;
256 unsigned int detectionTimeoutMode;
257 unsigned int searchTimeoutDuration;
258 unsigned int searchWindowSize;
259 unsigned int searchWindowIndex;
260 unsigned int offsetFilterSize;
261 unsigned int currentSearchState;
262 Timer searchTimeoutCounter;
267 enum SearchStates{SEARCHING_FOR_FIRST_THRESHOLD_CROSSING=0,SEARCHING_FOR_SECOND_THRESHOLD_CROSSING,NO_SEARCH_GATE_TIME_OUT};
269 enum ThresholdCrossingModes{UPPER_THRESHOLD_CROSSING=0,
270 LOWER_THRESHOLD_CROSSING,
271 UPPER_OR_LOWER_THRESHOLD_CROSSING,
272 UPPER_THEN_LOWER_THRESHOLD_CROSSING,
273 LOWER_THEN_UPPER_THRESHOLD_CROSSING};
275 enum AnalysisModes{RAW_DATA_ANALYSIS_MODE=0,MOVING_OFFSET_ANALYSIS_MODE,DERIVATIVE_ANALYSIS_MODE};
277 enum DetectionTimeoutMode{TIMEOUT_COUNTER=0,HYSTERESIS_THRESHOLD};
283 #endif //GRT_THRESHOLD_CROSSING_DETECTOR_HEADER
UINT getThresholdCrossingMode() const
bool triggerSearchTimeout()
bool setUpperThreshold(const Float upperThreshold)
The CircularBuffer class provides a data structure for creating a dynamic circular buffer (also known...
bool update(const Float x)
Float getAnalysisValue() const
bool setOffsetFilterSize(const UINT offsetFilterSize)
bool setSearchWindowSize(const UINT searchWindowSize)
bool setDetectionTimeoutMode(const UINT detectionTimeoutMode)
bool getThresholdCrossingDetected() const
bool setHysteresisThreshold(const Float hysteresisThreshold)
bool getEnableSearch() const
UINT getSearchWindowIndex() const
UINT getOffsetFilterSize() const
UINT getSearchTimeoutDuration() const
bool setAnalysisMode(const UINT analysisMode)
UINT getSearchWindowSize() const
~ThresholdCrossingDetector()
bool setLowerThreshold(const Float lowerThreshold)
ThresholdCrossingDetector & operator=(const ThresholdCrossingDetector &rhs)
bool setEnableSearch(const bool enableSearch)
bool setThresholdCrossingMode(const UINT thresholdCrossingMode)
Float getHysteresisThreshold() const
UINT getAnalysisMode() const
bool setSearchTimeoutDuration(const UINT searchTimeoutDuration)
ThresholdCrossingDetector(UINT analysisMode=RAW_DATA_ANALYSIS_MODE, UINT thresholdCrossingMode=UPPER_THRESHOLD_CROSSING, UINT detectionTimeoutMode=TIMEOUT_COUNTER, Float lowerThreshold=-1, Float upperThreshold=1, Float hysteresisThreshold=0, UINT searchWindowSize=20, UINT searchTimeoutDuration=1000, UINT offsetFilterSize=10)
UINT getSearchTimeoutCounter()
Float getLowerThreshold() const
Float getUpperThreshold() const