commit-gnuradio
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Commit-gnuradio] [gnuradio] 01/06: filter: Adding filterbank_vcvcf, a f


From: git
Subject: [Commit-gnuradio] [gnuradio] 01/06: filter: Adding filterbank_vcvcf, a filterbank where all taps are explicitly set.
Date: Mon, 31 Mar 2014 20:27:42 +0000 (UTC)

This is an automated email from the git hooks/post-receive script.

jcorgan pushed a commit to branch master
in repository gnuradio.

commit 5471da3912fe8d0da025028c8bb01c3ca9f53969
Author: Ben Reynwar <address@hidden>
Date:   Wed Mar 26 17:47:28 2014 -0700

    filter: Adding filterbank_vcvcf, a filterbank where all taps are explicitly 
set.
---
 gr-filter/include/gnuradio/filter/CMakeLists.txt   |   2 +
 gr-filter/include/gnuradio/filter/filterbank.h     |  97 +++++++++++++++
 .../include/gnuradio/filter/filterbank_vcvcf.h     |  76 ++++++++++++
 gr-filter/lib/CMakeLists.txt                       |   2 +
 gr-filter/lib/filterbank.cc                        | 111 ++++++++++++++++++
 gr-filter/lib/filterbank_vcvcf_impl.cc             | 125 ++++++++++++++++++++
 gr-filter/lib/filterbank_vcvcf_impl.h              |  57 +++++++++
 gr-filter/python/filter/qa_filterbank.py           | 130 +++++++++++++++++++++
 gr-filter/swig/filter_swig.i                       |   5 +-
 9 files changed, 604 insertions(+), 1 deletion(-)

diff --git a/gr-filter/include/gnuradio/filter/CMakeLists.txt 
b/gr-filter/include/gnuradio/filter/CMakeLists.txt
index 9dbc227..f9cb933 100644
--- a/gr-filter/include/gnuradio/filter/CMakeLists.txt
+++ b/gr-filter/include/gnuradio/filter/CMakeLists.txt
@@ -89,6 +89,8 @@ install(FILES
     mmse_fir_interpolator_ff.h
     pm_remez.h
     polyphase_filterbank.h
+    filterbank.h
+    filterbank_ccf.h
     single_pole_iir.h
     dc_blocker_cc.h
     dc_blocker_ff.h
diff --git a/gr-filter/include/gnuradio/filter/filterbank.h 
b/gr-filter/include/gnuradio/filter/filterbank.h
new file mode 100644
index 0000000..f71d6c9
--- /dev/null
+++ b/gr-filter/include/gnuradio/filter/filterbank.h
@@ -0,0 +1,97 @@
+/* -*- c++ -*- */
+/*
+ * Copyright 2012, 2014 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.
+ */
+
+
+#ifndef INCLUDED_FILTER_FILTERBANK_H
+#define        INCLUDED_FILTER_FILTERBANK_H
+
+#include <gnuradio/filter/api.h>
+#include <gnuradio/filter/fir_filter.h>
+
+namespace gr {
+  namespace filter {
+    namespace kernel {
+      
+      /*!
+       * \brief A filter bank with generic taps.
+       *
+       * This block takes in a vector of N complex inputs, passes
+       * them through N FIR filters, and outputs a vector of N complex
+       * outputs.
+       *
+       * The only advantage of using this block over N individual
+       * FIR filter blocks is that it places less of a load on the 
+       * scheduler.
+       *
+       * The number of filters cannot be changed dynamically, however
+       * filters can be deactivated (i.e. no processing is done for
+       * them) by passing a vector of filter taps containing all zeros
+       * to them.  In this case their entry in the output vector is a
+       * zero.
+       *
+       */
+
+      class FILTER_API filterbank
+      {
+      protected:
+        unsigned int d_nfilts;
+        unsigned int d_ntaps;
+        std::vector<kernel::fir_filter_ccf*> d_fir_filters;
+        std::vector< std::vector<float> > d_taps;
+        std::vector<bool> d_active;
+        unsigned int d_taps_per_filter;
+        
+      public:
+        /*!
+         * Build the filterbank.
+         *
+         * \param taps (vector of vector of floats / list of list of floats)
+         *             Populates the filters.
+         */
+        filterbank(const std::vector<std::vector<float> > &taps);
+          
+        ~filterbank();
+
+        /*!
+         * Update the filterbank's filter taps.
+         *
+         * \param taps (vector of vector of floats / list of list of floats)
+         *             The prototype filter to populate the filterbank.
+         */
+        virtual void set_taps(const std::vector<std::vector<float> > &taps);
+
+        /*!
+         * Print all of the filterbank taps to screen.
+         */
+        void print_taps();
+
+        /*!
+         * Return a vector<vector<>> of the filterbank taps
+         */
+        std::vector<std::vector<float> > taps() const;
+      };
+      
+    } /* namespace kernel */
+  } /* namespace filter */
+} /* namespace gr */
+
+#endif /* INCLUDED_FILTER_FILTERBANK_H */
diff --git a/gr-filter/include/gnuradio/filter/filterbank_vcvcf.h 
b/gr-filter/include/gnuradio/filter/filterbank_vcvcf.h
new file mode 100644
index 0000000..dfacc24
--- /dev/null
+++ b/gr-filter/include/gnuradio/filter/filterbank_vcvcf.h
@@ -0,0 +1,76 @@
+/* -*- c++ -*- */
+/*
+ * Copyright 2009,2010,2012,2014 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.
+ */
+
+
+#ifndef INCLUDED_FILTER_FILTERBANK_CHANNELIZER_VCVCF_H
+#define        INCLUDED_FILTER_FILTERBANK_CHANNELIZER_VCVCF_H
+
+#include <gnuradio/filter/api.h>
+#include <gnuradio/block.h>
+
+namespace gr {
+  namespace filter {
+
+    /*!
+     * \brief Filterbank with vector of gr_complex input,
+     * vector of gr_complex output and float taps
+     * \ingroup filter_blk
+     *
+     * \details
+     * This block takes in complex vectors and outputs complex vectors of the 
same
+     * size.  Vectors of length N, rather than N normal streams are used to 
reduce
+     * overhead.
+     */
+    class FILTER_API filterbank_vcvcf : virtual public block
+    {
+    public:
+      typedef boost::shared_ptr<filterbank_vcvcf> sptr;
+
+      /*!
+       * Build the filterbank.
+       * \param taps (vector of vector of floats/list of list of floats)
+       *             Used to populate the filters.
+       */
+      static sptr make(const std::vector< std::vector<float> > &taps);
+
+      /*!
+       * Resets the filterbank's filter taps with the new prototype filter
+       * \param taps (vector/list of floats) The prototype filter to populate 
the filterbank.
+       */
+      virtual void set_taps(const std::vector< std::vector<float> > &taps) = 0;
+
+      /*!
+       * Print all of the filterbank taps to screen.
+       */
+      virtual void print_taps() = 0;
+
+      /*!
+       * Return a vector<vector<>> of the filterbank taps
+       */
+      virtual std::vector<std::vector<float> > taps() const = 0;
+
+    };
+
+  } /* namespace filter */
+} /* namespace gr */
+
+#endif /* INCLUDED_FILTER_PFB_CHANNELIZER_VCVCF_H */
diff --git a/gr-filter/lib/CMakeLists.txt b/gr-filter/lib/CMakeLists.txt
index 9889a4d..be787bd 100644
--- a/gr-filter/lib/CMakeLists.txt
+++ b/gr-filter/lib/CMakeLists.txt
@@ -127,6 +127,8 @@ list(APPEND filter_sources
   dc_blocker_cc_impl.cc
   dc_blocker_ff_impl.cc
   filter_delay_fc_impl.cc
+  filterbank.cc
+  filterbank_vcvcf_impl.cc
   fft_filter_ccc_impl.cc
   fft_filter_ccf_impl.cc
   fft_filter_fff_impl.cc
diff --git a/gr-filter/lib/filterbank.cc b/gr-filter/lib/filterbank.cc
new file mode 100644
index 0000000..bcaf381
--- /dev/null
+++ b/gr-filter/lib/filterbank.cc
@@ -0,0 +1,111 @@
+/* -*- c++ -*- */
+/*
+ * Copyright 2012,2014 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.
+ */
+
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
+#include <gnuradio/filter/filterbank.h>
+#include <cstdio>
+#include <iostream>
+
+namespace gr {
+  namespace filter {
+    namespace kernel {
+
+      filterbank::filterbank(const std::vector<std::vector<float> > &taps)
+        : d_taps(taps)
+      {
+        d_nfilts = d_taps.size();
+        d_fir_filters = std::vector<kernel::fir_filter_ccf*>(d_nfilts);
+        if (d_nfilts == 0) {
+          throw std::invalid_argument("The taps vector may not be empty.");
+        }
+        d_active.resize(d_nfilts);
+        // Create an FIR filter for each channel and zero out the taps
+        std::vector<float> vtaps(1, 0.0f);
+        for(unsigned int i = 0; i < d_nfilts; i++) {
+          d_fir_filters[i] = new kernel::fir_filter_ccf(1, vtaps);
+        }
+        // Now, actually set the filters' taps
+        set_taps(d_taps);
+      }
+
+      filterbank::~filterbank()
+      {
+        for(unsigned int i = 0; i < d_nfilts; i++) {
+          delete d_fir_filters[i];
+        }
+      }
+
+      void
+      filterbank::set_taps(const std::vector<std::vector<float> > &taps)
+      {
+        d_taps = taps;
+        // Check that the number of filters is correct.
+        if (d_nfilts != d_taps.size()) {
+          throw std::runtime_error("The number of filters is incorrect.");
+        }
+        // Check that taps contains vectors of taps, where each vector
+        // is the same length.
+        d_ntaps = d_taps[0].size();
+        for (unsigned int i = 1; i < d_nfilts; i++) {
+          if (d_taps[i].size() != d_ntaps) {
+            throw std::runtime_error("All sets of taps must be of the same 
length.");
+          }
+        }
+        for(unsigned int i = 0; i < d_nfilts; i++) {
+          // If filter taps are all zeros don't bother to crunch the numbers.
+          d_active[i] = false;
+          for (unsigned int j = 0; j < d_ntaps; j++) {
+            if (d_taps[i][j] != 0) {
+              d_active[i] = true;
+              break;
+            }
+          }
+          
+          d_fir_filters[i]->set_taps(d_taps[i]);
+        }
+      }
+
+      void
+      filterbank::print_taps()
+      {
+        unsigned int i, j;
+        for(i = 0; i < d_nfilts; i++) {
+          printf("filter[%d]: [", i);
+          for(j = 0; j < d_taps_per_filter; j++) {
+            printf(" %.4e", d_taps[i][j]);
+          }
+          printf("]\n\n");
+        }
+      }
+      
+      std::vector< std::vector<float> >
+      filterbank::taps() const
+      {
+        return d_taps;
+      }
+
+    } /* namespace kernel */
+  } /* namespace filter */
+} /* namespace gr */
diff --git a/gr-filter/lib/filterbank_vcvcf_impl.cc 
b/gr-filter/lib/filterbank_vcvcf_impl.cc
new file mode 100644
index 0000000..93c26bb
--- /dev/null
+++ b/gr-filter/lib/filterbank_vcvcf_impl.cc
@@ -0,0 +1,125 @@
+/* -*- c++ -*- */
+/*
+ * Copyright 2009,2010,2012,2014 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.
+ */
+
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
+#include "filterbank_vcvcf_impl.h"
+#include <gnuradio/io_signature.h>
+#include <stdio.h>
+#include <iostream>
+
+namespace gr {
+  namespace filter {
+    
+    filterbank_vcvcf::sptr
+    filterbank_vcvcf::make(const std::vector<std::vector<float> > &taps)
+    {
+      return gnuradio::get_initial_sptr(new filterbank_vcvcf_impl(taps));
+    }
+    
+    filterbank_vcvcf_impl::filterbank_vcvcf_impl(
+      const std::vector< std::vector<float> > &taps)
+      : block("filterbank_vcvcf",
+              io_signature::make(1, 1, sizeof(gr_complex)*taps.size()),
+              io_signature::make(1, 1, sizeof(gr_complex)*taps.size())),
+        filterbank(taps)
+    {
+      set_history(d_ntaps+1);
+    }
+
+    filterbank_vcvcf_impl::~filterbank_vcvcf_impl()
+    {
+    }
+
+    void
+    filterbank_vcvcf_impl::set_taps(const std::vector<std::vector<float> > 
&taps)
+    {
+      gr::thread::scoped_lock guard(d_mutex);
+      filterbank::set_taps(taps);
+      set_history(d_ntaps+1);
+      d_updated = true;
+    }
+
+    void
+    filterbank_vcvcf_impl::print_taps()
+    {
+      filterbank::print_taps();
+    }
+
+    std::vector<std::vector<float> >
+    filterbank_vcvcf_impl::taps() const
+    {
+      return filterbank::taps();
+    }
+
+    int
+    filterbank_vcvcf_impl::general_work(
+      int noutput_items,
+      gr_vector_int &ninput_items,
+      gr_vector_const_void_star &input_items,
+      gr_vector_void_star &output_items)
+    {
+      gr::thread::scoped_lock guard(d_mutex);
+
+      gr_complex *in = (gr_complex*)input_items[0];
+      gr_complex *out = (gr_complex*)output_items[0];
+
+      if(d_updated) {
+        d_updated = false;
+        return 0;                   // history requirements may have changed.
+      }
+
+      size_t noutputs = output_items.size();
+
+      gr_complex *working;
+      
+      working = new gr_complex [noutput_items + d_ntaps];
+
+      for (unsigned int i = 0; i < d_nfilts; i++) {
+        // Only call the filter method on active filters.
+        if (d_active[i]) {
+          for (unsigned int j = 0; j < noutput_items + d_ntaps-1; j++) {
+            unsigned int p = i + j*d_nfilts;
+            working[j] = in[p];
+          }
+          for (unsigned int j = 0; j < (unsigned int)(noutput_items); j++) {
+            unsigned int p = i + j*d_nfilts;
+            out[p] = d_fir_filters[i]->filter(working + j);
+          }
+        } else {
+          // Otherwise just output 0s.
+          for (unsigned int j = 0; j < (unsigned int)(noutput_items); j++) {
+            unsigned int p = i + j*d_nfilts;
+            out[p] = 0;
+          }
+        }
+      }
+     
+      delete [] working;
+      consume_each(noutput_items);
+      return noutput_items;
+    }
+
+  } /* namespace filter */
+} /* namespace gr */
diff --git a/gr-filter/lib/filterbank_vcvcf_impl.h 
b/gr-filter/lib/filterbank_vcvcf_impl.h
new file mode 100644
index 0000000..49fa1d0
--- /dev/null
+++ b/gr-filter/lib/filterbank_vcvcf_impl.h
@@ -0,0 +1,57 @@
+/* -*- c++ -*- */
+/*
+ * Copyright 2009,2010,2012,2014 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.
+ */
+
+#ifndef INCLUDED_FILTER_FILTERBANK_VCVCF_IMPL_H
+#define        INCLUDED_FILTER_FILTERBANK_VCVCF_IMPL_H
+
+#include <gnuradio/filter/filterbank_vcvcf.h>
+#include <gnuradio/filter/filterbank.h>
+#include <gnuradio/filter/fir_filter.h>
+#include <gnuradio/thread/thread.h>
+
+namespace gr {
+  namespace filter {
+
+    class FILTER_API filterbank_vcvcf_impl : public filterbank_vcvcf, 
kernel::filterbank
+    {
+    private:
+      bool d_updated;
+      gr::thread::mutex d_mutex; // mutex to protect set/work access
+
+    public:
+      filterbank_vcvcf_impl(const std::vector<std::vector<float> > &taps);
+      ~filterbank_vcvcf_impl();
+
+      void set_taps(const std::vector<std::vector<float> > &taps);
+      void print_taps();
+      std::vector<std::vector<float> > taps() const;
+
+      int general_work(int noutput_items,
+           gr_vector_int &ninput_items,
+                      gr_vector_const_void_star &input_items,
+                      gr_vector_void_star &output_items);
+    };
+
+  } /* namespace filter */
+} /* namespace gr */
+
+#endif
diff --git a/gr-filter/python/filter/qa_filterbank.py 
b/gr-filter/python/filter/qa_filterbank.py
new file mode 100644
index 0000000..3423b10
--- /dev/null
+++ b/gr-filter/python/filter/qa_filterbank.py
@@ -0,0 +1,130 @@
+#!/usr/bin/env python
+#
+# Copyright 2012,2014 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.
+#
+
+import time
+import random
+import math
+
+from gnuradio import gr, gr_unittest, filter, blocks
+
+def convolution(A, B):
+    """
+    Returns a convolution of the A and B vectors of length
+    len(A)-len(B).
+    """
+    rs = []
+    for i in range(len(B)-1, len(A)):
+        r = 0
+        for j, b in enumerate(B):
+            r += A[i-j] * b
+        rs.append(r)
+    return rs
+
+class test_filterbank_vcvcf(gr_unittest.TestCase):
+
+    def setUp(self):
+        self.tb = gr.top_block()
+
+    def tearDown(self):
+        self.tb = None
+
+    def test_000(self):
+        """
+        Generates nfilts sets of random complex data.
+        Generates two sets of random taps for each filter.
+        Applies one set of the random taps, gets some output,
+        applies the second set of random taps, gets some more output,
+        The output is then compared with a python-implemented
+        convolution.
+        """
+        myrand = random.Random(123).random
+        nfilts = 10
+        ntaps = 5
+        # Sets some of the taps to be all zeros.
+        zero_filts1 = (3, 7)
+        zero_filts2 = (1, 6, 9)
+        ndatapoints = 100
+        # Generate some random sets of data
+        data_sets = []
+        for i in range(0, nfilts):
+            data_sets.append([(myrand()-0.5) + (myrand()-0.5)*(0+1j)
+                              for k in range(0, ndatapoints)])
+        # Join them together to pass to vector_source block
+        data = []
+        for dp in zip(*data_sets):
+            data += dp
+        # Generate some random taps.
+        taps1 = []
+        taps2 = []
+        for i in range(0, nfilts):
+            if i in zero_filts1:
+                taps1.append([0]*ntaps)
+            else:
+                taps1.append([myrand()-0.5 for k in range(0, ntaps)])
+            if i in zero_filts2:
+                taps2.append([0]*ntaps)
+            else:
+                taps2.append([myrand()-0.5 for k in range(0, ntaps)])
+
+        # Calculate results with a python-implemented convolution.
+        results = []
+        results2 = []
+        for ds, ts, ts2 in zip(data_sets, taps1, taps2):
+            results.append(convolution(ds[-len(ts):]+ds[:-1], ts))
+            results2.append(convolution(ds[-len(ts):]+ds[:-1], ts2))
+        # Convert results from 2D arrays to 1D arrays for ease of comparison.
+        comb_results = []
+        for rs in zip(*results):
+            comb_results += rs
+        comb_results2 = []
+        for rs in zip(*results2):
+            comb_results2 += rs
+        # Construct the signal-processing chain.
+        src = blocks.vector_source_c(data, True, nfilts)
+        fb = filter.filterbank_vcvcf(taps1)
+        v2s = blocks.vector_to_stream(gr.sizeof_gr_complex, nfilts)
+        s2v = blocks.stream_to_vector(gr.sizeof_gr_complex, nfilts*ndatapoints)
+        snk = blocks.probe_signal_vc(nfilts*ndatapoints)
+        self.tb.connect(src, fb, v2s, s2v, snk)
+        # Run the signal-processing chain.
+        self.tb.start()
+        all_zero = True
+        outdata = None
+        waittime = 0.001
+        # Wait until we have some data.
+        while (not outdata) or outdata[0]==0:
+            time.sleep(waittime)
+            outdata = snk.level()
+        # Apply the second set of taps.
+        fb.set_taps(taps2)
+        outdata2 = None
+        # Wait until we have new data.
+        while (not outdata2) or outdata[0] == outdata2[0]:
+            time.sleep(waittime)
+            outdata2 = snk.level()
+        self.tb.stop()
+        # Compare the datasets.
+        self.assertComplexTuplesAlmostEqual(comb_results, outdata, 6)
+        self.assertComplexTuplesAlmostEqual(comb_results2, outdata2, 6)
+
+if __name__ == '__main__':
+    gr_unittest.run(test_filterbank_vcvcf, "test_filterbank_vcvcf.xml")
diff --git a/gr-filter/swig/filter_swig.i b/gr-filter/swig/filter_swig.i
index 3eb3f3c..ec1f522 100644
--- a/gr-filter/swig/filter_swig.i
+++ b/gr-filter/swig/filter_swig.i
@@ -1,6 +1,6 @@
 /* -*- c++ -*- */
 /*
- * Copyright 2012 Free Software Foundation, Inc.
+ * Copyright 2012,2014 Free Software Foundation, Inc.
  *
  * This file is part of GNU Radio
  *
@@ -33,6 +33,7 @@
 #include "gnuradio/filter/dc_blocker_cc.h"
 #include "gnuradio/filter/dc_blocker_ff.h"
 #include "gnuradio/filter/filter_delay_fc.h"
+#include "gnuradio/filter/filterbank_vcvcf.h"
 #include "gnuradio/filter/fir_filter_ccc.h"
 #include "gnuradio/filter/fir_filter_ccf.h"
 #include "gnuradio/filter/fir_filter_fcc.h"
@@ -82,6 +83,7 @@
 %include "gnuradio/filter/dc_blocker_cc.h"
 %include "gnuradio/filter/dc_blocker_ff.h"
 %include "gnuradio/filter/filter_delay_fc.h"
+%include "gnuradio/filter/filterbank_vcvcf.h"
 %include "gnuradio/filter/fir_filter_ccc.h"
 %include "gnuradio/filter/fir_filter_ccf.h"
 %include "gnuradio/filter/fir_filter_fcc.h"
@@ -128,6 +130,7 @@
 GR_SWIG_BLOCK_MAGIC2(filter, dc_blocker_cc);
 GR_SWIG_BLOCK_MAGIC2(filter, dc_blocker_ff);
 GR_SWIG_BLOCK_MAGIC2(filter, filter_delay_fc);
+GR_SWIG_BLOCK_MAGIC2(filter, filterbank_vcvcf);
 GR_SWIG_BLOCK_MAGIC2(filter, fir_filter_ccc);
 GR_SWIG_BLOCK_MAGIC2(filter, fir_filter_ccf);
 GR_SWIG_BLOCK_MAGIC2(filter, fir_filter_fcc);



reply via email to

[Prev in Thread] Current Thread [Next in Thread]