PeakInterpolation Class Reference

Algorithm to interpolate peaks in a vector of Real values. More...

#include <PeakInterpolation.h>

List of all members.

Public Member Functions

 PeakInterpolation ()
 ~PeakInterpolation ()
void process (const MatrixXR &frames, const MatrixXR &peakPositions, const MatrixXR &peakMagnitudes, MatrixXR *peakPositionsInterpolated, MatrixXR *peakMagnitudesInterpolated)


Detailed Description

Algorithm to interpolate peaks in a vector of Real values.

This class represents an object to interpolate peaks in a vector of Real values. The algorithm interpolates the positions and magnitudes of a set of peaks, given the original frame, peak positions and peak magnidutes.

The interpolation consists in fitting a parabola (quadratic interpolation) on the point of the peak and the two points surrounding it.

Note that the interpolation is performed in the decibel domain, and in order to avoid innecessary transformations the resulting interpolated peak magnitudes are returned in decibels.

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

Constructor & Destructor Documentation

Constructs a peak interpolation object.

Destroys the algorithm and frees its resources.


Member Function Documentation

void process ( const MatrixXR &  frames,
const MatrixXR &  peakPositions,
const MatrixXR &  peakMagnitudes,
MatrixXR *  peakPositionsInterpolated,
MatrixXR *  peakMagnitudesInterpolated 
)

Interpolates the peaks on each of the rows of frames, peakPositions and peakMagnitudes to put the resulting peak interpolated positions and magnitudes in the rows of peakPositions and peakMagnitudes respectively.

Parameters:
frames matrix of Real values.
peakPositions matrix of Real values (but always Integers) for the peak indices. The matrix must have the same number of rows as frames and the same number of columns as peakMagnitudes.
peakMagnitudes pointer to a matrix of Real values (but always Integers) for the peak indices. The matrix must have the same number of rows as frames and the same number of columns as peakPositions.
peakPositionsInterpolated pointer to a matrix of Real values for the peak magnitudes. The matrix should have the same number of rows and columns as peakPositions and peakMagnitudes.
peakMagnitudesInterpolated pointer to a matrix of Real values for the peak magnitudes. The matrix should have the same number of rows and columns as peakPositions and peakMagnitudes. Note that the units of this matrix are decibels.
Note that peaks with positions values smaller than 0 are not considered peaks and will not be interpolated or modified.

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

Referenced by PitchACF::process().


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