qm-dsp
1.8
|
00001 /* -*- c-basic-offset: 4 indent-tabs-mode: nil -*- vi:set ts=8 sts=4 sw=4: */ 00002 00003 /* 00004 QM DSP Library 00005 00006 Centre for Digital Music, Queen Mary, University of London. 00007 This file 2005-2006 Christian Landone. 00008 00009 Modifications: 00010 00011 - delta threshold 00012 Description: add delta threshold used as offset in the smoothed 00013 detection function 00014 Author: Mathieu Barthet 00015 Date: June 2010 00016 00017 This program is free software; you can redistribute it and/or 00018 modify it under the terms of the GNU General Public License as 00019 published by the Free Software Foundation; either version 2 of the 00020 License, or (at your option) any later version. See the file 00021 COPYING included with this distribution for more information. 00022 */ 00023 00024 #ifndef CDFPROCESS_H 00025 #define CDFPROCESS_H 00026 00027 #include <stdio.h> 00028 #include "FiltFilt.h" 00029 00030 struct DFProcConfig{ 00031 unsigned int length; 00032 unsigned int LPOrd; 00033 double *LPACoeffs; 00034 double *LPBCoeffs; 00035 unsigned int winPre; 00036 unsigned int winPost; 00037 double AlphaNormParam; 00038 bool isMedianPositive; 00039 float Delta; //delta threshold used as an offset when computing the smoothed detection function 00040 }; 00041 00042 class DFProcess 00043 { 00044 public: 00045 DFProcess( DFProcConfig Config ); 00046 virtual ~DFProcess(); 00047 00048 void process( double* src, double* dst ); 00049 00050 00051 private: 00052 void initialise( DFProcConfig Config ); 00053 void deInitialise(); 00054 void removeDCNormalize( double *src, double*dst ); 00055 void medianFilter( double* src, double* dst ); 00056 00057 int m_length; 00058 int m_FFOrd; 00059 00060 int m_winPre; 00061 int m_winPost; 00062 00063 double m_alphaNormParam; 00064 00065 double* filtSrc; 00066 double* filtDst; 00067 00068 double* m_filtScratchIn; 00069 double* m_filtScratchOut; 00070 00071 FilterConfig m_FilterConfigParams; 00072 00073 FiltFilt* m_FiltFilt; 00074 00075 bool m_isMedianPositive; 00076 float m_Delta; //add delta threshold 00077 }; 00078 00079 #endif