00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019 #ifndef PEAKTRACKING_H
00020 #define PEAKTRACKING_H
00021
00022 #include "Typedefs.h"
00023 #include "Debug.h"
00024
00048 class PeakTracking {
00049 protected:
00050
00051 int _trajectoryCount;
00052 Real _maximumFrequencyChange;
00053 int _silentFrameCount;
00054
00055
00056 MatrixXR _trajPositions, _trajMagnitudes;
00057 MatrixXR _pastTrajPositions, _pastTrajMagnitudes;
00058
00059 bool createTrajectory(Real peakPos, Real peakMag,
00060 MatrixXR* pastTrajPositions, MatrixXR* pastTrajMagnitudes,
00061 MatrixXR* trajPositions, MatrixXR* trajMagnitudes,
00062 int row);
00063
00064
00065 public:
00069 PeakTracking(int trajectoryCount = 20, Real maximumFrequencyChange = 3.0, int silentFrameCount = 3);
00070
00074 ~PeakTracking();
00075
00076 void setup();
00077 void reset();
00078
00105 void process(const MatrixXC& ffts,
00106 const MatrixXR& peakPositions, const MatrixXR& peakMagnitudes,
00107 MatrixXR* trajectoryPositions, MatrixXR* trajectoryMagnitudes);
00108
00114 int trajectoryCount() const;
00115
00124 void setTrajectoryCount( int count, bool callSetup = true );
00125
00133 Real maximumFrequencyChange() const;
00134
00144 void setMaximumFrequencyChange( Real change, bool callSetup = true );
00145
00152 int silentFrameCount() const;
00153
00162 void setSilentFrameCount( int count, bool callSetup = true );
00163
00164 };
00165
00166 #endif