X-Git-Url: https://git.gag.com/?a=blobdiff_plain;f=gnuradio-core%2Fsrc%2Flib%2Ffilter%2Fqa_gri_fir_filter_with_buffer_fsf.cc;h=f09a1d7ac6eb02be7df0806ac99de9df1a3a6edb;hb=b9cbe9c9ca65b620cab9bf1b8e652637a885d3c2;hp=1dc869ef768502d759674240669fbe7c2c999047;hpb=4a3fb7eb7481177ae35bb98307a1845a7304d97e;p=debian%2Fgnuradio diff --git a/gnuradio-core/src/lib/filter/qa_gri_fir_filter_with_buffer_fsf.cc b/gnuradio-core/src/lib/filter/qa_gri_fir_filter_with_buffer_fsf.cc index 1dc869ef..f09a1d7a 100644 --- a/gnuradio-core/src/lib/filter/qa_gri_fir_filter_with_buffer_fsf.cc +++ b/gnuradio-core/src/lib/filter/qa_gri_fir_filter_with_buffer_fsf.cc @@ -38,12 +38,10 @@ typedef float i_type; typedef short o_type; typedef float tap_type; -typedef int acc_type; +typedef float acc_type; using std::vector; -#define ERR_DELTA (1e-5) - #define NELEM(x) (sizeof (x) / sizeof (x[0])) static float @@ -56,7 +54,7 @@ static void random_floats (float *buf, unsigned n) { for (unsigned i = 0; i < n; i++) - buf[i] = (float) rint (uniform () * 32767); + buf[i] = (float) rint (uniform () * 128); } static o_type @@ -66,8 +64,7 @@ ref_dotprod (const i_type input[], const tap_type taps[], int ntaps) for (int i = 0; i < ntaps; i++) { sum += input[i] * taps[i]; } - - return sum; + return (o_type)sum; } // @@ -121,15 +118,8 @@ qa_gri_fir_filter_with_buffer_fsf::t1 () f1->filterN (actual_output, input, ol); // check results - // - // we use a sloppy error margin because on the x86 architecture, - // our reference implementation is using 80 bit floating point - // arithmetic, while the SSE version is using 32 bit float point - // arithmetic. - for (int o = 0; o < ol; o++){ - CPPUNIT_ASSERT_DOUBLES_EQUAL(expected_output[o], actual_output[o], - abs (expected_output[o]) * ERR_DELTA); + CPPUNIT_ASSERT_EQUAL(expected_output[o], actual_output[o]); } delete f1; }