qm-dsp  1.8
DFProcess.h
Go to the documentation of this file.
1 /* -*- c-basic-offset: 4 indent-tabs-mode: nil -*- vi:set ts=8 sts=4 sw=4: */
2 
3 /*
4  QM DSP Library
5 
6  Centre for Digital Music, Queen Mary, University of London.
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
16 
17  This program is free software; you can redistribute it and/or
18  modify it under the terms of the GNU General Public License as
19  published by the Free Software Foundation; either version 2 of the
20  License, or (at your option) any later version. See the file
21  COPYING included with this distribution for more information.
22 */
23 
24 #ifndef CDFPROCESS_H
25 #define CDFPROCESS_H
26 
27 #include <stdio.h>
28 #include "FiltFilt.h"
29 
30 struct DFProcConfig{
31  unsigned int length;
32  unsigned int LPOrd;
33  double *LPACoeffs;
34  double *LPBCoeffs;
35  unsigned int winPre;
36  unsigned int winPost;
39  float Delta; //delta threshold used as an offset when computing the smoothed detection function
40 };
41 
42 class DFProcess
43 {
44 public:
45  DFProcess( DFProcConfig Config );
46  virtual ~DFProcess();
47 
48  void process( double* src, double* dst );
49 
50 
51 private:
52  void initialise( DFProcConfig Config );
53  void deInitialise();
54  void removeDCNormalize( double *src, double*dst );
55  void medianFilter( double* src, double* dst );
56 
57  int m_length;
58  int m_FFOrd;
59 
60  int m_winPre;
61  int m_winPost;
62 
64 
65  double* filtSrc;
66  double* filtDst;
67 
68  double* m_filtScratchIn;
70 
72 
74 
76  float m_Delta; //add delta threshold
77 };
78 
79 #endif
double * filtSrc
Definition: DFProcess.h:65
Filter specification.
Definition: Filter.h:29
double * m_filtScratchOut
Definition: DFProcess.h:69
double * LPBCoeffs
Definition: DFProcess.h:34
unsigned int length
Definition: DFProcess.h:31
Zero-phase digital filter, implemented by processing the data through a filter specified by the given...
Definition: FiltFilt.h:26
double * filtDst
Definition: DFProcess.h:66
unsigned int winPre
Definition: DFProcess.h:35
float m_Delta
Definition: DFProcess.h:76
float Delta
Definition: DFProcess.h:39
unsigned int winPost
Definition: DFProcess.h:36
unsigned int LPOrd
Definition: DFProcess.h:32
bool m_isMedianPositive
Definition: DFProcess.h:75
int m_FFOrd
Definition: DFProcess.h:58
double AlphaNormParam
Definition: DFProcess.h:37
int m_winPre
Definition: DFProcess.h:60
int m_length
Definition: DFProcess.h:57
FiltFilt * m_FiltFilt
Definition: DFProcess.h:73
double * m_filtScratchIn
Definition: DFProcess.h:68
double m_alphaNormParam
Definition: DFProcess.h:63
bool isMedianPositive
Definition: DFProcess.h:38
double * LPACoeffs
Definition: DFProcess.h:33
int m_winPost
Definition: DFProcess.h:61
FilterConfig m_FilterConfigParams
Definition: DFProcess.h:71