Ardour  8.12
mtdm.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2003-2012 Fons Adriaensen <fons@kokkinizita.net>
3  * Copyright (C) 2009-2012 David Robillard <d@drobilla.net>
4  * Copyright (C) 2009-2013 Paul Davis <paul@linuxaudiosystems.com>
5  *
6  * This program is free software; you can redistribute it and/or modify
7  * it under the terms of the GNU General Public License as published by
8  * the Free Software Foundation; either version 2 of the License, or
9  * (at your option) any later version.
10  *
11  * This program is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14  * GNU General Public License for more details.
15  *
16  * You should have received a copy of the GNU General Public License along
17  * with this program; if not, write to the Free Software Foundation, Inc.,
18  * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
19  */
20 
21 #ifndef __libardour_mtdm_h__
22 #define __libardour_mtdm_h__
23 
24 #include <stddef.h>
25 
27 
29 {
30 public:
31  MTDM (int fsamp);
32  int process (size_t len, float* inp, float* out);
33  int resolve (void);
34 
35  int inv (void) const { return _inv; }
36  double del (void) const { return _del; }
37  double err (void) const { return _err; }
38 
39  void invert (void)
40  {
41  _inv ^= 1;
42  }
43 
44  float get_peak ()
45  {
46  const float rv = _peak;
47  _peak = 0;
48  return rv;
49  }
50 
51 private:
52  class Freq
53  {
54  public:
55  int p;
56  int f;
57  float xa;
58  float ya;
59  float x1;
60  float y1;
61  float x2;
62  float y2;
63  };
64 
65  double _del;
66  double _err;
67  float _wlp;
68  int _cnt;
69  int _inv;
70  Freq _freq[13];
71  float _peak;
72 };
73 
74 #endif /* __libardour_mtdm_h__ */
float x2
Definition: mtdm.h:61
float x1
Definition: mtdm.h:59
int f
Definition: mtdm.h:56
float y1
Definition: mtdm.h:60
float y2
Definition: mtdm.h:62
float xa
Definition: mtdm.h:57
float ya
Definition: mtdm.h:58
int p
Definition: mtdm.h:55
Definition: mtdm.h:29
int inv(void) const
Definition: mtdm.h:35
int _cnt
Definition: mtdm.h:68
MTDM(int fsamp)
float get_peak()
Definition: mtdm.h:44
int _inv
Definition: mtdm.h:69
double _err
Definition: mtdm.h:66
float _wlp
Definition: mtdm.h:67
double err(void) const
Definition: mtdm.h:37
double _del
Definition: mtdm.h:65
int process(size_t len, float *inp, float *out)
double del(void) const
Definition: mtdm.h:36
void invert(void)
Definition: mtdm.h:39
int resolve(void)
float _peak
Definition: mtdm.h:71
#define LIBARDOUR_API