GestureRecognitionToolkit  Version: 0.1.0
The Gesture Recognition Toolkit (GRT) is a cross-platform, open-source, c++ machine learning library for real-time gesture recognition.
TimeSeriesClassificationSampleTrimmer Class Reference

Public Member Functions

 TimeSeriesClassificationSampleTrimmer (Float trimThreshold=0.1, Float maximumTrimPercentage=80)
 
 ~TimeSeriesClassificationSampleTrimmer ()
 
TimeSeriesClassificationSampleTrimmeroperator= (const TimeSeriesClassificationSampleTrimmer &rhs)
 
bool trimTimeSeries (TimeSeriesClassificationSample &timeSeries)
 

Protected Attributes

Float trimThreshold
 
Float maximumTrimPercentage
 
DebugLog debugLog
 
WarningLog warningLog
 
ErrorLog errorLog
 

Detailed Description

Definition at line 50 of file TimeSeriesClassificationSampleTrimmer.h.

Constructor & Destructor Documentation

GRT_BEGIN_NAMESPACE TimeSeriesClassificationSampleTrimmer::TimeSeriesClassificationSampleTrimmer ( Float  trimThreshold = 0.1,
Float  maximumTrimPercentage = 80 
)

Default Constructor.

Definition at line 25 of file TimeSeriesClassificationSampleTrimmer.cpp.

TimeSeriesClassificationSampleTrimmer::~TimeSeriesClassificationSampleTrimmer ( )

Default Destructor

Definition at line 33 of file TimeSeriesClassificationSampleTrimmer.cpp.

Member Function Documentation

TimeSeriesClassificationSampleTrimmer& TimeSeriesClassificationSampleTrimmer::operator= ( const TimeSeriesClassificationSampleTrimmer rhs)
inline

Defines the equals operator. Copies the settings from the rhs instance to this instance

Parameters
rhsthe instance from which the settings will be copied
Returns
returns a reference to this instance

Definition at line 69 of file TimeSeriesClassificationSampleTrimmer.h.

bool TimeSeriesClassificationSampleTrimmer::trimTimeSeries ( TimeSeriesClassificationSample timeSeries)

The function attempts to detect and remove these static areas of data. This is done by computing the summed absolute energy of the timeseries data, normalizing the energy profile by the maximum energy value, and then searching for areas at the start and end of the timeseries that are below a specific trimthreshold (set by the user).

Any data that is below the trimthreshold will be removed, up until the first value that exceeds the threshold. This search is run both from the start of the timeseries (searching forward) and the end of the timeseries (searching backwards). If the length of the new timeseries is below the maximumTrimPercentage, then the timeseries will be trimmed and the trimTimeSeries function will return true. If the length of the new is above the maximumTrimPercentage, then the timeseries will not be trimmed and the trimTimeSeries function will return false. Set the maximumTrimPercentage to 100 if you want the timeseries to always be trimmed.

Parameters
timeSeriesthe timeseries to be trimmed (will be trimmed in place)
Returns
returns true if the timeseries was trimmed, false otherwise

Definition at line 35 of file TimeSeriesClassificationSampleTrimmer.cpp.


The documentation for this class was generated from the following files: