Merge branch 'no_usb_debug_windows'
authorTom Rondeau <trondeau@vt.edu>
Wed, 24 Nov 2010 00:44:58 +0000 (19:44 -0500)
committerTom Rondeau <trondeau@vt.edu>
Wed, 24 Nov 2010 00:44:58 +0000 (19:44 -0500)
17 files changed:
gnuradio-core/src/lib/filter/gr_pfb_channelizer_ccf.cc
gnuradio-core/src/lib/filter/gri_fir_filter_with_buffer_XXX.cc.t
gnuradio-core/src/lib/filter/gri_fir_filter_with_buffer_XXX.h.t
gnuradio-core/src/lib/filter/gri_fir_filter_with_buffer_ccf.h [deleted file]
gnuradio-core/src/lib/filter/qa_gri_fir_filter_with_buffer_ccc.cc
gnuradio-core/src/lib/filter/qa_gri_fir_filter_with_buffer_ccc.h
gnuradio-core/src/lib/filter/qa_gri_fir_filter_with_buffer_ccf.cc
gnuradio-core/src/lib/filter/qa_gri_fir_filter_with_buffer_ccf.h
gnuradio-core/src/lib/filter/qa_gri_fir_filter_with_buffer_fcc.cc
gnuradio-core/src/lib/filter/qa_gri_fir_filter_with_buffer_fcc.h
gnuradio-core/src/lib/filter/qa_gri_fir_filter_with_buffer_fff.cc
gnuradio-core/src/lib/filter/qa_gri_fir_filter_with_buffer_fff.h
gnuradio-core/src/lib/filter/qa_gri_fir_filter_with_buffer_fsf.cc
gnuradio-core/src/lib/filter/qa_gri_fir_filter_with_buffer_fsf.h
gnuradio-core/src/lib/filter/qa_gri_fir_filter_with_buffer_scc.cc
gnuradio-core/src/lib/filter/qa_gri_fir_filter_with_buffer_scc.h
gnuradio-core/src/lib/general/gr_fll_band_edge_cc.cc

index cb67b81040130225dfd9a9db3473256ae6767091..db16a634b773af6774a160d630795c8eee6b5918 100644 (file)
@@ -55,7 +55,6 @@ gr_pfb_channelizer_ccf::gr_pfb_channelizer_ccf (unsigned int numchans,
   // This tests the specified input sample rate to see if it conforms to this
   // requirement within a few significant figures.
   double intp = 0;
-  double x = (10000.0*rint(numchans / oversample_rate)) / 10000.0;
   double fltp = modf(numchans / oversample_rate, &intp);
   if(fltp != 0.0)
     throw std::invalid_argument("gr_pfb_channelizer: oversample rate must be N/i for i in [1, N]"); 
index c0d061c81773c51c9c3314aa6fde5cbc91c28aa6..1540688403c555c11cd4cf389dbfe5ff909eeaa7 100644 (file)
@@ -77,6 +77,26 @@ void
   return (@O_TYPE@)out;
 }
 
+@O_TYPE@
+@NAME@::filter (const @I_TYPE@ input[], unsigned long dec)
+{
+  unsigned int i;
+
+  for(i = 0; i < dec; i++) {
+    d_buffer[d_idx] = input[i];
+    d_buffer[d_idx+ntaps()] = input[i];
+    d_idx++;
+    if(d_idx >= ntaps())
+      d_idx = 0;
+  }
+
+  @ACC_TYPE@ out = 0;
+  for(i = 0; i < ntaps(); i++) {
+    out += @INPUT_CAST@ d_buffer[d_idx + i] * d_taps[i];
+  }
+  return (@O_TYPE@)out;
+}
+
 void
 @NAME@::filterN (@O_TYPE@ output[],
                 const @I_TYPE@ input[],
@@ -86,3 +106,16 @@ void
     output[i] = filter(input[i]);
   }
 }
+
+void
+@NAME@::filterNdec (@O_TYPE@ output[],
+                   const @I_TYPE@ input[],
+                   unsigned long n,
+                   unsigned long decimate)
+{
+  unsigned long j = 0;
+  for(unsigned long i = 0; i < n; i++) {
+    output[i] = filter(&input[j], decimate);
+    j += decimate;
+  }
+}
index d566b367465908aec6525ed2814dadf303221c94..23d64b65dd82ff12a0787e8c5c712c8c48785dd0 100644 (file)
@@ -69,13 +69,25 @@ public:
   /*!
    * \brief compute a single output value.
    *
-   * \p input must have ntaps() valid entries.
-   * input[0] .. input[ntaps() - 1] are referenced to compute the output value.
+   * \p input is a single input value of the filter type
    *
    * \returns the filtered input value.
    */
   @O_TYPE@ filter (@I_TYPE@ input);
 
+  
+  /*!
+   * \brief compute a single output value; designed for decimating filters.
+   *
+   * \p input is a single input value of the filter type. The value of dec is the
+   *    decimating value of the filter, so input[] must have dec valid values.
+   *    The filter pushes dec number of items onto the circ. buffer before computing
+   *    a single output.
+   *
+   * \returns the filtered input value.
+   */
+  @O_TYPE@ filter (const @I_TYPE@ input[], unsigned long dec);
+
   /*!
    * \brief compute an array of N output values.
    *
@@ -93,7 +105,7 @@ public:
    * compute the output values.
    */
   void filterNdec (@O_TYPE@ output[], const @I_TYPE@ input[],
-                  unsigned long n, unsigned decimate);
+                  unsigned long n, unsigned long decimate);
 
   /*!
    * \brief install \p new_taps as the current taps.
diff --git a/gnuradio-core/src/lib/filter/gri_fir_filter_with_buffer_ccf.h b/gnuradio-core/src/lib/filter/gri_fir_filter_with_buffer_ccf.h
deleted file mode 100644 (file)
index 2b69f8b..0000000
+++ /dev/null
@@ -1,119 +0,0 @@
-/* -*- c++ -*- */
-/*
- * Copyright 2010 Free Software Foundation, Inc.
- * 
- * This file is part of GNU Radio
- * 
- * GNU Radio is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 3, or (at your option)
- * any later version.
- * 
- * GNU Radio is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- * 
- * You should have received a copy of the GNU General Public License
- * along with GNU Radio; see the file COPYING.  If not, write to
- * the Free Software Foundation, Inc., 51 Franklin Street,
- * Boston, MA 02110-1301, USA.
- */
-
-/*
- * WARNING: This file is automatically generated by generate_gri_fir_XXX.py
- * Any changes made to this file will be overwritten.
- */
-
-
-#ifndef INCLUDED_GRI_FIR_FILTER_WITH_BUFFER_CCF_H
-#define INCLUDED_GRI_FIR_FILTER_WITH_BUFFER_CCF_H
-
-#include <vector>
-#include <gr_types.h>
-#include <gr_reverse.h>
-#include <string.h>
-#include <cstdio>
-
-/*!
- * \brief FIR with internal buffer for gr_complex input, 
-          gr_complex output and float taps
- * \ingroup filter
- * 
- */
-
-class gri_fir_filter_with_buffer_ccf {
-
-protected:
-  std::vector<float>   d_taps;         // reversed taps
-  gr_complex                     *d_buffer;
-  unsigned int                  d_idx;
-
-public:
-
-  // CONSTRUCTORS
-
-  /*!
-   * \brief construct new FIR with given taps.
-   *
-   * Note that taps must be in forward order, e.g., coefficient 0 is
-   * stored in new_taps[0], coefficient 1 is stored in
-   * new_taps[1], etc.
-   */
-  gri_fir_filter_with_buffer_ccf (const std::vector<float> &taps);
-
-  ~gri_fir_filter_with_buffer_ccf ();
-
-  // MANIPULATORS
-
-  /*!
-   * \brief compute a single output value.
-   *
-   * \p input must have ntaps() valid entries.
-   * input[0] .. input[ntaps() - 1] are referenced to compute the output value.
-   *
-   * \returns the filtered input value.
-   */
-  gr_complex filter (gr_complex input);
-
-  /*!
-   * \brief compute an array of N output values.
-   *
-   * \p input must have (n - 1 + ntaps()) valid entries.
-   * input[0] .. input[n - 1 + ntaps() - 1] are referenced to compute the output values.
-   */
-  void filterN (gr_complex output[], const gr_complex input[],
-               unsigned long n);
-
-  /*!
-   * \brief compute an array of N output values, decimating the input
-   *
-   * \p input must have (decimate * (n - 1) + ntaps()) valid entries.
-   * input[0] .. input[decimate * (n - 1) + ntaps() - 1] are referenced to 
-   * compute the output values.
-   */
-  void filterNdec (gr_complex output[], const gr_complex input[],
-                  unsigned long n, unsigned decimate);
-
-  /*!
-   * \brief install \p new_taps as the current taps.
-   */
-  void set_taps (const std::vector<float> &taps);
-
-  // ACCESSORS
-
-  /*!
-   * \return number of taps in filter.
-   */
-  unsigned ntaps () const { return d_taps.size (); }
-
-  /*!
-   * \return current taps
-   */
-  const std::vector<float> get_taps () const
-  {
-    return gr_reverse(d_taps);
-  }
-};
-
-#endif /* INCLUDED_GRI_FIR_FILTER_WITH_BUFFER_CCF_H */
index cff81ab13c0dec4824903b6f30674a53ffdc4e3a..e87d93ebff4ca641e32faf284ee04f0c1c5a6bc9 100644 (file)
@@ -73,14 +73,31 @@ ref_dotprod (const i_type input[], const tap_type taps[], int ntaps)
   return sum;
 }
 
+void
+qa_gri_fir_filter_with_buffer_ccc::t1 ()
+{
+  test_decimate(1);
+}
+
+void
+qa_gri_fir_filter_with_buffer_ccc::t2 ()
+{
+  test_decimate(2);
+}
+
+void
+qa_gri_fir_filter_with_buffer_ccc::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_ccc::t1 ()
+qa_gri_fir_filter_with_buffer_ccc::test_decimate(unsigned int decimate)
 {
   const int    MAX_TAPS        = 9;
   const int    OUTPUT_LEN      = 17;
@@ -107,11 +124,13 @@ qa_gri_fir_filter_with_buffer_ccc::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);
       }
 
@@ -121,7 +140,7 @@ qa_gri_fir_filter_with_buffer_ccc::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
       //
@@ -130,7 +149,7 @@ qa_gri_fir_filter_with_buffer_ccc::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);
       }
index 411a66a9aa8f36204450b27b4d10b9cd02fb0c92..f9f206f66425a24d607ae8c410a00cf0fa3c6fd7 100644 (file)
@@ -29,13 +29,16 @@ class qa_gri_fir_filter_with_buffer_ccc : public CppUnit::TestCase {
 
   CPPUNIT_TEST_SUITE (qa_gri_fir_filter_with_buffer_ccc);
   CPPUNIT_TEST (t1);
+  CPPUNIT_TEST (t2);
+  CPPUNIT_TEST (t3);
   CPPUNIT_TEST_SUITE_END ();
 
  private:
+  void test_decimate(unsigned int decimate);
 
   void t1 ();
-  // void t2 ();
-  // void t3 ();
+  void t2 ();
+  void t3 ();
 
 };
 
index f2e09db1cf0ae96d3d0839bda5914ae89dfa0663..c25853b1e40c8cb392cdd37fa5c10ed44b1e8c47 100644 (file)
@@ -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_ccf::t1 ()
+{
+  test_decimate(1);
+}
+
+void
+qa_gri_fir_filter_with_buffer_ccf::t2 ()
+{
+  test_decimate(2);
+}
+
+void
+qa_gri_fir_filter_with_buffer_ccf::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_ccf::t1 ()  
+qa_gri_fir_filter_with_buffer_ccf::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_ccf::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_ccf::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_ccf::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);
       }
index b80be70a79f896fd20d38a719eb2e56ba6c3e321..924b4bc2e53e2afdadbb5aab4e9faf6fa5cbf53d 100644 (file)
@@ -29,13 +29,16 @@ class qa_gri_fir_filter_with_buffer_ccf : public CppUnit::TestCase {
 
   CPPUNIT_TEST_SUITE (qa_gri_fir_filter_with_buffer_ccf);
   CPPUNIT_TEST (t1);
+  CPPUNIT_TEST (t2);
+  CPPUNIT_TEST (t3);
   CPPUNIT_TEST_SUITE_END ();
 
  private:
+  void test_decimate(unsigned int decimate);
 
   void t1 ();
-  // void t2 ();
-  // void t3 ();
+  void t2 ();
+  void t3 ();
 
 };
 
index de0da9f1ca9557ac3c06c92fc38a879af3adec0c..19f270200dfd377b006a1c81134f0eec764fe8f7 100644 (file)
@@ -80,14 +80,32 @@ ref_dotprod (const i_type input[], const tap_type taps[], int ntaps)
   return sum;
 }
 
+void
+qa_gri_fir_filter_with_buffer_fcc::t1()
+{
+  test_decimate(1);
+}
+
+void
+qa_gri_fir_filter_with_buffer_fcc::t2()
+{
+  test_decimate(2);
+}
+
+void
+qa_gri_fir_filter_with_buffer_fcc::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_fcc::t1 ()
+qa_gri_fir_filter_with_buffer_fcc::test_decimate(unsigned int decimate)
 {
   const int    MAX_TAPS        = 9;
   const int    OUTPUT_LEN      = 17;
@@ -114,11 +132,13 @@ qa_gri_fir_filter_with_buffer_fcc::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 +148,7 @@ qa_gri_fir_filter_with_buffer_fcc::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 +157,7 @@ qa_gri_fir_filter_with_buffer_fcc::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);
       }
index 81b39f4884725634c18467fdb87c9b3ebc06fae0..6201800f9deb8c7e802b27f05a8e28d59ab2c233 100644 (file)
@@ -29,13 +29,16 @@ class qa_gri_fir_filter_with_buffer_fcc : public CppUnit::TestCase {
 
   CPPUNIT_TEST_SUITE (qa_gri_fir_filter_with_buffer_fcc);
   CPPUNIT_TEST (t1);
+  CPPUNIT_TEST (t2);
+  CPPUNIT_TEST (t3);
   CPPUNIT_TEST_SUITE_END ();
 
  private:
+  void test_decimate(unsigned int decimate);
 
   void t1 ();
-  // void t2 ();
-  // void t3 ();
+  void t2 ();
+  void t3 ();
 
 };
 
index ce689a54bbbd9cc0cbbf5ffec4e46dc7335e0e24..8401e484bf79828fe5746521289ee7ea4058ff40 100644 (file)
@@ -69,14 +69,31 @@ ref_dotprod (const i_type input[], const tap_type taps[], int ntaps)
   return sum;
 }
 
+void
+qa_gri_fir_filter_with_buffer_fff::t1 ()  
+{
+  test_decimate(1);
+}
+
+void
+qa_gri_fir_filter_with_buffer_fff::t2 ()
+{
+  test_decimate(2);
+}
+
+void
+qa_gri_fir_filter_with_buffer_fff::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_fff::t1 ()  
+qa_gri_fir_filter_with_buffer_fff::test_decimate(unsigned int decimate)
 {
   const int    MAX_TAPS        = 9;
   const int    OUTPUT_LEN      = 17;
@@ -103,11 +120,13 @@ qa_gri_fir_filter_with_buffer_fff::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);
       }
 
@@ -117,7 +136,7 @@ qa_gri_fir_filter_with_buffer_fff::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
       //
@@ -126,7 +145,7 @@ qa_gri_fir_filter_with_buffer_fff::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_DOUBLES_EQUAL(expected_output[o], actual_output[o],
                                     fabsf (expected_output[o]) * ERR_DELTA);
       }
index 5bb6c3e937ae71943b54eb9f008291deadae9bc2..54a9cdc53a46fcc34f86f0fd79f23616e6c2035f 100644 (file)
@@ -29,13 +29,16 @@ class qa_gri_fir_filter_with_buffer_fff : public CppUnit::TestCase {
 
   CPPUNIT_TEST_SUITE (qa_gri_fir_filter_with_buffer_fff);
   CPPUNIT_TEST (t1);
+  CPPUNIT_TEST (t2);
+  CPPUNIT_TEST (t3);
   CPPUNIT_TEST_SUITE_END ();
 
  private:
+  void test_decimate(unsigned int decimate);
 
   void t1 ();
-  // void t2 ();
-  // void t3 ();
+  void t2 ();
+  void t3 ();
 
 };
 
index f09a1d7ac6eb02be7df0806ac99de9df1a3a6edb..091505380cf2de00142c964519498882922204b5 100644 (file)
@@ -67,14 +67,31 @@ ref_dotprod (const i_type input[], const tap_type taps[], int ntaps)
   return (o_type)sum;
 }
 
+void
+qa_gri_fir_filter_with_buffer_fsf::t1 ()
+{
+  test_decimate(1);
+}
+
+void
+qa_gri_fir_filter_with_buffer_fsf::t2 ()
+{
+  test_decimate(2);
+}
+
+void
+qa_gri_fir_filter_with_buffer_fsf::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_fsf::t1 ()  
+qa_gri_fir_filter_with_buffer_fsf::test_decimate (unsigned int decimate)  
 {
   const int    MAX_TAPS        = 9;
   const int    OUTPUT_LEN      = 17;
@@ -101,11 +118,13 @@ qa_gri_fir_filter_with_buffer_fsf::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);
       }
 
@@ -115,10 +134,10 @@ qa_gri_fir_filter_with_buffer_fsf::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
-      for (int o = 0; o < ol; o++){
+      for (int o = 0; o < (int)(ol/decimate); o++){
        CPPUNIT_ASSERT_EQUAL(expected_output[o], actual_output[o]);
       }
       delete f1;
index 38899b35208d9f0200cb5512151ed3485e2d9f0f..9c901464ed7b8c474843636ca0f62dcf5317f3d3 100644 (file)
@@ -29,13 +29,16 @@ class qa_gri_fir_filter_with_buffer_fsf : public CppUnit::TestCase {
 
   CPPUNIT_TEST_SUITE (qa_gri_fir_filter_with_buffer_fsf);
   CPPUNIT_TEST (t1);
+  CPPUNIT_TEST (t2);
+  CPPUNIT_TEST (t3);
   CPPUNIT_TEST_SUITE_END ();
 
  private:
-
+  void test_decimate(unsigned int decimate);
+  
   void t1 ();
-  // void t2 ();
-  // void t3 ();
+  void t2 ();
+  void t3 ();
 
 };
 
index 4ba433ebfd7c27116a2ba735586c47e9454b4bad..03cd7102232ccf4ffb09cd2fa6aaec35186f1eda 100644 (file)
@@ -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);
       }
index fd9fe5b767faef38c60fb0d99dcaa6b888cd1083..970ca3749834a91efdb6680d957970d2121b4e99 100644 (file)
@@ -29,13 +29,16 @@ class qa_gri_fir_filter_with_buffer_scc : public CppUnit::TestCase {
 
   CPPUNIT_TEST_SUITE (qa_gri_fir_filter_with_buffer_scc);
   CPPUNIT_TEST (t1);
+  CPPUNIT_TEST (t2);
+  CPPUNIT_TEST (t3);
   CPPUNIT_TEST_SUITE_END ();
 
  private:
+  void test_decimate(unsigned int decimate);
 
   void t1 ();
-  // void t2 ();
-  // void t3 ();
+  void t2 ();
+  void t3 ();
 
 };
 
index ff997e7a978fd78f14e53d7b2355a1597631a342..c32398e6d55ca2e29c16484d29a0c8b487db5a42 100644 (file)
@@ -161,8 +161,9 @@ gr_fll_band_edge_cc::work (int noutput_items,
   const gr_complex *in  = (const gr_complex *) input_items[0];
   gr_complex *out = (gr_complex *) output_items[0];
 
-  float *frq, *phs;
-  gr_complex *err;
+  float *frq = NULL;
+  float *phs = NULL;
+  gr_complex *err = NULL;
   if(output_items.size() > 2) {
     frq = (float *) output_items[1];
     phs = (float *) output_items[2];