commit-gnuradio
[Top][All Lists]
Advanced

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

[Commit-gnuradio] r11250 - gnuradio/branches/developers/trondeau/pfb/gnu


From: trondeau
Subject: [Commit-gnuradio] r11250 - gnuradio/branches/developers/trondeau/pfb/gnuradio-core/src/lib/filter
Date: Sat, 20 Jun 2009 21:16:11 -0600 (MDT)

Author: trondeau
Date: 2009-06-20 21:16:11 -0600 (Sat, 20 Jun 2009)
New Revision: 11250

Added:
   
gnuradio/branches/developers/trondeau/pfb/gnuradio-core/src/lib/filter/gr_pfb_filter_ccf.cc
   
gnuradio/branches/developers/trondeau/pfb/gnuradio-core/src/lib/filter/gr_pfb_filter_ccf.h
   
gnuradio/branches/developers/trondeau/pfb/gnuradio-core/src/lib/filter/gr_pfb_filter_ccf.i
Modified:
   
gnuradio/branches/developers/trondeau/pfb/gnuradio-core/src/lib/filter/Makefile.am
Log:
Adding generic skeleton for filter work.

Modified: 
gnuradio/branches/developers/trondeau/pfb/gnuradio-core/src/lib/filter/Makefile.am
===================================================================
--- 
gnuradio/branches/developers/trondeau/pfb/gnuradio-core/src/lib/filter/Makefile.am
  2009-06-21 02:53:44 UTC (rev 11249)
+++ 
gnuradio/branches/developers/trondeau/pfb/gnuradio-core/src/lib/filter/Makefile.am
  2009-06-21 03:16:11 UTC (rev 11250)
@@ -190,7 +190,8 @@
        complex_dotprod_generic.cc      \
        ccomplex_dotprod_generic.cc     \
        float_dotprod_generic.c         \
-       short_dotprod_generic.c         
+       short_dotprod_generic.c         \
+       gr_pfb_filter_ccf.cc
 
 libfilter_qa_la_common_SOURCES =       \
        qa_filter.cc                    \
@@ -260,7 +261,8 @@
        qa_filter.h                     \
        short_dotprod_generic.h         \
        short_dotprod_x86.h             \
-       sse_debug.h
+       sse_debug.h                     \
+       gr_pfb_filter_ccf.h
 
 noinst_HEADERS =                       \
        assembly.h                      \
@@ -309,6 +311,7 @@
        gr_iir_filter_ffd.i             \
        gr_single_pole_iir_filter_ff.i  \
        gr_single_pole_iir_filter_cc.i  \
+       gr_pfb_filter_ccf.i             \
        $(GENERATED_I)
 endif
 

Added: 
gnuradio/branches/developers/trondeau/pfb/gnuradio-core/src/lib/filter/gr_pfb_filter_ccf.cc
===================================================================
--- 
gnuradio/branches/developers/trondeau/pfb/gnuradio-core/src/lib/filter/gr_pfb_filter_ccf.cc
                         (rev 0)
+++ 
gnuradio/branches/developers/trondeau/pfb/gnuradio-core/src/lib/filter/gr_pfb_filter_ccf.cc
 2009-06-21 03:16:11 UTC (rev 11250)
@@ -0,0 +1,83 @@
+/* -*- c++ -*- */
+/*
+ * Copyright 2009 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 <gr_pfb_filter_ccf.h>
+#include <gr_fir_ccf.h>
+#include <gr_fir_util.h>
+#include <gr_io_signature.h>
+
+gr_pfb_filter_ccf_sptr gr_make_pfb_filter_ccf (int decimation, const 
std::vector<float> &taps)
+{
+  return gr_pfb_filter_ccf_sptr (new gr_pfb_filter_ccf (decimation, taps));
+}
+
+
+gr_pfb_filter_ccf::gr_pfb_filter_ccf (int decimation, const std::vector<float> 
&taps)
+  : gr_sync_decimator ("pfb_filter_ccf",
+                      gr_make_io_signature (1, 1, sizeof (gr_complex)),
+                      gr_make_io_signature (1, 1, sizeof (gr_complex)),
+                      decimation),
+    d_updated (false)
+{
+  d_fir = gr_fir_util::create_gr_fir_ccf (taps);
+  set_history (d_fir->ntaps ());
+}
+
+gr_pfb_filter_ccf::~gr_pfb_filter_ccf ()
+{
+  delete d_fir;
+}
+
+void
+gr_pfb_filter_ccf::set_taps (const std::vector<float> &taps)
+{
+  d_new_taps = taps;
+  d_updated = true;
+}
+
+int
+gr_pfb_filter_ccf::work (int noutput_items,
+                        gr_vector_const_void_star &input_items,
+                        gr_vector_void_star &output_items)
+{
+  gr_complex *in = (gr_complex *) input_items[0];
+  gr_complex *out = (gr_complex *) output_items[0];
+
+  if (d_updated) {
+    d_fir->set_taps (d_new_taps);
+    set_history (d_fir->ntaps ());
+    d_updated = false;
+    return 0;               // history requirements may have changed.
+  }
+
+  if (decimation() == 1)
+    d_fir->filterN (out, in, noutput_items);
+
+  else
+    d_fir->filterNdec (out, in, noutput_items, decimation());
+
+  return noutput_items;
+}

Added: 
gnuradio/branches/developers/trondeau/pfb/gnuradio-core/src/lib/filter/gr_pfb_filter_ccf.h
===================================================================
--- 
gnuradio/branches/developers/trondeau/pfb/gnuradio-core/src/lib/filter/gr_pfb_filter_ccf.h
                          (rev 0)
+++ 
gnuradio/branches/developers/trondeau/pfb/gnuradio-core/src/lib/filter/gr_pfb_filter_ccf.h
  2009-06-21 03:16:11 UTC (rev 11250)
@@ -0,0 +1,64 @@
+/* -*- c++ -*- */
+/*
+ * Copyright 2008 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_GR_PFB_FILTER_CCF_H
+#define        INCLUDED_GR_PFB_FILTER_CCF_H
+
+#include <gr_sync_decimator.h>
+
+class gr_pfb_filter_ccf;
+typedef boost::shared_ptr<gr_pfb_filter_ccf> gr_pfb_filter_ccf_sptr;
+gr_pfb_filter_ccf_sptr gr_make_pfb_filter_ccf (int decimation, const 
std::vector<float> &taps);
+
+class gr_fir_ccf;
+
+/*!
+ * \brief FIR filter with gr_complex input, gr_complex output and float taps
+ * \ingroup filter_blk
+ */
+class gr_pfb_filter_ccf : public gr_sync_decimator
+{
+ private:
+  friend gr_pfb_filter_ccf_sptr gr_make_pfb_filter_ccf (int decimation, 
+                                                       const 
std::vector<float> &taps);
+
+  gr_fir_ccf           *d_fir;
+  std::vector<float>   d_new_taps;
+  bool                 d_updated;
+
+  /*!
+   * Construct a FIR filter with the given taps
+   */
+  gr_pfb_filter_ccf (int decimation, const std::vector<float> &taps);
+
+ public:
+  ~gr_pfb_filter_ccf ();
+
+  void set_taps (const std::vector<float> &taps);
+
+  int work (int noutput_items,
+           gr_vector_const_void_star &input_items,
+           gr_vector_void_star &output_items);
+};
+
+#endif

Added: 
gnuradio/branches/developers/trondeau/pfb/gnuradio-core/src/lib/filter/gr_pfb_filter_ccf.i
===================================================================
--- 
gnuradio/branches/developers/trondeau/pfb/gnuradio-core/src/lib/filter/gr_pfb_filter_ccf.i
                          (rev 0)
+++ 
gnuradio/branches/developers/trondeau/pfb/gnuradio-core/src/lib/filter/gr_pfb_filter_ccf.i
  2009-06-21 03:16:11 UTC (rev 11250)
@@ -0,0 +1,36 @@
+/* -*- c++ -*- */
+/*
+ * Copyright 2009 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.
+ */
+
+GR_SWIG_BLOCK_MAGIC(gr,pfb_filter_ccf)
+
+gr_pfb_filter_ccf_sptr gr_make_pfb_filter_ccf (int decimation, const 
std::vector<float> &taps);
+
+class gr_pfb_filter_ccf : public gr_sync_decimator
+{
+ private:
+  gr_pfb_filter_ccf (int decimation, const std::vector<float> &taps);
+
+ public:
+  ~gr_pfb_filter_ccf ();
+
+  void set_taps (const std::vector<float> &taps);
+};





reply via email to

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