From 5cf2674681b3fd68c528eaeac57edf1ec94bee71 Mon Sep 17 00:00:00 2001 From: Tom Rondeau Date: Fri, 22 Jun 2012 14:13:27 -0400 Subject: filter: fix mmse_fir_interpolator QA code to initialize an aligned input buffer. --- gr-filter/lib/qa_mmse_fir_interpolator_cc.cc | 8 ++++---- gr-filter/lib/qa_mmse_fir_interpolator_ff.cc | 10 ++++++---- 2 files changed, 10 insertions(+), 8 deletions(-) (limited to 'gr-filter/lib') 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 #include #include +#include #include #include #include @@ -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 #include #include +#include #include #include 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 */ -- cgit