Mixxx

Simac::CircularPeakPicking Class Reference

#include <CircularPeakPicking.hxx>

List of all members.

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)
void doIt (const std::vector< double > &chromagram)
const PeakListoutput () const

Detailed Description

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.

Author:
David Garcia

Definition at line 45 of file CircularPeakPicking.hxx.


Member Typedef Documentation

typedef std::vector<std::pair<double, double> > Simac::CircularPeakPicking::PeakList

Definition at line 48 of file CircularPeakPicking.hxx.


Constructor & Destructor Documentation

Simac::CircularPeakPicking::CircularPeakPicking ( unsigned  chromagramSize,
double  binSize = 1.0,
double  offset = 0.0 
) [inline]

Definition at line 55 of file CircularPeakPicking.hxx.


Member Function Documentation

void Simac::CircularPeakPicking::doIt ( const std::vector< double > &  chromagram) [inline]

Definition at line 106 of file CircularPeakPicking.hxx.

Here is the call graph for this function:

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.

Precondition:
The function will fail when y0>=y1 or y2>=y1, as it is supposed to be applied after having located a peak in y1.
Returns:
A pair containing xmax,ymax

Definition at line 70 of file CircularPeakPicking.hxx.

Here is the caller graph for this function:

const PeakList& Simac::CircularPeakPicking::output ( ) const [inline]

Definition at line 132 of file CircularPeakPicking.hxx.


The documentation for this class was generated from the following file:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Defines