1 /* -*- c-basic-offset: 4 indent-tabs-mode: nil -*- vi:set ts=8 sts=4 sw=4: */
6 Centre for Digital Music, Queen Mary, University of London.
7 This file 2005-2006 Christian Landone.
12 Description: add delta threshold used as offset in the smoothed
14 Author: Mathieu Barthet
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.
24 // PeakPicking.h: interface for the PeakPicking class.
26 //////////////////////////////////////////////////////////////////////
31 #include "maths/MathUtilities.h"
32 #include "maths/MathAliases.h"
33 #include "dsp/signalconditioning/DFProcess.h"
41 PPWinThresh(unsigned int x, unsigned int y) :
54 QFitThresh(double x, double y, double z) :
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
93 PeakPicking( PPickParams Config );
94 virtual ~PeakPicking();
96 void process( double* src, unsigned int len, vector<int> &onsets );
100 void initialise( PPickParams Config );
102 int quadEval( vector<double> &src, vector<int> &idx );
104 DFProcConfig m_DFProcessingParams;
106 unsigned int m_DFLength ;
112 double* m_workBuffer;
114 DFProcess* m_DFSmoothing;