X-Git-Url: https://git.gag.com/?a=blobdiff_plain;f=gnuradio-core%2Fsrc%2Flib%2Ffilter%2Fqa_gri_fir_filter_with_buffer_scc.cc;h=03cd7102232ccf4ffb09cd2fa6aaec35186f1eda;hb=1d63a52520ebdac7242784eafa79093b7fc2710d;hp=4ba433ebfd7c27116a2ba735586c47e9454b4bad;hpb=0b9812f61b854591ec7b0f77214c3078bd5c3464;p=debian%2Fgnuradio diff --git a/gnuradio-core/src/lib/filter/qa_gri_fir_filter_with_buffer_scc.cc b/gnuradio-core/src/lib/filter/qa_gri_fir_filter_with_buffer_scc.cc index 4ba433eb..03cd7102 100644 --- a/gnuradio-core/src/lib/filter/qa_gri_fir_filter_with_buffer_scc.cc +++ b/gnuradio-core/src/lib/filter/qa_gri_fir_filter_with_buffer_scc.cc @@ -80,14 +80,31 @@ ref_dotprod (const i_type input[], const tap_type taps[], int ntaps) return sum; } +void +qa_gri_fir_filter_with_buffer_scc::t1 () +{ + test_decimate(1); +} + +void +qa_gri_fir_filter_with_buffer_scc::t2 () +{ + test_decimate(2); +} + +void +qa_gri_fir_filter_with_buffer_scc::t3 () +{ + test_decimate(5); +} + // // Test for ntaps in [0,9], and input lengths in [0,17]. // This ensures that we are building the shifted taps correctly, // and exercises all corner cases on input alignment and length. // - void -qa_gri_fir_filter_with_buffer_scc::t1 () +qa_gri_fir_filter_with_buffer_scc::test_decimate (unsigned int decimate) { const int MAX_TAPS = 9; const int OUTPUT_LEN = 17; @@ -114,11 +131,13 @@ qa_gri_fir_filter_with_buffer_scc::t1 () // compute expected output values memset(dline, 0, INPUT_LEN*sizeof(i_type)); - for (int o = 0; o < ol; o++){ + for (int o = 0; o < (int)(ol/decimate); o++){ // use an actual delay line for this test - for(int oo = INPUT_LEN-1; oo > 0; oo--) - dline[oo] = dline[oo-1]; - dline[0] = input[o]; + for(int dd = 0; dd < (int)decimate; dd++) { + for(int oo = INPUT_LEN-1; oo > 0; oo--) + dline[oo] = dline[oo-1]; + dline[0] = input[decimate*o+dd]; + } expected_output[o] = ref_dotprod (dline, taps, n); } @@ -128,7 +147,7 @@ qa_gri_fir_filter_with_buffer_scc::t1 () // zero the output, then do the filtering memset (actual_output, 0, sizeof (actual_output)); - f1->filterN (actual_output, input, ol); + f1->filterNdec (actual_output, input, ol/decimate, decimate); // check results // @@ -137,7 +156,7 @@ qa_gri_fir_filter_with_buffer_scc::t1 () // arithmetic, while the SSE version is using 32 bit float point // arithmetic. - for (int o = 0; o < ol; o++){ + for (int o = 0; o < (int)(ol/decimate); o++){ CPPUNIT_ASSERT_COMPLEXES_EQUAL(expected_output[o], actual_output[o], abs (expected_output[o]) * ERR_DELTA); }