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));
}
// 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
}
// 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;
}
return 0; // history requirements may have changed.
}
- int n=0, i=-1, j=0, last;
+ int n=1, i=-1, j=0, last;
int toconsume = (int)rintf(noutput_items/d_oversample_rate);
- while(n < toconsume) {
+ while(n <= toconsume) {
j = 0;
i = (i + d_rate_ratio) % d_numchans;
last = i;