3af80743f5f1219de7205ffb4e1ebfca89c278c0
[ardour.git] / libs / qm-dsp / dsp / signalconditioning / DFProcess.h
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     This program is free software; you can redistribute it and/or
10     modify it under the terms of the GNU General Public License as
11     published by the Free Software Foundation; either version 2 of the
12     License, or (at your option) any later version.  See the file
13     COPYING included with this distribution for more information.
14 */
15
16 #ifndef CDFPROCESS_H
17 #define CDFPROCESS_H
18
19 #include <stdio.h>
20 #include "FiltFilt.h"
21
22 struct DFProcConfig{
23     unsigned int length;
24     unsigned int LPOrd;
25     double *LPACoeffs;
26     double *LPBCoeffs;
27     unsigned int winPre;
28     unsigned int winPost;
29     double AlphaNormParam;
30     bool isMedianPositive;
31 };
32
33 class DFProcess
34 {
35 public:
36     DFProcess( DFProcConfig Config );
37     virtual ~DFProcess();
38
39     void process( double* src, double* dst );
40
41         
42 private:
43     void initialise( DFProcConfig Config );
44     void deInitialise();
45     void removeDCNormalize( double *src, double*dst );
46     void medianFilter( double* src, double* dst );
47
48     int m_length;
49     int m_FFOrd;
50
51     int m_winPre;
52     int m_winPost;
53
54     double m_alphaNormParam;
55
56     double* filtSrc;
57     double* filtDst;
58
59     double* m_filtScratchIn;
60     double* m_filtScratchOut;
61
62     FiltFiltConfig m_FilterConfigParams;
63
64     FiltFilt* m_FiltFilt;
65
66     bool m_isMedianPositive;
67 };
68
69 #endif