comparison dsp/onsets/PeakPicking.cpp @ 96:88f3cfcff55f

A threshold (delta) is added in the peak picking parameters structure (PPickParams). It is used as an offset when computing the smoothed detection function. A constructor for the structure PPickParams is also added to set the parameters to 0 when a structure instance is created. Hence programmes using the peak picking parameter structure and which do not set the delta parameter (e.g. QM Vamp note onset detector) won't be affected by the modifications. Functions modified: - dsp/onsets/PeakPicking.cpp - dsp/onsets/PeakPicking.h - dsp/signalconditioning/DFProcess.cpp - dsp/signalconditioning/DFProcess.h
author mathieub <mathieu.barthet@eecs.qmul.ac.uk>
date Mon, 20 Jun 2011 19:01:48 +0100
parents e5907ae6de17
children 37449f085a4c
comparison
equal deleted inserted replaced
95:70143b37bbe6 96:88f3cfcff55f
4 QM DSP Library 4 QM DSP Library
5 5
6 Centre for Digital Music, Queen Mary, University of London. 6 Centre for Digital Music, Queen Mary, University of London.
7 This file 2005-2006 Christian Landone. 7 This file 2005-2006 Christian Landone.
8 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
9 This program is free software; you can redistribute it and/or 17 This program is free software; you can redistribute it and/or
10 modify it under the terms of the GNU General Public License as 18 modify it under the terms of the GNU General Public License as
11 published by the Free Software Foundation; either version 2 of the 19 published by the Free Software Foundation; either version 2 of the
12 License, or (at your option) any later version. See the file 20 License, or (at your option) any later version. See the file
13 COPYING included with this distribution for more information. 21 COPYING included with this distribution for more information.
14 */ 22 */
15 23
16 #include "PeakPicking.h" 24 #include "PeakPicking.h"
17 #include "maths/Polyfit.h" 25 #include "maths/Polyfit.h"
18 26
48 m_DFProcessingParams.LPBCoeffs = Config.LPBCoeffs; 56 m_DFProcessingParams.LPBCoeffs = Config.LPBCoeffs;
49 m_DFProcessingParams.winPre = Config.WinT.pre; 57 m_DFProcessingParams.winPre = Config.WinT.pre;
50 m_DFProcessingParams.winPost = Config.WinT.post; 58 m_DFProcessingParams.winPost = Config.WinT.post;
51 m_DFProcessingParams.AlphaNormParam = Config.alpha; 59 m_DFProcessingParams.AlphaNormParam = Config.alpha;
52 m_DFProcessingParams.isMedianPositive = false; 60 m_DFProcessingParams.isMedianPositive = false;
53 61 m_DFProcessingParams.Delta = Config.delta; //add the delta threshold as an adjustable parameter
62
54 m_DFSmoothing = new DFProcess( m_DFProcessingParams ); 63 m_DFSmoothing = new DFProcess( m_DFProcessingParams );
55 64
56 m_workBuffer = new double[ m_DFLength ]; 65 m_workBuffer = new double[ m_DFLength ];
57 memset( m_workBuffer, 0, sizeof(double)*m_DFLength); 66 memset( m_workBuffer, 0, sizeof(double)*m_DFLength);
58 } 67 }