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 QM_DSP_DFPROCESS_H
25 #define QM_DSP_DFPROCESS_H
26 
27 #include "FiltFilt.h"
28 
29 #include <stdio.h>
30 
32 {
33  int length;
34  int LPOrd;
35  double *LPACoeffs;
36  double *LPBCoeffs;
37  int winPre;
38  int winPost;
41  float delta; //delta threshold used as an offset when computing the smoothed detection function
42 
44  length(0),
45  LPOrd(0),
46  LPACoeffs(NULL),
47  LPBCoeffs(NULL),
48  winPre(0),
49  winPost(0),
50  AlphaNormParam(0),
51  isMedianPositive(false),
52  delta(0)
53  {
54  }
55 };
56 
57 class DFProcess
58 {
59 public:
60  DFProcess( DFProcConfig Config );
61  virtual ~DFProcess();
62 
63  void process( double* src, double* dst );
64 
65 private:
66  void initialise( DFProcConfig Config );
67  void deInitialise();
68  void removeDCNormalize( double *src, double*dst );
69  void medianFilter( double* src, double* dst );
70 
71  int m_length;
72  int m_FFOrd;
73 
74  int m_winPre;
75  int m_winPost;
76 
78 
79  double* filtSrc;
80  double* filtDst;
81 
82  double* m_filtScratchIn;
84 
86 
88  float m_delta; //add delta threshold
89 };
90 
91 #endif
double * filtSrc
Definition: DFProcess.h:79
double * m_filtScratchOut
Definition: DFProcess.h:83
double * LPBCoeffs
Definition: DFProcess.h:36
Zero-phase digital filter, implemented by processing the data through a filter specified by the given...
Definition: FiltFilt.h:25
double * filtDst
Definition: DFProcess.h:80
float m_delta
Definition: DFProcess.h:88
bool m_isMedianPositive
Definition: DFProcess.h:87
int m_FFOrd
Definition: DFProcess.h:72
double AlphaNormParam
Definition: DFProcess.h:39
int m_winPre
Definition: DFProcess.h:74
int m_length
Definition: DFProcess.h:71
FiltFilt * m_FiltFilt
Definition: DFProcess.h:85
double * m_filtScratchIn
Definition: DFProcess.h:82
float delta
Definition: DFProcess.h:41
double m_alphaNormParam
Definition: DFProcess.h:77
bool isMedianPositive
Definition: DFProcess.h:40
double * LPACoeffs
Definition: DFProcess.h:35
int m_winPost
Definition: DFProcess.h:75