diff options
author | Tom Rondeau | 2010-05-16 14:39:53 -0400 |
---|---|---|
committer | Tom Rondeau | 2010-05-16 14:39:53 -0400 |
commit | 2ee1a94ff42a3d1858805bcce50b6aadb1773f47 (patch) | |
tree | 2aba805ef0c0d9250c496ae99d8847337b32f3ab /gnuradio-core | |
parent | 0c6abf713755e4c7f705bad2e9f982d431b4286d (diff) | |
download | gnuradio-2ee1a94ff42a3d1858805bcce50b6aadb1773f47.tar.gz gnuradio-2ee1a94ff42a3d1858805bcce50b6aadb1773f47.tar.bz2 gnuradio-2ee1a94ff42a3d1858805bcce50b6aadb1773f47.zip |
Can now set more channels than input signals. Empty channels are established as the outtermost channels (around fs/2 and -fs/2).
Diffstat (limited to 'gnuradio-core')
-rw-r--r-- | gnuradio-core/src/lib/filter/gr_pfb_synthesis_filterbank_ccf.cc | 20 |
1 files changed, 18 insertions, 2 deletions
diff --git a/gnuradio-core/src/lib/filter/gr_pfb_synthesis_filterbank_ccf.cc b/gnuradio-core/src/lib/filter/gr_pfb_synthesis_filterbank_ccf.cc index 15ba1ae2e..b1365bcf9 100644 --- a/gnuradio-core/src/lib/filter/gr_pfb_synthesis_filterbank_ccf.cc +++ b/gnuradio-core/src/lib/filter/gr_pfb_synthesis_filterbank_ccf.cc @@ -43,7 +43,7 @@ gr_pfb_synthesis_filterbank_ccf_sptr gr_make_pfb_synthesis_filterbank_ccf gr_pfb_synthesis_filterbank_ccf::gr_pfb_synthesis_filterbank_ccf (unsigned int numchans, const std::vector<float> &taps) : gr_sync_interpolator ("pfb_synthesis_filterbank_ccf", - gr_make_io_signature (numchans, numchans, sizeof(gr_complex)), + gr_make_io_signature (1, numchans, sizeof(gr_complex)), gr_make_io_signature (1, 1, sizeof(gr_complex)), numchans), d_updated (false), d_numchans(numchans) @@ -132,6 +132,9 @@ gr_pfb_synthesis_filterbank_ccf::work (int noutput_items, { gr_complex *in = (gr_complex*) input_items[0]; gr_complex *out = (gr_complex *) output_items[0]; + int numsigs = input_items.size(); + int ndiff = d_numchans - numsigs; + int nhalf = (int)ceil((float)numsigs/2.0f); if (d_updated) { d_updated = false; @@ -140,11 +143,24 @@ gr_pfb_synthesis_filterbank_ccf::work (int noutput_items, unsigned int n, i; for(n = 0; n < noutput_items/d_numchans; n++) { - for(i = 0; i < d_numchans; i++) { + // fill up the populated channels based on the + // number of real input streams + for(i = 0; i < nhalf; i++) { in = (gr_complex*)input_items[i]; d_fft->get_inbuf()[i] = (in+i)[n]; } + // Make the ndiff channels around N/2 0 + for(; i < nhalf+ndiff; i++) { + d_fft->get_inbuf()[i] = gr_complex(0,0); + } + + // Finish off channels with data + for(; i < d_numchans; i++) { + in = (gr_complex*)input_items[i-ndiff]; + d_fft->get_inbuf()[i] = (in+i)[n]; + } + // spin through IFFT d_fft->execute(); |