00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019 #ifndef PEAKDETECTIONCOMPLEX_H
00020 #define PEAKDETECTIONCOMPLEX_H
00021
00022 #include "Typedefs.h"
00023 #include "Debug.h"
00024
00025 #include <limits>
00026
00055 class PeakDetectionComplex {
00056 public:
00063 enum SortMethod {
00064 NONE = 0 ,
00065 BYMAGNITUDE = 1 ,
00066 BYPOSITION = 2
00067 };
00068
00069 protected:
00070
00071 int _peakCount;
00072 int _minimumPeakWidth;
00073 int _candidateCount;
00074 Real _minimumPeakContrast;
00075
00076 SortMethod _sortMethod;
00077
00078
00079 MatrixXR _magnitudes;
00080 MatrixXR _phases;
00081
00082 public:
00086 PeakDetectionComplex(int peakCount = 1024 / 3, SortMethod sort = BYMAGNITUDE, int minimumPeakWidth = 3, int candidateCount = -1, Real minimumPeakContrast = 0);
00087
00091 ~PeakDetectionComplex();
00092
00093 void reset();
00094 void setup();
00095
00119 void process(const MatrixXC& frames,
00120 MatrixXR* peakPositions, MatrixXR* peakMagnitudes, MatrixXR* peakPhases);
00121
00127 int peakCount() const;
00128
00133 void setPeakCount( int count, bool callSetup = true );
00134
00140 int minimumPeakWidth() const;
00141
00145 void setMinimumPeakWidth( int width, bool callSetup = true );
00146
00155 int candidateCount() const;
00156
00163 void setCandidateCount( int count, bool callSetup = true );
00164
00173 int minimumPeakContrast() const;
00174
00181 void setMinimumPeakContrast( Real contrast, bool callSetup = true );
00182
00188 SortMethod sortMethod() const;
00189
00193 void setSortMethod( SortMethod method, bool callSetup = true );
00194 };
00195
00196 #endif