Ardour  8.7-15-gadf511264b
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 
48 struct QFitThresh
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),
81  LPACoeffs(NULL),
82  LPBCoeffs(NULL),
83  WinT(0,0),
84  QuadThresh(0,0,0),
85  delta(0)
86  {
87  }
88 };
89 
91 {
92 public:
94  virtual ~PeakPicking();
95 
96  void process( double* src, unsigned int len, vector<int> &onsets );
97 
98 
99 private:
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 
112  double* m_workBuffer;
113 
115 };
116 
117 #endif
int quadEval(vector< double > &src, vector< int > &idx)
DFProcConfig m_DFProcessingParams
Definition: PeakPicking.h:104
unsigned int m_DFLength
Definition: PeakPicking.h:106
double Qfiltb
Definition: PeakPicking.h:108
double * m_workBuffer
Definition: PeakPicking.h:112
virtual ~PeakPicking()
PeakPicking(PPickParams Config)
void initialise(PPickParams Config)
void process(double *src, unsigned int len, vector< int > &onsets)
double Qfiltc
Definition: PeakPicking.h:109
DFProcess * m_DFSmoothing
Definition: PeakPicking.h:114
double Qfilta
Definition: PeakPicking.h:107
void deInitialise()
RCConfiguration * Config
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
float delta
Definition: PeakPicking.h:73
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
double tau
Definition: PeakPicking.h:65
unsigned int LPOrd
Definition: PeakPicking.h:68
unsigned int length
Definition: PeakPicking.h:64
PPWinThresh WinT
Definition: PeakPicking.h:71
double c
Definition: PeakPicking.h:52
QFitThresh(double x, double y, double z)
Definition: PeakPicking.h:54
double a
Definition: PeakPicking.h:50
double b
Definition: PeakPicking.h:51