80 vector <double> m_maxima;
85 for (
int i = 0; i < len; i++) {
91 for(
int b = 0; b < (int)m_maxima.size(); b++) {
92 src[ b ] = m_maxima[ b ];
100 vector <int> m_maxIndex;
101 vector <int> m_onsetPosition;
103 vector <double> m_maxFit;
104 vector <double> m_poly;
105 vector <double> m_err;
111 for (
int t = -2; t < 3; t++) {
112 m_err.push_back( (
double)t );
115 for (
int i = 2; i < int(src.size()) - 2; i++) {
116 if ((src[i] > src[i-1]) && (src[i] > src[i+1]) && (src[i] > 0) ) {
117 m_maxIndex.push_back(i);
121 maxLength = int(m_maxIndex.size());
125 for (
int j = 0; j < maxLength ; j++) {
126 for (
int k = -2; k <= 2; ++k) {
127 selMax = src[ m_maxIndex[j] + k ] ;
128 m_maxFit.push_back(selMax);
133 double f = m_poly[0];
134 double h = m_poly[2];
136 if (h < -Qfilta || f >
Qfiltc) {
137 idx.push_back(m_maxIndex[j]);
DFProcConfig m_DFProcessingParams
static double PolyFit2(const vector< double > &x, const vector< double > &y, vector< double > &coef)
int quadEval(std::vector< double > &src, std::vector< int > &idx)
PeakPicking(PPickParams Config)
void initialise(PPickParams Config)
void process(double *src, int len, std::vector< int > &onsets)
void process(double *src, double *dst)
DFProcess * m_DFSmoothing