ardour
mtdm_test.cc
Go to the documentation of this file.
1 #include <cstring>
2 #include <cmath>
3 #include "ardour/mtdm.h"
4 #include "mtdm_test.h"
5 
7 
8 using namespace std;
9 
10 void
12 {
13  float in[256];
14  float out[256];
15 
16  memset (in, 0, 256 * sizeof (float));
17  MTDM* mtdm = new MTDM (44100);
18 
19  // initialization, need at least 3 cycles
20  // to allow resolution below error limit.
21  for (int i = 0; i < 4; ++i) {
22  mtdm->process (256, in, out);
23  memcpy (in, out, 256 * sizeof (float));
24  }
25 
26  for (int i = 0; i < 64; ++i) {
27  mtdm->process (256, in, out);
28  memcpy (in, out, 256 * sizeof (float));
29 
30  CPPUNIT_ASSERT_EQUAL (0, mtdm->resolve ());
31  CPPUNIT_ASSERT (mtdm->err() < 1);
32  CPPUNIT_ASSERT_EQUAL (256.0, rint (mtdm->del()));
33  }
34 }
double del(void)
Definition: mtdm.h:35
Definition: mtdm.h:26
double err(void)
Definition: mtdm.h:36
int process(size_t len, float *inp, float *out)
Definition: mtdm.cc:54
Definition: Beats.hpp:239
CPPUNIT_TEST_SUITE_REGISTRATION(MTDMTest)
int resolve(void)
Definition: mtdm.cc:93
void basicTest()
Definition: mtdm_test.cc:11