summaryrefslogtreecommitdiff
path: root/gr-filter
diff options
context:
space:
mode:
Diffstat (limited to 'gr-filter')
-rw-r--r--gr-filter/lib/qa_mmse_fir_interpolator_cc.cc8
-rw-r--r--gr-filter/lib/qa_mmse_fir_interpolator_ff.cc10
2 files changed, 10 insertions, 8 deletions
diff --git a/gr-filter/lib/qa_mmse_fir_interpolator_cc.cc b/gr-filter/lib/qa_mmse_fir_interpolator_cc.cc
index 02e0b32fe..268b8801c 100644
--- a/gr-filter/lib/qa_mmse_fir_interpolator_cc.cc
+++ b/gr-filter/lib/qa_mmse_fir_interpolator_cc.cc
@@ -27,6 +27,7 @@
#include <cppunit/TestAssert.h>
#include <qa_mmse_fir_interpolator_cc.h>
#include <filter/mmse_fir_interpolator_cc.h>
+#include <fft/fft.h>
#include <cstdio>
#include <cmath>
#include <stdexcept>
@@ -35,8 +36,6 @@
namespace gr {
namespace filter {
-#define NELEM(x) (sizeof(x) / sizeof(x[0]))
-
static float
test_fcn_sin(double index)
{
@@ -62,9 +61,9 @@ namespace gr {
qa_mmse_fir_interpolator_cc::t1()
{
static const unsigned N = 100;
- __GR_ATTR_ALIGNED(8) gr_complex input[N + 10];
+ gr_complex *input = fft::malloc_complex(N + 10);
- for(unsigned i = 0; i < NELEM(input); i++)
+ for(unsigned i = 0; i < N+10; i++)
input[i] = test_fcn((double) i);
mmse_fir_interpolator_cc intr;
@@ -79,6 +78,7 @@ namespace gr {
// printf ("%9.6f %9.6f %9.6f\n", expected, actual, expected - actual);
}
}
+ fft::free(input);
}
/*
diff --git a/gr-filter/lib/qa_mmse_fir_interpolator_ff.cc b/gr-filter/lib/qa_mmse_fir_interpolator_ff.cc
index 128b638b9..54387fd9b 100644
--- a/gr-filter/lib/qa_mmse_fir_interpolator_ff.cc
+++ b/gr-filter/lib/qa_mmse_fir_interpolator_ff.cc
@@ -27,14 +27,13 @@
#include <cppunit/TestAssert.h>
#include <qa_mmse_fir_interpolator_ff.h>
#include <filter/mmse_fir_interpolator_ff.h>
+#include <fft/fft.h>
#include <cstdio>
#include <cmath>
namespace gr {
namespace filter {
-#define NELEM(x) (sizeof(x) / sizeof(x[0]))
-
static float
test_fcn(double index)
{
@@ -45,10 +44,12 @@ namespace gr {
void
qa_mmse_fir_interpolator_ff::t1()
{
+ // use aligned malloc and make sure that everything in this
+ // buffer is properly initialized.
static const unsigned N = 100;
- float input[N + 10];
+ float *input = fft::malloc_float(N + 10);
- for(unsigned i = 0; i < NELEM(input); i++)
+ for(unsigned i = 0; i < N+10; i++)
input[i] = test_fcn((double) i);
mmse_fir_interpolator_ff intr;
@@ -63,6 +64,7 @@ namespace gr {
// printf ("%9.6f %9.6f %9.6f\n", expected, actual, expected - actual);
}
}
+ fft::free(input);
}
} /* namespace filter */