diff options
author | Tom | 2009-10-06 13:50:54 -0700 |
---|---|---|
committer | Tom | 2009-10-06 13:50:54 -0700 |
commit | c014a0926d24d0edf10ced7ce122d154b7e33f18 (patch) | |
tree | 15527065c02b7c1ab40cc08b5e6a02fed4028270 /gnuradio-core | |
parent | bbd3df51732b2b63ae9d20e9fddd12229cf6b2ef (diff) | |
download | gnuradio-c014a0926d24d0edf10ced7ce122d154b7e33f18.tar.gz gnuradio-c014a0926d24d0edf10ced7ce122d154b7e33f18.tar.bz2 gnuradio-c014a0926d24d0edf10ced7ce122d154b7e33f18.zip |
Making second output port of PFB clock recovery optional.
Diffstat (limited to 'gnuradio-core')
-rw-r--r-- | gnuradio-core/src/lib/filter/gr_pfb_clock_sync_ccf.cc | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/gnuradio-core/src/lib/filter/gr_pfb_clock_sync_ccf.cc b/gnuradio-core/src/lib/filter/gr_pfb_clock_sync_ccf.cc index 5577e42c8..f7dd94685 100644 --- a/gnuradio-core/src/lib/filter/gr_pfb_clock_sync_ccf.cc +++ b/gnuradio-core/src/lib/filter/gr_pfb_clock_sync_ccf.cc @@ -50,7 +50,7 @@ gr_pfb_clock_sync_ccf::gr_pfb_clock_sync_ccf (float sps, float gain, float init_phase) : gr_block ("pfb_clock_sync_ccf", gr_make_io_signature (1, 1, sizeof(gr_complex)), - gr_make_io_signature2 (2, 2, sizeof(gr_complex), sizeof(float))), + gr_make_io_signature2 (1, 2, sizeof(gr_complex), sizeof(float))), d_updated (false), d_sps(sps), d_alpha(gain) { d_nfilters = filter_size; @@ -209,7 +209,10 @@ gr_pfb_clock_sync_ccf::general_work (int noutput_items, { gr_complex *in = (gr_complex *) input_items[0]; gr_complex *out = (gr_complex *) output_items[0]; - float *err = (float *) output_items[1]; + + float *err; + if(ninput_items.size() == 2) + err = (float *) output_items[1]; if (d_updated) { d_updated = false; @@ -226,7 +229,9 @@ gr_pfb_clock_sync_ccf::general_work (int noutput_items, while((i < noutput_items) && (count < nrequired)) { out[i] = d_filters[d_last_filter]->filter(&in[count]); error = (out[i] * d_diff_filters[d_last_filter]->filter(&in[count])).real(); - err[i] = error; + + if(ninput_items.size() == 2) + err[i] = error; d_acc += d_alpha*error; if(d_acc >= (int)d_nfilters) { |