qm-dsp 1.8
PeakPicking.h
Go to the documentation of this file.
1/* -*- c-basic-offset: 4 indent-tabs-mode: nil -*- vi:set ts=8 sts=4 sw=4: */
2
3/*
4 QM DSP Library
5
6 Centre for Digital Music, Queen Mary, University of London.
7 This file 2005-2006 Christian Landone.
8
9 Modifications:
10
11 - delta threshold
12 Description: add delta threshold used as offset in the smoothed
13 detection function
14 Author: Mathieu Barthet
15 Date: June 2010
16
17 This program is free software; you can redistribute it and/or
18 modify it under the terms of the GNU General Public License as
19 published by the Free Software Foundation; either version 2 of the
20 License, or (at your option) any later version. See the file
21 COPYING included with this distribution for more information.
22*/
23
24// PeakPicking.h: interface for the PeakPicking class.
25//
27
28#ifndef PEAKPICKING_H
29#define PEAKPICKING_H
30
31#include "maths/MathUtilities.h"
32#include "maths/MathAliases.h"
34
35
37{
38 unsigned int pre;
39 unsigned int post;
40
41 PPWinThresh(unsigned int x, unsigned int y) :
42 pre(x),
43 post(y)
44 {
45 }
46};
47
49{
50 double a;
51 double b;
52 double c;
53
54 QFitThresh(double x, double y, double z) :
55 a(x),
56 b(y),
57 c(z)
58 {
59 }
60};
61
63{
64 unsigned int length; //Detection FunctionLength
65 double tau; // time resolution of the detection function
66 unsigned int alpha; //alpha-norm parameter
67 double cutoff;//low-pass Filter cutoff freq
68 unsigned int LPOrd; // low-pass Filter order
69 double* LPACoeffs; //low pass Filter den coefficients
70 double* LPBCoeffs; //low pass Filter num coefficients
71 PPWinThresh WinT;//window size in frames for adaptive thresholding [pre post]:
73 float delta; //delta threshold used as an offset when computing the smoothed detection function
74
76 length(0),
77 tau(0),
78 alpha(0),
79 cutoff(0),
80 LPOrd(0),
83 WinT(0,0),
84 QuadThresh(0,0,0),
85 delta(0)
86 {
87 }
88};
89
91{
92public:
93 PeakPicking( PPickParams Config );
94 virtual ~PeakPicking();
95
96 void process( double* src, unsigned int len, vector<int> &onsets );
97
98
99private:
100 void initialise( PPickParams Config );
101 void deInitialise();
102 int quadEval( vector<double> &src, vector<int> &idx );
103
105
106 unsigned int m_DFLength ;
107 double Qfilta ;
108 double Qfiltb;
109 double Qfiltc;
110
111
113
115};
116
117#endif
#define NULL
Definition Filter.h:20
int quadEval(vector< double > &src, vector< int > &idx)
DFProcConfig m_DFProcessingParams
unsigned int m_DFLength
virtual ~PeakPicking()
double Qfiltb
double * m_workBuffer
void initialise(PPickParams Config)
void process(double *src, unsigned int len, vector< int > &onsets)
double Qfiltc
DFProcess * m_DFSmoothing
double Qfilta
void deInitialise()
unsigned int pre
Definition PeakPicking.h:38
unsigned int post
Definition PeakPicking.h:39
PPWinThresh(unsigned int x, unsigned int y)
Definition PeakPicking.h:41
double cutoff
Definition PeakPicking.h:67
double * LPACoeffs
Definition PeakPicking.h:69
double * LPBCoeffs
Definition PeakPicking.h:70
QFitThresh QuadThresh
Definition PeakPicking.h:72
unsigned int alpha
Definition PeakPicking.h:66
unsigned int LPOrd
Definition PeakPicking.h:68
unsigned int length
Definition PeakPicking.h:64
PPWinThresh WinT
Definition PeakPicking.h:71
QFitThresh(double x, double y, double z)
Definition PeakPicking.h:54