This processing takes a vector of scalars magnitudes and returns a list of peaks found considering that the first and last bins are neighbors. More...
#include <CircularPeakPicking.hxx>
Public Types | |
typedef std::vector< std::pair < double, double > > | PeakList |
Public Member Functions | |
CircularPeakPicking (unsigned chromagramSize, double binSize=1.0, double offset=0.0) | |
std::pair< double, double > | interpolate (double y0, double y1, double y2) |
Find the maximum of an interpolated quadratic polynomial function giving the samples at three equidistant points at x=0, x=1 and x=2. | |
void | doIt (const std::vector< double > &chromagram) |
const PeakList & | output () const |
This processing takes a vector of scalars magnitudes and returns a list of peaks found considering that the first and last bins are neighbors.
Peaks are detected when there is a bin that is greater that neighbor at both sides. Then peak position and value are interpolated using a quadratic function that passes also by the two neighbors bins.
The first bin is considered at offset and each bin increases binSize. By default, binSize and offset are 1 and 0 so that the bin position matches the resulting position.
Definition at line 45 of file CircularPeakPicking.hxx.
typedef std::vector<std::pair<double, double> > Simac::CircularPeakPicking::PeakList |
Definition at line 48 of file CircularPeakPicking.hxx.
Simac::CircularPeakPicking::CircularPeakPicking | ( | unsigned | chromagramSize, | |
double | binSize = 1.0 , |
|||
double | offset = 0.0 | |||
) | [inline] |
Definition at line 55 of file CircularPeakPicking.hxx.
void Simac::CircularPeakPicking::doIt | ( | const std::vector< double > & | chromagram | ) | [inline] |
Definition at line 106 of file CircularPeakPicking.hxx.
References interpolate().
std::pair<double,double> Simac::CircularPeakPicking::interpolate | ( | double | y0, | |
double | y1, | |||
double | y2 | |||
) | [inline] |
Find the maximum of an interpolated quadratic polynomial function giving the samples at three equidistant points at x=0, x=1 and x=2.
You can use it for any equidistant samples just by adding x0 to the resulting xmax.
Definition at line 70 of file CircularPeakPicking.hxx.
Referenced by doIt().
const PeakList& Simac::CircularPeakPicking::output | ( | ) | const [inline] |
Definition at line 132 of file CircularPeakPicking.hxx.