Ardour  9.0-pre0-582-g084a23a80d
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 #pragma once
22 
23 #include <stddef.h>
24 
26 
28 {
29 public:
30  MTDM (int fsamp);
31  int process (size_t len, float* inp, float* out);
32  int resolve (void);
33 
34  int inv (void) const { return _inv; }
35  double del (void) const { return _del; }
36  double err (void) const { return _err; }
37 
38  void invert (void)
39  {
40  _inv ^= 1;
41  }
42 
43  float get_peak ()
44  {
45  const float rv = _peak;
46  _peak = 0;
47  return rv;
48  }
49 
50 private:
51  class Freq
52  {
53  public:
54  int p;
55  int f;
56  float xa;
57  float ya;
58  float x1;
59  float y1;
60  float x2;
61  float y2;
62  };
63 
64  double _del;
65  double _err;
66  float _wlp;
67  int _cnt;
68  int _inv;
69  Freq _freq[13];
70  float _peak;
71 };
72 
float x2
Definition: mtdm.h:60
float x1
Definition: mtdm.h:58
int f
Definition: mtdm.h:55
float y1
Definition: mtdm.h:59
float y2
Definition: mtdm.h:61
float xa
Definition: mtdm.h:56
float ya
Definition: mtdm.h:57
int p
Definition: mtdm.h:54
Definition: mtdm.h:28
int inv(void) const
Definition: mtdm.h:34
int _cnt
Definition: mtdm.h:67
MTDM(int fsamp)
float get_peak()
Definition: mtdm.h:43
int _inv
Definition: mtdm.h:68
double _err
Definition: mtdm.h:65
float _wlp
Definition: mtdm.h:66
double err(void) const
Definition: mtdm.h:36
double _del
Definition: mtdm.h:64
int process(size_t len, float *inp, float *out)
double del(void) const
Definition: mtdm.h:35
void invert(void)
Definition: mtdm.h:38
int resolve(void)
float _peak
Definition: mtdm.h:70
#define LIBARDOUR_API