diff options
author | Tom Rondeau <trondeau@vt.edu> | 2012-06-22 14:13:27 -0400 |
---|---|---|
committer | Tom Rondeau <trondeau@vt.edu> | 2012-06-22 14:13:27 -0400 |
commit | 5cf2674681b3fd68c528eaeac57edf1ec94bee71 (patch) | |
tree | 25cdcecb1be83e09f9bdf5b3368bdef4878300eb | |
parent | 92c374e217f90a874b34945c83a4552145c7c3eb (diff) |
filter: fix mmse_fir_interpolator QA code to initialize an aligned input buffer.
-rw-r--r-- | gr-filter/lib/qa_mmse_fir_interpolator_cc.cc | 8 | ||||
-rw-r--r-- | gr-filter/lib/qa_mmse_fir_interpolator_ff.cc | 10 |
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 02e0b32fe4..268b8801cc 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 128b638b97..54387fd9bd 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 */ |