[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Commit-gnuradio] r11321 - gnuradio/branches/developers/trondeau/pfb/gnu
From: |
trondeau |
Subject: |
[Commit-gnuradio] r11321 - gnuradio/branches/developers/trondeau/pfb/gnuradio-core/src/lib/filter |
Date: |
Tue, 30 Jun 2009 20:47:47 -0600 (MDT) |
Author: trondeau
Date: 2009-06-30 20:47:47 -0600 (Tue, 30 Jun 2009)
New Revision: 11321
Modified:
gnuradio/branches/developers/trondeau/pfb/gnuradio-core/src/lib/filter/gr_pfb_channelizer_ccf.cc
gnuradio/branches/developers/trondeau/pfb/gnuradio-core/src/lib/filter/gr_pfb_channelizer_ccf.h
gnuradio/branches/developers/trondeau/pfb/gnuradio-core/src/lib/filter/gr_pfb_channelizer_ccf.i
Log:
Changing channelizer to a sync_block to better handle i/o
Modified:
gnuradio/branches/developers/trondeau/pfb/gnuradio-core/src/lib/filter/gr_pfb_channelizer_ccf.cc
===================================================================
---
gnuradio/branches/developers/trondeau/pfb/gnuradio-core/src/lib/filter/gr_pfb_channelizer_ccf.cc
2009-07-01 02:43:03 UTC (rev 11320)
+++
gnuradio/branches/developers/trondeau/pfb/gnuradio-core/src/lib/filter/gr_pfb_channelizer_ccf.cc
2009-07-01 02:47:47 UTC (rev 11321)
@@ -39,9 +39,9 @@
gr_pfb_channelizer_ccf::gr_pfb_channelizer_ccf (unsigned int numchans,
const std::vector<float> &taps)
- : gr_block ("pfb_channelizer_ccf",
- gr_make_io_signature (numchans, numchans, sizeof(gr_complex)),
- gr_make_io_signature (1, 1, numchans*sizeof(gr_complex))),
+ : gr_sync_block ("pfb_channelizer_ccf",
+ gr_make_io_signature (numchans, numchans,
sizeof(gr_complex)),
+ gr_make_io_signature (1, 1, numchans*sizeof(gr_complex))),
d_updated (false)
{
d_numchans = numchans;
@@ -97,10 +97,9 @@
}
int
-gr_pfb_channelizer_ccf::general_work (int noutput_items,
- gr_vector_int &ninput_items,
- gr_vector_const_void_star &input_items,
- gr_vector_void_star &output_items)
+gr_pfb_channelizer_ccf::work (int noutput_items,
+ gr_vector_const_void_star &input_items,
+ gr_vector_void_star &output_items)
{
gr_complex *in = (gr_complex *) input_items[0];
gr_complex *out = (gr_complex *) output_items[0];
@@ -110,15 +109,7 @@
return 0; // history requirements may have changed.
}
- //printf("noutput_items: %d\n", noutput_items);
- //printf("ninput_items: %d\n", ninput_items[0]);
-
- // FIXME: simple initial implementation
- // yes, this will be optimized
- int i = 0, count = 0;
-
- // for(int i = 0; i < noutput_items; i++) {
- while((i < noutput_items) && (count < ninput_items[0])) {
+ for(int i = 0; i < noutput_items; i++) {
// Move through filters from bottom to top
for(int j = d_numchans-1; j >= 0; j--) {
// Take in the items from the first input stream to d_numchans
@@ -131,11 +122,7 @@
// despin through FFT
d_fft->execute();
memcpy(&out[d_numchans*i], d_fft->get_outbuf(),
d_numchans*sizeof(gr_complex));
- i++;
- count++;
}
- //printf("count: %d\n", count);
- consume_each(count);
- return i;
+ return noutput_items;
}
Modified:
gnuradio/branches/developers/trondeau/pfb/gnuradio-core/src/lib/filter/gr_pfb_channelizer_ccf.h
===================================================================
---
gnuradio/branches/developers/trondeau/pfb/gnuradio-core/src/lib/filter/gr_pfb_channelizer_ccf.h
2009-07-01 02:43:03 UTC (rev 11320)
+++
gnuradio/branches/developers/trondeau/pfb/gnuradio-core/src/lib/filter/gr_pfb_channelizer_ccf.h
2009-07-01 02:47:47 UTC (rev 11321)
@@ -24,7 +24,7 @@
#ifndef INCLUDED_GR_PFB_CHANNELIZER_CCF_H
#define INCLUDED_GR_PFB_CHANNELIZER_CCF_H
-#include <gr_block.h>
+#include <gr_sync_block.h>
class gr_pfb_channelizer_ccf;
typedef boost::shared_ptr<gr_pfb_channelizer_ccf> gr_pfb_channelizer_ccf_sptr;
@@ -38,7 +38,7 @@
* \brief FIR filter with gr_complex input, gr_complex output and float taps
* \ingroup filter_blk
*/
-class gr_pfb_channelizer_ccf : public gr_block
+class gr_pfb_channelizer_ccf : public gr_sync_block
{
private:
friend gr_pfb_channelizer_ccf_sptr gr_make_pfb_channelizer_ccf (unsigned int
numchans,
@@ -62,10 +62,9 @@
void set_taps (const std::vector<float> &taps);
- int general_work (int noutput_items,
- gr_vector_int &ninput_items,
- gr_vector_const_void_star &input_items,
- gr_vector_void_star &output_items);
+ int work (int noutput_items,
+ gr_vector_const_void_star &input_items,
+ gr_vector_void_star &output_items);
};
#endif
Modified:
gnuradio/branches/developers/trondeau/pfb/gnuradio-core/src/lib/filter/gr_pfb_channelizer_ccf.i
===================================================================
---
gnuradio/branches/developers/trondeau/pfb/gnuradio-core/src/lib/filter/gr_pfb_channelizer_ccf.i
2009-07-01 02:43:03 UTC (rev 11320)
+++
gnuradio/branches/developers/trondeau/pfb/gnuradio-core/src/lib/filter/gr_pfb_channelizer_ccf.i
2009-07-01 02:47:47 UTC (rev 11321)
@@ -25,7 +25,7 @@
gr_pfb_channelizer_ccf_sptr gr_make_pfb_channelizer_ccf (unsigned int numchans,
const
std::vector<float> &taps);
-class gr_pfb_channelizer_ccf : public gr_block
+class gr_pfb_channelizer_ccf : public gr_sync_block
{
private:
gr_pfb_channelizer_ccf (unsigned int numchans,
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Commit-gnuradio] r11321 - gnuradio/branches/developers/trondeau/pfb/gnuradio-core/src/lib/filter,
trondeau <=