#include <PeakInterpolationComplex.h>
Public Member Functions | |
PeakInterpolationComplex () | |
~PeakInterpolationComplex () | |
void | process (const MatrixXC &frames, const MatrixXR &peakPositions, const MatrixXR &peakMagnitudes, const MatrixXR &peakPhases, MatrixXR *peakPositionsInterpolated, MatrixXR *peakMagnitudesInterpolated, MatrixXR *peakPhasesInterpolated) |
This class represents an object to interpolate peaks in a vector of Complex 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.
Constructs a peak interpolation object.
Destroys the algorithm and frees its resources.
void process | ( | const MatrixXC & | frames, | |
const MatrixXR & | peakPositions, | |||
const MatrixXR & | peakMagnitudes, | |||
const MatrixXR & | peakPhases, | |||
MatrixXR * | peakPositionsInterpolated, | |||
MatrixXR * | peakMagnitudesInterpolated, | |||
MatrixXR * | peakPhasesInterpolated | |||
) |
Interpolates the peaks on each of the rows of frames, peakPositions, peakMagnitudes, peakPhases to put the resulting peak interpolated positions, magnitudes and phases in the rows of peakPositions, peakMagnitudes and peakMagnitudes respectively.
frames | matrix of Complex 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 for the peak magnitudes. The matrix must have the same number of rows as frames and the same number of columns as peakPositions and peakPhases. | |
peakPhases | pointer to a matrix of Real values for the peak phases. The matrix must have the same number of rows as frames and the same number of columns as peakMagnitudes and peakPositions. | |
peakPositionsInterpolated | pointer to a matrix of Real values for the peak positions. The matrix should have the same number of rows and columns as peakPositions, peakMagnitudes and peakPhases. | |
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, peakMagnitudes and peakPhases. Note that the units of this matrix are decibels. | |
peakPhasesInterpolated | pointer to a matrix of Real values for the peak phases. The matrix should have the same number of rows and columns as peakPositions, peakMagnitudes and peakPhases. |
Note that if the output matrices are not of the required size they will be resized, reallocating a new memory space if necessary.