commit-gnuradio
[Top][All Lists]
Advanced

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

[Commit-gnuradio] r11534 - gnuradio/branches/developers/n4hy/pfb_iir2/gn


From: n4hy
Subject: [Commit-gnuradio] r11534 - gnuradio/branches/developers/n4hy/pfb_iir2/gnuradio-core/src/lib/filter
Date: Mon, 3 Aug 2009 10:12:14 -0600 (MDT)

Author: n4hy
Date: 2009-08-03 10:12:14 -0600 (Mon, 03 Aug 2009)
New Revision: 11534

Modified:
   
gnuradio/branches/developers/n4hy/pfb_iir2/gnuradio-core/src/lib/filter/gr_sos_iir_filter_ffd.cc
   
gnuradio/branches/developers/n4hy/pfb_iir2/gnuradio-core/src/lib/filter/gr_sos_iir_filter_ffd.h
   
gnuradio/branches/developers/n4hy/pfb_iir2/gnuradio-core/src/lib/filter/gr_sos_iir_filter_ffd.i
   
gnuradio/branches/developers/n4hy/pfb_iir2/gnuradio-core/src/lib/filter/gri_sos_iir.h
Log:
going to DP taps for the second order sections, consistent with the M-th order 
systems

Modified: 
gnuradio/branches/developers/n4hy/pfb_iir2/gnuradio-core/src/lib/filter/gr_sos_iir_filter_ffd.cc
===================================================================
--- 
gnuradio/branches/developers/n4hy/pfb_iir2/gnuradio-core/src/lib/filter/gr_sos_iir_filter_ffd.cc
    2009-08-03 15:48:59 UTC (rev 11533)
+++ 
gnuradio/branches/developers/n4hy/pfb_iir2/gnuradio-core/src/lib/filter/gr_sos_iir_filter_ffd.cc
    2009-08-03 16:12:14 UTC (rev 11534)
@@ -30,16 +30,16 @@
 
 
 gr_sos_iir_filter_ffd_sptr 
-gr_make_sos_iir_filter_ffd (const std::vector<float> &fftaps,
-                       const std::vector<float> &fbtaps) throw 
(std::invalid_argument)
+gr_make_sos_iir_filter_ffd (const std::vector<double> &fftaps,
+                       const std::vector<double> &fbtaps) throw 
(std::invalid_argument)
 {
   return gr_sos_iir_filter_ffd_sptr (new gr_sos_iir_filter_ffd (fftaps, 
fbtaps));
 }
 
-gr_sos_iir_filter_ffd::gr_sos_iir_filter_ffd (const std::vector<float> &fftaps,
-                                     const std::vector<float> &fbtaps) throw 
(std::invalid_argument)
+gr_sos_iir_filter_ffd::gr_sos_iir_filter_ffd (const std::vector<double> 
&fftaps,
+                                             const std::vector<double> 
&fbtaps) throw (std::invalid_argument)
 
-  : gr_sync_block ("iir_filter_ffd",
+  : gr_sync_block ("sos_iir_filter_ffd",
                   gr_make_io_signature (1, 1, sizeof (float)),
                   gr_make_io_signature (1, 1, sizeof (float))),
     d_sos_iir (fftaps, fbtaps),
@@ -54,8 +54,8 @@
 }
 
 void
-gr_sos_iir_filter_ffd::set_taps (const std::vector<float> &fftaps,
-                            const std::vector<float> &fbtaps) throw 
(std::invalid_argument)
+gr_sos_iir_filter_ffd::set_taps (const std::vector<double> &fftaps,
+                            const std::vector<double> &fbtaps) throw 
(std::invalid_argument)
 {
   
   d_new_fftaps = fftaps;

Modified: 
gnuradio/branches/developers/n4hy/pfb_iir2/gnuradio-core/src/lib/filter/gr_sos_iir_filter_ffd.h
===================================================================
--- 
gnuradio/branches/developers/n4hy/pfb_iir2/gnuradio-core/src/lib/filter/gr_sos_iir_filter_ffd.h
     2009-08-03 15:48:59 UTC (rev 11533)
+++ 
gnuradio/branches/developers/n4hy/pfb_iir2/gnuradio-core/src/lib/filter/gr_sos_iir_filter_ffd.h
     2009-08-03 16:12:14 UTC (rev 11534)
@@ -30,29 +30,17 @@
 class gr_sos_iir_filter_ffd;
 typedef boost::shared_ptr<gr_sos_iir_filter_ffd> gr_sos_iir_filter_ffd_sptr;
 gr_sos_iir_filter_ffd_sptr 
-gr_make_sos_iir_filter_ffd (const std::vector<float> &fftaps,
-                       const std::vector<float> &fbtaps) throw 
(std::invalid_argument);
+gr_make_sos_iir_filter_ffd (const std::vector<double> &fftaps,
+                       const std::vector<double> &fbtaps) throw 
(std::invalid_argument);
 
 /*!
  * \brief  SOS_IIR filter with float input, float output and float taps
  * \ingroup filter_blk  and keep intermediate results in double accumulator.
  *
- * This filter uses the Direct Form I implementation, where
+ * This filter uses the Transposed Direct Form II implementation, where
  * \p fftaps contains the feed-forward taps, and \p fbtaps the feedback ones.
  *
  * 
- * The input and output satisfy a difference equation of the form
-
- \f[
- y[n] - \sum_{k=1}^{M} a_k y[n-k] = \sum_{k=0}^{N} b_k x[n-k]
- \f]
-
- * with the corresponding rational system function
-
- \f[
- H(z) = \frac{\sum_{k=0}^{M} b_k z^{-k}}{1 - \sum_{k=1}^{N} a_k z^{-k}}
- \f]
-
  * Note that some texts define the system function with a + in the denominator.
  * If you're using that convention, you'll need to negate the feedback taps.
  */
@@ -60,25 +48,25 @@
 {
  private:
   friend gr_sos_iir_filter_ffd_sptr 
-  gr_make_sos_iir_filter_ffd (const std::vector<float> &fftaps,
-                         const std::vector<float> &fbtaps) throw 
(std::invalid_argument);
+  gr_make_sos_iir_filter_ffd (const std::vector<double> &fftaps,
+                         const std::vector<double> &fbtaps) throw 
(std::invalid_argument);
 
-  gri_sos_iir<float,float,float>       d_sos_iir;
-  std::vector<float>                   d_new_fftaps;
-  std::vector<float>                   d_new_fbtaps;
+  gri_sos_iir<float,float,double>      d_sos_iir;
+  std::vector<double>                  d_new_fftaps;
+  std::vector<double>                  d_new_fbtaps;
   bool                                 d_updated;
 
   /*!
    * Construct an SOS_IIR filter with the given taps
    */
-  gr_sos_iir_filter_ffd (const std::vector<float> &fftaps,
-                    const std::vector<float> &fbtaps) throw 
(std::invalid_argument);
+  gr_sos_iir_filter_ffd (const std::vector<double> &fftaps,
+                    const std::vector<double> &fbtaps) throw 
(std::invalid_argument);
 
  public:
   ~gr_sos_iir_filter_ffd ();
 
-  void set_taps (const std::vector<float> &fftaps,
-                const std::vector<float> &fbtaps) throw 
(std::invalid_argument);
+  void set_taps (const std::vector<double> &fftaps,
+                const std::vector<double> &fbtaps) throw 
(std::invalid_argument);
 
   int work (int noutput_items,
            gr_vector_const_void_star &input_items,

Modified: 
gnuradio/branches/developers/n4hy/pfb_iir2/gnuradio-core/src/lib/filter/gr_sos_iir_filter_ffd.i
===================================================================
--- 
gnuradio/branches/developers/n4hy/pfb_iir2/gnuradio-core/src/lib/filter/gr_sos_iir_filter_ffd.i
     2009-08-03 15:48:59 UTC (rev 11533)
+++ 
gnuradio/branches/developers/n4hy/pfb_iir2/gnuradio-core/src/lib/filter/gr_sos_iir_filter_ffd.i
     2009-08-03 16:12:14 UTC (rev 11534)
@@ -23,18 +23,18 @@
 GR_SWIG_BLOCK_MAGIC(gr,sos_iir_filter_ffd);
 
 gr_sos_iir_filter_ffd_sptr 
-gr_make_sos_iir_filter_ffd (const std::vector<float> &fftaps,
-                       const std::vector<float> &fbtaps) throw 
(std::invalid_argument);
+gr_make_sos_iir_filter_ffd (const std::vector<double> &fftaps,
+                       const std::vector<double> &fbtaps) throw 
(std::invalid_argument);
 
 class gr_sos_iir_filter_ffd : public gr_sync_block
 {
  private:
-  gr_sos_iir_filter_ffd (const std::vector<float> &fftaps,
-                    const std::vector<float> &fbtaps) throw 
(std::invalid_argument);
+  gr_sos_iir_filter_ffd (const std::vector<double> &fftaps,
+                    const std::vector<double> &fbtaps) throw 
(std::invalid_argument);
 
  public:
   ~gr_sos_iir_filter_ffd ();
 
-  void set_taps (const std::vector<float> &fftaps,
-                const std::vector<float> &fbtaps) throw 
(std::invalid_argument);
+  void set_taps (const std::vector<double> &fftaps,
+                const std::vector<double> &fbtaps) throw 
(std::invalid_argument);
 };

Modified: 
gnuradio/branches/developers/n4hy/pfb_iir2/gnuradio-core/src/lib/filter/gri_sos_iir.h
===================================================================
--- 
gnuradio/branches/developers/n4hy/pfb_iir2/gnuradio-core/src/lib/filter/gri_sos_iir.h
       2009-08-03 15:48:59 UTC (rev 11533)
+++ 
gnuradio/branches/developers/n4hy/pfb_iir2/gnuradio-core/src/lib/filter/gri_sos_iir.h
       2009-08-03 16:12:14 UTC (rev 11534)
@@ -32,21 +32,21 @@
   /*!
    * \brief Construct an SOS_IIR with the given taps.
    *
-   * This filter uses the Direct Form I implementation, where
+   * This filter uses the Transposed Direct Form II implementation, where
    * \p fftaps contains the feed-forward taps, and \p fbtaps the feedback ones.
    *
-   * \p fftaps and \p fbtaps must have equal numbers of taps
+   * \p fftaps and \p fbtaps must have three taps
    *
    * The input and output satisfy a difference equation of the form
 
    \f[
-   y[n] - \sum_{k=1}^{M} a_k y[n-k] = \sum_{k=0}^{N} b_k x[n-k]
+   y[n] - \sum_{k=1}^{1} a_k y[n-k] = \sum_{k=0}^{2} b_k x[n-k]
    \f]
 
    * with the corresponding rational system function
 
    \f[
-   H(z) = \frac{\sum_{k=0}^{N} b_k z^{-k}}{1 - \sum_{k=1}^{M} a_k z^{-k}}
+   H(z) = \frac{\sum_{k=0}^{2} b_k z^{-k}}{1 - \sum_{k=1}^{2} a_k z^{-k}}
    \f]
 
    * Note that some texts define the system function with a + in the 
denominator.
@@ -104,7 +104,7 @@
 //
 template<class i_type, class o_type, class tap_type> 
 o_type
-gri_sos_iir<i_type, o_type, tap_type>::filter (const i_type input)
+inline gri_sos_iir<i_type, o_type, tap_type>::filter (const i_type input)
 {
   o_type       acc;
   





reply via email to

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