[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Commit-gnuradio] [gnuradio] 08/24: digital: fixing PFB clock sync block
From: |
git |
Subject: |
[Commit-gnuradio] [gnuradio] 08/24: digital: fixing PFB clock sync block handling of tags. |
Date: |
Tue, 14 Jun 2016 00:40:57 +0000 (UTC) |
This is an automated email from the git hooks/post-receive script.
jcorgan pushed a commit to branch packet2
in repository gnuradio.
commit bda8fb2e28db5e497117f4a7415619df706614eb
Author: Tom Rondeau <address@hidden>
Date: Fri Feb 19 12:22:39 2016 -0500
digital: fixing PFB clock sync block handling of tags.
Fixes handling of time_est tag information and how to convert to the
correct phase arm of the filterbank.
Stopped using enable_update_rate; instead, handle tags within work.
Because the relative rate can change within this block's work
function, applying the same update to the tag offets after work does
not work. Instead, we use TPP_DONT and handle the placement of the
tags on the output buffer ourselves.
---
gr-digital/lib/pfb_clock_sync_ccf_impl.cc | 31 ++++++++++++++++++++++++++-----
gr-digital/lib/pfb_clock_sync_ccf_impl.h | 2 ++
2 files changed, 28 insertions(+), 5 deletions(-)
diff --git a/gr-digital/lib/pfb_clock_sync_ccf_impl.cc
b/gr-digital/lib/pfb_clock_sync_ccf_impl.cc
index 314ff94..b017a95 100644
--- a/gr-digital/lib/pfb_clock_sync_ccf_impl.cc
+++ b/gr-digital/lib/pfb_clock_sync_ccf_impl.cc
@@ -72,7 +72,8 @@ namespace gr {
throw std::runtime_error("pfb_clock_sync_ccf: please specify a
filter.\n");
// Let scheduler adjust our relative_rate.
- enable_update_rate(true);
+ //enable_update_rate(true);
+ set_tag_propagation_policy(TPP_DONT);
d_nfilters = filter_size;
d_sps = floor(sps);
@@ -108,6 +109,10 @@ namespace gr {
set_taps(taps, d_taps, d_filters);
set_taps(dtaps, d_dtaps, d_diff_filters);
+ d_old_in = 0;
+ d_new_in = 0;
+ d_last_out = 0;
+
set_relative_rate((float)d_osps/(float)d_sps);
}
@@ -420,8 +425,8 @@ namespace gr {
}
std::vector<tag_t> tags;
- get_tags_in_range(tags, 0, nitems_read(0),
- nitems_read(0)+d_sps*noutput_items,
+ get_tags_in_window(tags, 0, 0,
+ d_sps*noutput_items,
pmt::intern("time_est"));
int i = 0, count = 0;
@@ -433,7 +438,8 @@ namespace gr {
size_t offset = tags[0].offset-nitems_read(0);
if((offset >= (size_t)count) && (offset < (size_t)(count + d_sps))) {
float center = (float)pmt::to_double(tags[0].value);
- d_k = (offset-count - d_sps/2.0) * d_nfilters +
(M_PI*center*d_nfilters);
+ d_k = d_nfilters*(center + (offset - count));
+
tags.erase(tags.begin());
}
}
@@ -458,7 +464,22 @@ namespace gr {
out[i+d_out_idx] = d_filters[d_filtnum]->filter(&in[count+d_out_idx]);
d_k = d_k + d_rate_i + d_rate_f; // update phase
- d_out_idx++;
+
+
+ // Manage Tags
+ std::vector<tag_t> xtags;
+ std::vector<tag_t>::iterator itags;
+ d_new_in = nitems_read(0) + count + d_out_idx + d_sps;
+ get_tags_in_range(xtags, 0, d_old_in, d_new_in);
+ for(itags = xtags.begin(); itags != xtags.end(); itags++) {
+ tag_t new_tag = *itags;
+ new_tag.offset = d_last_out + d_taps_per_filter/(2*d_sps) - 2;
+ add_item_tag(0, new_tag);
+ }
+ d_old_in = d_new_in;
+ d_last_out = nitems_written(0) + i + d_out_idx;
+
+ d_out_idx++;
if(output_items.size() == 4) {
err[i] = d_error;
diff --git a/gr-digital/lib/pfb_clock_sync_ccf_impl.h
b/gr-digital/lib/pfb_clock_sync_ccf_impl.h
index 5356281..b23b8fe 100644
--- a/gr-digital/lib/pfb_clock_sync_ccf_impl.h
+++ b/gr-digital/lib/pfb_clock_sync_ccf_impl.h
@@ -59,6 +59,8 @@ namespace gr {
float d_error;
int d_out_idx;
+ uint64_t d_old_in, d_new_in, d_last_out;
+
void create_diff_taps(const std::vector<float> &newtaps,
std::vector<float> &difftaps);
- [Commit-gnuradio] [gnuradio] branch packet2 created (now 93acb5b), git, 2016/06/13
- [Commit-gnuradio] [gnuradio] 11/24: digital: fixed packet parser QA tests, git, 2016/06/13
- [Commit-gnuradio] [gnuradio] 04/24: digital: Cleaning up some of the packet parsing code., git, 2016/06/13
- [Commit-gnuradio] [gnuradio] 12/24: blocks: Adds a multiple (complex only) block that responds to tags., git, 2016/06/13
- [Commit-gnuradio] [gnuradio] 13/24: digital: Dealing with scaling issues with corr_est., git, 2016/06/13
- [Commit-gnuradio] [gnuradio] 09/24: digital: Removed parse_soft and packet_parse_f., git, 2016/06/13
- [Commit-gnuradio] [gnuradio] 15/24: digital: wip: packet formatters specify payload in symbols, not bits., git, 2016/06/13
- [Commit-gnuradio] [gnuradio] 03/24: Adding new test block to adjust the sample rate of a stream and make sure tags are being placed in the correct locations., git, 2016/06/13
- [Commit-gnuradio] [gnuradio] 06/24: digital: updates to packet_formatter classes and parsing blocks., git, 2016/06/13
- [Commit-gnuradio] [gnuradio] 08/24: digital: fixing PFB clock sync block handling of tags.,
git <=
- [Commit-gnuradio] [gnuradio] 23/24: digital: Fixing QA code for testing header formatter/parsers., git, 2016/06/13
- [Commit-gnuradio] [gnuradio] 14/24: digital: wip: pfb_clock_sync_ccf tag offset update., git, 2016/06/13
- [Commit-gnuradio] [gnuradio] 18/24: digital: fixing up some of the packet formatters since the new base class., git, 2016/06/13
- [Commit-gnuradio] [gnuradio] 17/24: docs: Adding documentation for packet comms, git, 2016/06/13
- [Commit-gnuradio] [gnuradio] 07/24: digital: Updates to corr_est block., git, 2016/06/13
- [Commit-gnuradio] [gnuradio] 20/24: digital: fixed packet_parse from using default formatter to base class, git, 2016/06/13
- [Commit-gnuradio] [gnuradio] 24/24: digital: fixed up some header_buffer issues and added QA., git, 2016/06/13
- [Commit-gnuradio] [gnuradio] 19/24: digital: adding more support for packet formatters., git, 2016/06/13
- [Commit-gnuradio] [gnuradio] 10/24: digital: Redid packet formatter class hierarchy., git, 2016/06/13
- [Commit-gnuradio] [gnuradio] 01/24: digital: New packet management classes., git, 2016/06/13