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
"
33
#include "
dsp/signalconditioning/DFProcess.h
"
34
35
36
struct
PPWinThresh
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
62
struct
PPickParams
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]:
72
QFitThresh
QuadThresh
;
73
float
delta
;
//delta threshold used as an offset when computing the smoothed detection function
74
75
PPickParams
() :
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
90
class
PeakPicking
91
{
92
public
:
93
PeakPicking
(
PPickParams
Config );
94
virtual
~
PeakPicking
();
95
96
void
process(
double
* src,
unsigned
int
len, vector<int> &onsets );
97
98
99
private
:
100
void
initialise(
PPickParams
Config );
101
void
deInitialise();
102
int
quadEval( vector<double> &src, vector<int> &idx );
103
104
DFProcConfig
m_DFProcessingParams
;
105
106
unsigned
int
m_DFLength
;
107
double
Qfilta
;
108
double
Qfiltb
;
109
double
Qfiltc
;
110
111
112
double
*
m_workBuffer
;
113
114
DFProcess
*
m_DFSmoothing
;
115
};
116
117
#endif
PPickParams
Definition:
PeakPicking.h:62
PeakPicking::m_workBuffer
double * m_workBuffer
Definition:
PeakPicking.h:112
PeakPicking::m_DFProcessingParams
DFProcConfig m_DFProcessingParams
Definition:
PeakPicking.h:104
PPickParams::length
unsigned int length
Definition:
PeakPicking.h:64
PPickParams::LPOrd
unsigned int LPOrd
Definition:
PeakPicking.h:68
PPickParams::tau
double tau
Definition:
PeakPicking.h:65
PPickParams::delta
float delta
Definition:
PeakPicking.h:73
DFProcess
Definition:
DFProcess.h:42
PPWinThresh::PPWinThresh
PPWinThresh(unsigned int x, unsigned int y)
Definition:
PeakPicking.h:41
MathUtilities.h
QFitThresh
Definition:
PeakPicking.h:48
PPWinThresh::post
unsigned int post
Definition:
PeakPicking.h:39
NULL
#define NULL
Definition:
Filter.h:20
PPickParams::LPBCoeffs
double * LPBCoeffs
Definition:
PeakPicking.h:70
PeakPicking::Qfiltc
double Qfiltc
Definition:
PeakPicking.h:109
PPWinThresh::pre
unsigned int pre
Definition:
PeakPicking.h:38
PPWinThresh
Definition:
PeakPicking.h:36
QFitThresh::c
double c
Definition:
PeakPicking.h:52
DFProcConfig
Definition:
DFProcess.h:30
PeakPicking::m_DFSmoothing
DFProcess * m_DFSmoothing
Definition:
PeakPicking.h:114
QFitThresh::b
double b
Definition:
PeakPicking.h:51
PeakPicking::Qfiltb
double Qfiltb
Definition:
PeakPicking.h:108
PPickParams::cutoff
double cutoff
Definition:
PeakPicking.h:67
QFitThresh::a
double a
Definition:
PeakPicking.h:50
PeakPicking::m_DFLength
unsigned int m_DFLength
Definition:
PeakPicking.h:106
PPickParams::LPACoeffs
double * LPACoeffs
Definition:
PeakPicking.h:69
PPickParams::PPickParams
PPickParams()
Definition:
PeakPicking.h:75
PeakPicking
Definition:
PeakPicking.h:90
PPickParams::QuadThresh
QFitThresh QuadThresh
Definition:
PeakPicking.h:72
MathAliases.h
QFitThresh::QFitThresh
QFitThresh(double x, double y, double z)
Definition:
PeakPicking.h:54
PPickParams::alpha
unsigned int alpha
Definition:
PeakPicking.h:66
PeakPicking::Qfilta
double Qfilta
Definition:
PeakPicking.h:107
PPickParams::WinT
PPWinThresh WinT
Definition:
PeakPicking.h:71
DFProcess.h
dsp
onsets
PeakPicking.h
Generated by
1.8.13