Sneaking in a few warning fixes to this branch.
[debian/gnuradio] / gnuradio-core / src / lib / filter / gr_pfb_channelizer_ccf.cc
index 824a78dd97d82376c604e8f8dd95724c4f003e0a..db16a634b773af6774a160d630795c8eee6b5918 100644 (file)
@@ -36,7 +36,7 @@ gr_pfb_channelizer_ccf_sptr gr_make_pfb_channelizer_ccf (unsigned int numchans,
                                                         const std::vector<float> &taps,
                                                         float oversample_rate)
 {
-  return gr_pfb_channelizer_ccf_sptr (new gr_pfb_channelizer_ccf (numchans, taps,
+  return gnuradio::get_initial_sptr(new gr_pfb_channelizer_ccf (numchans, taps,
                                                                  oversample_rate));
 }
 
@@ -55,11 +55,12 @@ 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]"); 
 
+  set_relative_rate(1.0/intp);
+
   d_filters = std::vector<gr_fir_ccf*>(d_numchans);
 
   // Create an FIR filter for each channel and zero out the taps
@@ -132,7 +133,7 @@ gr_pfb_channelizer_ccf::set_taps (const std::vector<float> &taps)
   }
 
   // Set the history to ensure enough input items for each filter
-  set_history (d_taps_per_filter);
+  set_history (d_taps_per_filter+1);
 
   d_updated = true;
 }