41 #ifndef GRT_ZERO_CROSSING_COUNTER_HEADER 42 #define GRT_ZERO_CROSSING_COUNTER_HEADER 44 #include "../../CoreModules/FeatureExtraction.h" 45 #include "../../PreProcessingModules/Derivative.h" 46 #include "../../PreProcessingModules/DeadZone.h" 52 enum ZeroCrossingFeatureIDs{NUM_ZERO_CROSSINGS_COUNTED=0,ZERO_CROSSING_MAGNITUDE,TOTAL_NUM_ZERO_CROSSING_FEATURES};
53 enum FeatureModes{INDEPENDANT_FEATURE_MODE=0,COMBINED_FEATURE_MODE};
64 ZeroCrossingCounter(
const UINT searchWindowSize = 20,
const Float deadZoneThreshold = 0.01,
const UINT numDimensions = 1,
const UINT featureMode = INDEPENDANT_FEATURE_MODE);
113 virtual bool reset();
122 virtual bool save( std::fstream &file )
const;
131 virtual bool load( std::fstream &file );
144 bool init(
const UINT searchWindowSize,
const Float deadZoneThreshold,
const UINT numDimensions,
const UINT featureMode);
169 bool setSearchWindowSize(
const UINT searchWindowSize);
178 bool setFeatureMode(
const UINT featureMode);
187 bool setDeadZoneThreshold(
const Float deadZoneThreshold);
239 static std::string
getId();
251 static std::string id;
257 #endif //GRT_ZERO_CROSSING_COUNTER_HEADER std::string getId() const
virtual bool predict(VectorFloat inputVector)
CircularBuffer< VectorFloat > getDataBuffer() const
DeadZone deadZone
Used to remove small amounts of noise from the data.
virtual bool predict_(VectorFloat &inputVector)
virtual bool train(ClassificationData trainingData)
UINT getNumFeatures() const
virtual bool save(const std::string &filename) const
The DeadZone class sets any values in the input signal that fall within the dead-zone region to zero...
CircularBuffer< VectorFloat > dataBuffer
A buffer used to store the previous derivative data.
UINT searchWindowSize
The size of the search window, i.e. the amount of previous data stored and searched.
The Derivative class computes either the first or second order derivative of the input signal...
UINT featureMode
The featureMode controls how the features are added to the feature vector.
virtual bool train_(ClassificationData &trainingData)
UINT getFeatureMode() const
Float deadZoneThreshold
The threshold value used for the dead zone filter.
Derivative derivative
Used to compute the derivative of the input signal.
UINT getSearchWindowSize() const
Float getDeadZoneThreshold() const
virtual bool load(const std::string &filename)