GestureRecognitionToolkit  Version: 0.2.5
The Gesture Recognition Toolkit (GRT) is a cross-platform, open-source, c++ machine learning library for real-time gesture recognition.
FFTFeatures.h
Go to the documentation of this file.
1 
29 #ifndef GRT_FFT_FEATURES_HEADER
30 #define GRT_FFT_FEATURES_HEADER
31 
32 #include "../../CoreModules/FeatureExtraction.h"
33 #include "FFT.h"
34 
35 GRT_BEGIN_NAMESPACE
36 
37 class GRT_API FFTFeatures : public FeatureExtraction
38 {
39 public:
52  FFTFeatures(const UINT fftWindowSize=512,const UINT numChannelsInFFTSignal=1,const bool computeMaxFreqFeature = true,const bool computeMaxFreqSpectrumRatio = true,const bool computeCentroidFeature = true,const bool computeTopNFreqFeatures = true,const UINT N = 10);
53 
59  FFTFeatures(const FFTFeatures &rhs);
60 
64  virtual ~FFTFeatures(void);
65 
72  FFTFeatures& operator=(const FFTFeatures &rhs);
73 
82  virtual bool deepCopyFrom(const FeatureExtraction *featureExtraction);
83 
91  virtual bool computeFeatures(const VectorFloat &inputVector);
92 
100  virtual bool reset();
101 
109  virtual bool save( std::fstream &file ) const;
110 
118  virtual bool load( std::fstream &file );
119 
134  bool init(const UINT fftWindowSize,const UINT numChannelsInFFTSignal,const bool computeMaxFreqFeature,const bool computeMaxFreqSpectrumRatio,const bool computeCentroidFeature,const bool computeTopNFreqFeatures,const UINT N);
135 
136  //Tell the compiler we are using the following functions from the FeatureExtraction class to stop hidden virtual function warnings
137  using MLBase::save;
138  using MLBase::load;
139 
145  static std::string getId();
146 
147 protected:
148  UINT fftWindowSize;
149  UINT numChannelsInFFTSignal;
150  bool computeMaxFreqFeature;
151  bool computeMaxFreqSpectrumRatio;
152  bool computeCentroidFeature;
153  bool computeTopNFreqFeatures;
154 
155  UINT N;
156  Float maxFreqFeature;
157  Float maxFreqSpectrumRatio;
158  Float centroidFeature;
159  VectorFloat topNFreqFeatures;
160 
161 private:
163  static std::string id;
164 
165 };
166 
167 GRT_END_NAMESPACE
168 
169 #endif //GRT_FFT_FEATURES_HEADER
170 
std::string getId() const
Definition: GRTBase.cpp:85
virtual bool reset()
Definition: MLBase.cpp:147
virtual bool save(const std::string &filename) const
Definition: MLBase.cpp:167
virtual bool computeFeatures(const VectorFloat &inputVector)
virtual bool load(const std::string &filename)
Definition: MLBase.cpp:190
virtual bool deepCopyFrom(const FeatureExtraction *rhs)