Ardour  9.0-pre0-582-g084a23a80d
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 
42  length(0),
43  LPOrd(0),
44  LPACoeffs(NULL),
45  LPBCoeffs(NULL),
46  winPre(0),
47  winPost(0),
48  AlphaNormParam(0),
49  isMedianPositive(false),
50  delta(0)
51  {
52  }
53 };
54 
55 class DFProcess
56 {
57 public:
59  virtual ~DFProcess();
60 
61  void process( double* src, double* dst );
62 
63 
64 private:
66  void deInitialise();
67  void removeDCNormalize( double *src, double*dst );
68  void medianFilter( double* src, double* dst );
69 
70  int m_length;
71  int m_FFOrd;
72 
73  int m_winPre;
74  int m_winPost;
75 
77 
78  double* filtSrc;
79  double* filtDst;
80 
81  double* m_filtScratchIn;
83 
85 
87  float m_delta; //add delta threshold
88 };
89 
90 #endif
int m_winPost
Definition: DFProcess.h:74
int m_winPre
Definition: DFProcess.h:73
int m_FFOrd
Definition: DFProcess.h:71
FiltFilt * m_FiltFilt
Definition: DFProcess.h:84
int m_length
Definition: DFProcess.h:70
virtual ~DFProcess()
bool m_isMedianPositive
Definition: DFProcess.h:86
double * m_filtScratchIn
Definition: DFProcess.h:81
DFProcess(DFProcConfig Config)
void removeDCNormalize(double *src, double *dst)
void medianFilter(double *src, double *dst)
void initialise(DFProcConfig Config)
void deInitialise()
float m_delta
Definition: DFProcess.h:87
double * filtSrc
Definition: DFProcess.h:78
double * m_filtScratchOut
Definition: DFProcess.h:82
void process(double *src, double *dst)
double * filtDst
Definition: DFProcess.h:79
double m_alphaNormParam
Definition: DFProcess.h:76
RCConfiguration * Config
unsigned int length
Definition: DFProcess.h:31
double * LPBCoeffs
Definition: DFProcess.h:34
unsigned int winPost
Definition: DFProcess.h:36
double * LPACoeffs
Definition: DFProcess.h:33
float delta
Definition: DFProcess.h:39
unsigned int LPOrd
Definition: DFProcess.h:32
bool isMedianPositive
Definition: DFProcess.h:38
unsigned int winPre
Definition: DFProcess.h:35
double AlphaNormParam
Definition: DFProcess.h:37