c@225: /* -*- c-basic-offset: 4 indent-tabs-mode: nil -*- vi:set ts=8 sts=4 sw=4: */ c@225: c@225: /* c@225: QM DSP Library c@225: c@225: Centre for Digital Music, Queen Mary, University of London. c@225: This file copyright 2005-2006 Christian Landone. c@225: All rights reserved. c@225: */ c@225: c@225: // PeakPicking.h: interface for the PeakPicking class. c@225: // c@225: ////////////////////////////////////////////////////////////////////// c@225: c@225: #ifndef PEAKPICKING_H c@225: #define PEAKPICKING_H c@225: c@241: #include "maths/MathUtilities.h" c@241: #include "maths/MathAliases.h" c@225: #include "dsp/signalconditioning/DFProcess.h" c@225: c@225: c@237: struct PPWinThresh c@225: { c@225: unsigned int pre; c@225: unsigned int post; c@225: }; c@225: c@225: struct QFitThresh c@225: { c@225: double a; c@225: double b; c@225: double c; c@225: }; c@225: c@225: struct PPickParams c@225: { c@225: unsigned int length; //Detection FunctionLength c@225: double tau; // time resolution of the detection function: c@225: unsigned int alpha; //alpha-norm parameter c@225: double cutoff;//low-pass Filter cutoff freq c@225: unsigned int LPOrd; // low-pass Filter order c@225: double* LPACoeffs; //low pass Filter den coefficients c@225: double* LPBCoeffs; //low pass Filter num coefficients c@237: PPWinThresh WinT;//window size in frames for adaptive thresholding [pre post]: c@225: QFitThresh QuadThresh; c@225: }; c@225: c@225: class PeakPicking c@225: { c@225: public: c@225: PeakPicking( PPickParams Config ); c@225: virtual ~PeakPicking(); c@225: c@225: void process( double* src, unsigned int len, vector &onsets ); c@225: c@225: c@225: private: c@225: void initialise( PPickParams Config ); c@225: void deInitialise(); c@225: int quadEval( vector &src, vector &idx ); c@225: c@225: DFProcConfig m_DFProcessingParams; c@225: c@225: unsigned int m_DFLength ; c@225: double Qfilta ; c@225: double Qfiltb; c@225: double Qfiltc; c@225: c@225: c@225: double* m_workBuffer; c@225: c@225: DFProcess* m_DFSmoothing; c@225: }; c@225: c@225: #endif