comparison dsp/signalconditioning/DFProcess.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 2ae4ceb76ac3
comparison
equal deleted inserted replaced
95:70143b37bbe6 96:88f3cfcff55f
3 /* 3 /*
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
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
8 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
55 //Low Pass Smoothing Filter Config 63 //Low Pass Smoothing Filter Config
56 m_FilterConfigParams.ord = Config.LPOrd; 64 m_FilterConfigParams.ord = Config.LPOrd;
57 m_FilterConfigParams.ACoeffs = Config.LPACoeffs; 65 m_FilterConfigParams.ACoeffs = Config.LPACoeffs;
58 m_FilterConfigParams.BCoeffs = Config.LPBCoeffs; 66 m_FilterConfigParams.BCoeffs = Config.LPBCoeffs;
59 67
60 m_FiltFilt = new FiltFilt( m_FilterConfigParams ); 68 m_FiltFilt = new FiltFilt( m_FilterConfigParams );
69
70 //add delta threshold
71 m_Delta = Config.Delta;
61 } 72 }
62 73
63 void DFProcess::deInitialise() 74 void DFProcess::deInitialise()
64 { 75 {
65 delete [] filtSrc; 76 delete [] filtSrc;
144 } 155 }
145 156
146 157
147 for( i = 0; i < m_length; i++ ) 158 for( i = 0; i < m_length; i++ )
148 { 159 {
149 val = src[ i ] - scratch[ i ];// - 0.033; 160 //add a delta threshold used as an offset when computing the smoothed detection function
161 //(helps to discard noise when detecting peaks)
162 val = src[ i ] - scratch[ i ] - m_Delta;
150 163
151 if( m_isMedianPositive ) 164 if( m_isMedianPositive )
152 { 165 {
153 if( val > 0 ) 166 if( val > 0 )
154 { 167 {