PeakTracking Class Reference

Algorithm to find peak trajectories in vectors of Complex values representing FFT, given peak positions and peak magnitudes. More...

#include <PeakTracking.h>

List of all members.

Public Member Functions

 PeakTracking (int trajectoryCount=20, Real maximumFrequencyChange=3.0, int silentFrameCount=3)
 ~PeakTracking ()
void process (const MatrixXC &ffts, const MatrixXR &peakPositions, const MatrixXR &peakMagnitudes, MatrixXR *trajectoryPositions, MatrixXR *trajectoryMagnitudes)
int trajectoryCount () const
void setTrajectoryCount (int count, bool callSetup=true)
Real maximumFrequencyChange () const
void setMaximumFrequencyChange (Real change, bool callSetup=true)
int silentFrameCount () const
void setSilentFrameCount (int count, bool callSetup=true)


Detailed Description

Algorithm to find peak trajectories in vectors of Complex values representing FFT, given peak positions and peak magnitudes.

The algorithm finds a maximum number of peak trajectories and returns the positions of the trajectory positions (in fractional index units) and the trajectory magnitudes (in decibel units) in separate matrices.

The maximum number of trajectories can be specified using setTrajectoryCount().

The algorithm operates by matching the peaks in the current frames to the existing trajectories. During the matching process a maximum frequency change of a peak can be specified using setMaximumFrequencyChange().

The matching process also requires a trajectory to stay unmatched during a given number of frames for the trajectory to disappear and leave a slot for another trajectory to be found. The number fo silent frames can be specified using silentFrameCount().

Author:
Ricard Marxer
See also:
PeakDetection, PeakDetectionComplex, PeakInterpolation, PeakInterpolationComplex, PeakTracking, PeakTrackingComplex

Constructor & Destructor Documentation

PeakTracking ( int  trajectoryCount = 20,
Real  maximumFrequencyChange = 3.0,
int  silentFrameCount = 3 
)

Constructs a peak tracking object with the given trajectoryCount, maximumFrequencyChange and silentFrameCount settings.

References setMaximumFrequencyChange(), setSilentFrameCount(), and setTrajectoryCount().

~PeakTracking (  ) 

Destroys the algorithm and frees its resources.


Member Function Documentation

void process ( const MatrixXC &  ffts,
const MatrixXR &  peakPositions,
const MatrixXR &  peakMagnitudes,
MatrixXR *  trajectoryPositions,
MatrixXR *  trajectoryMagnitudes 
)

Tracks peaks on each of the rows of ffts, peakPositions, peakMagnitudes and puts the resulting trajectory indices and magnitudes in the rows of trajectoryPositions and trajectoryMagnitudes respectively.

Parameters:
ffts matrix of Complex values representing the FFT frames.
peakPositions matrix of Real values for the peak positions (in fractional index units). The matrix should have the same number of rows as ffts.
peakMagnitudes matrix of Real values for the peak magnitudes (in decibel units). The matrix should have the same number of rows as ffts.
trajectoryPositions pointer to a matrix of Real values for the trajectory positions (in fractional index units). The matrix should have the same number of rows as ffts and trajectoryCount columns.
trajectoryMagnitudes pointer to a matrix of Real values for the trajectory magnitudes (in decibel units). The matrix should have the same number of rows as ffts and trajectoryCount columns.
Note that if the count of trajectories detected is lower than trajectoryCount some values of the resulting arrays will be set to -1.0 in order to indicate that it is not a trajectory.

Note that if the output matrices are not of the required size they will be resized, reallocating a new memory space if necessary.

int trajectoryCount (  )  const

Returns the maximum number of trajectories to be detected by the algorithm.

By default it is 20.

void setTrajectoryCount ( int  count,
bool  callSetup = true 
)

Specifies the maximum trajectory count to be detected by the algorithm. If <= 0, then all possible trajectories are detected.

Parameters:
count the maximum number of trajectories to be tracked
callSetup a flag specifying whether the setup() method must be called after setting the parameter.

Referenced by PeakTracking().

Real maximumFrequencyChange (  )  const

Returns the maximum frequency change of a peak for it to be matched to an existing trajectory.

The change is specified in fractional index units.

By default it is 3.0.

void setMaximumFrequencyChange ( Real  change,
bool  callSetup = true 
)

Specifies the maximum frequency change of a peak for it to be matched to an existing trajectory.

The change is specified in fractional index units.

Parameters:
change the maximum changed allowed between a peak and an existing trajectory
callSetup a flag specifying whether the setup() method must be called after setting the parameter.

Referenced by PeakTracking().

int silentFrameCount (  )  const

Returns the count of frames a trajectory must stay unmatched for it to disappear and leave the slot for another possible trajectory.

By default it is 3.

void setSilentFrameCount ( int  count,
bool  callSetup = true 
)

Specifies the count of frames a trajectory must stay unmatched for it to disappear and leave the slot for another possible trajectory.

Parameters:
count the number of silent frames
callSetup a flag specifying whether the setup() method must be called after setting the parameter.

Referenced by PeakTracking().


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

Generated on Tue Mar 31 20:38:33 2009 for Loudia by  doxygen 1.5.6