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@309: This file 2005-2006 Christian Landone. c@309: mathieu@321: Modifications: mathieu@321: mathieu@321: - delta threshold mathieu@321: Description: add delta threshold used as offset in the smoothed mathieu@321: detection function mathieu@321: Author: Mathieu Barthet mathieu@321: Date: June 2010 mathieu@321: c@309: This program is free software; you can redistribute it and/or c@309: modify it under the terms of the GNU General Public License as c@309: published by the Free Software Foundation; either version 2 of the c@309: License, or (at your option) any later version. See the file c@309: COPYING included with this distribution for more information. c@225: */ c@225: cannam@489: #ifndef QM_DSP_DFPROCESS_H cannam@489: #define QM_DSP_DFPROCESS_H c@225: c@225: #include "FiltFilt.h" c@225: cannam@503: #include cannam@503: cannam@503: struct DFProcConfig cannam@503: { cannam@503: int length; cannam@503: int LPOrd; c@225: double *LPACoeffs; c@225: double *LPBCoeffs; cannam@503: int winPre; cannam@503: int winPost; c@225: double AlphaNormParam; c@237: bool isMedianPositive; c@410: float delta; //delta threshold used as an offset when computing the smoothed detection function c@410: c@410: DFProcConfig() : c@410: length(0), c@410: LPOrd(0), c@410: LPACoeffs(NULL), c@410: LPBCoeffs(NULL), c@410: winPre(0), c@410: winPost(0), c@410: AlphaNormParam(0), c@410: isMedianPositive(false), c@410: delta(0) c@410: { c@410: } c@237: }; c@225: c@225: class DFProcess c@225: { c@225: public: c@225: DFProcess( DFProcConfig Config ); c@225: virtual ~DFProcess(); c@225: c@225: void process( double* src, double* dst ); cannam@483: c@225: private: c@225: void initialise( DFProcConfig Config ); c@225: void deInitialise(); c@225: void removeDCNormalize( double *src, double*dst ); c@225: void medianFilter( double* src, double* dst ); c@225: c@299: int m_length; c@299: int m_FFOrd; c@225: c@299: int m_winPre; c@299: int m_winPost; c@225: c@225: double m_alphaNormParam; c@225: c@225: double* filtSrc; c@225: double* filtDst; c@225: c@225: double* m_filtScratchIn; c@225: double* m_filtScratchOut; c@225: c@225: FiltFilt* m_FiltFilt; c@225: c@225: bool m_isMedianPositive; c@410: float m_delta; //add delta threshold c@225: }; c@225: c@225: #endif