commit-gnuradio
[Top][All Lists]
Advanced

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

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


From: n4hy
Subject: [Commit-gnuradio] r11337 - gnuradio/branches/developers/trondeau/pfb/gnuradio-core/src/lib/filter
Date: Sat, 4 Jul 2009 05:27:31 -0600 (MDT)

Author: n4hy
Date: 2009-07-04 05:27:30 -0600 (Sat, 04 Jul 2009)
New Revision: 11337

Modified:
   
gnuradio/branches/developers/trondeau/pfb/gnuradio-core/src/lib/filter/gr_pfb_decimator_ccf.cc
   
gnuradio/branches/developers/trondeau/pfb/gnuradio-core/src/lib/filter/gr_pfb_decimator_ccf.h
Log:
allow use of vector rotator instead of FFT so Tom could compare

Modified: 
gnuradio/branches/developers/trondeau/pfb/gnuradio-core/src/lib/filter/gr_pfb_decimator_ccf.cc
===================================================================
--- 
gnuradio/branches/developers/trondeau/pfb/gnuradio-core/src/lib/filter/gr_pfb_decimator_ccf.cc
      2009-07-04 03:22:42 UTC (rev 11336)
+++ 
gnuradio/branches/developers/trondeau/pfb/gnuradio-core/src/lib/filter/gr_pfb_decimator_ccf.cc
      2009-07-04 11:27:30 UTC (rev 11337)
@@ -51,11 +51,13 @@
   d_rate = decim;
   d_filters = std::vector<gr_fir_ccf*>(d_rate);
   d_chan = channel;
+  d_rotator = new gr_complex[d_rate];
 
   // Create an FIR filter for each channel and zero out the taps
   std::vector<float> vtaps(0, d_rate);
   for(unsigned int i = 0; i < d_rate; i++) {
     d_filters[i] = gr_fir_util::create_gr_fir_ccf(vtaps);
+    d_rotator[i] = gr_expj(i*2*M_PI*d_chan/d_rate);
   }
 
   // Now, actually set the filters' taps
@@ -100,7 +102,7 @@
 
   d_updated = true;
 }
-
+//#define ROTATEFFT
 int
 gr_pfb_decimator_ccf::work (int noutput_items,
                            gr_vector_const_void_star &input_items,
@@ -130,15 +132,21 @@
       // This is the real math that goes on; we abuse the FFT to do this 
quickly
       // for decimation rates > N where N is a small number (~5):
       //       out[i] += 
d_filters[j]->filter(&in[i])*gr_expj(j*d_chan*2*M_PI/d_rate);
-
+#ifdef ROTATEFFT
       d_fft->get_inbuf()[j] = d_filters[j]->filter(&in[i]);
+#else
+      out[i] += d_filters[j]->filter(&in[i])*d_rotator[i];
+#endif
     }
 
+#ifdef ROTATEFFT
     // Perform the FFT to do the complex multiply despinning for all channels
     d_fft->execute();
 
     // Select only the desired channel out
     out[i] = d_fft->get_outbuf()[d_chan];
+#endif
+    
   }
   
   return noutput_items;

Modified: 
gnuradio/branches/developers/trondeau/pfb/gnuradio-core/src/lib/filter/gr_pfb_decimator_ccf.h
===================================================================
--- 
gnuradio/branches/developers/trondeau/pfb/gnuradio-core/src/lib/filter/gr_pfb_decimator_ccf.h
       2009-07-04 03:22:42 UTC (rev 11336)
+++ 
gnuradio/branches/developers/trondeau/pfb/gnuradio-core/src/lib/filter/gr_pfb_decimator_ccf.h
       2009-07-04 11:27:30 UTC (rev 11337)
@@ -52,6 +52,7 @@
   unsigned int             d_chan;
   unsigned int             d_taps_per_filter;
   bool                    d_updated;
+  gr_complex              *d_rotator;
 
   /*!
    * Construct a Polyphase filterbank for channelization with the given 





reply via email to

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