31 #ifndef GRT_DERIVATIVE_HEADER
32 #define GRT_DERIVATIVE_HEADER
34 #include "../CoreModules/PreProcessing.h"
41 enum DerivativeOrders{FIRST_DERIVATIVE=1,SECOND_DERIVATIVE};
53 Derivative(UINT derivativeOrder=FIRST_DERIVATIVE,Float delta = 1,UINT numDimensions = 1,
bool filterData =
true,UINT filterSize = 3);
102 virtual bool reset();
111 virtual bool save(std::fstream &file)
const;
120 virtual bool load(std::fstream &file);
133 bool init(UINT derivativeOrder,Float delta,UINT numDimensions,
bool filterData,UINT filterSize);
141 Float computeDerivative(
const Float x);
158 bool setDerivativeOrder(UINT derivativeOrder);
168 bool setFilterSize(UINT filterSize);
179 bool setDelta(Float delta);
188 bool enableFiltering(
bool filterData);
204 Float getDerivative(UINT derivativeOrder = FIRST_DERIVATIVE);
213 VectorFloat getDerivatives(UINT derivativeOrder = FIRST_DERIVATIVE);
238 #endif //GRT_DERIVATIVE_HEADER
virtual bool predict(VectorFloat inputVector)
virtual bool deepCopyFrom(const PreProcessing *rhs)
virtual bool predict_(VectorFloat &inputVector)
UINT filterSize
The size of the filter used to filter the input data before the derivative is computed.
The MovingAverageFilter implements a low pass moving average filter.
virtual bool train(ClassificationData trainingData)
VectorFloat yy
A buffer holding the previous input value(s)
VectorFloat yyy
A buffer holding the previous first derivative values.
virtual bool save(const std::string filename) const
virtual bool load(const std::string filename)
bool filterData
Flags if the input data should be filtered before the derivative is computed.
Float delta
The estimated time between sensor samples.
virtual bool train_(ClassificationData &trainingData)
virtual bool process(const VectorFloat &inputVector)
UINT derivativeOrder
The order of the derivative that will be computed (either FIRST_DERIVATIVE or SECOND_DERIVATIVE) ...
MovingAverageFilter filter
The filter used to low pass filter the input data.