[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Commit-gnuradio] [gnuradio] 07/24: digital: Updates to corr_est block.
From: |
git |
Subject: |
[Commit-gnuradio] [gnuradio] 07/24: digital: Updates to corr_est block. |
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 664f3ecd15f324909bca3bffb97ca41318dfd55b
Author: Tom Rondeau <address@hidden>
Date: Mon Apr 4 10:53:05 2016 -0400
digital: Updates to corr_est block.
Summing correlation over two consecutive symbols because the
correlation power is spread out when the timing is off.
Also changing from a parabolic interpolation to a linear interpolation
measurement for the timing offset. Providing a linear estimate is
easier to use in downstream blocks to make adjustments.
---
gr-digital/lib/corr_est_cc_impl.cc | 26 ++++++++++++++++++++++----
1 file changed, 22 insertions(+), 4 deletions(-)
diff --git a/gr-digital/lib/corr_est_cc_impl.cc
b/gr-digital/lib/corr_est_cc_impl.cc
index 772fc78..25e6b7f 100644
--- a/gr-digital/lib/corr_est_cc_impl.cc
+++ b/gr-digital/lib/corr_est_cc_impl.cc
@@ -200,7 +200,10 @@ namespace gr {
float corr = 0;
for(size_t i = 0; i < d_symbols.size(); i++)
corr += abs(d_symbols[i]*conj(d_symbols[i]));
- d_thresh = threshold*corr*corr;
+
+ // Half the user-specified threshold to account for summing two
+ // consecutive correlation values in the work function.
+ d_thresh = (threshold + (1-threshold)/2.0f)*corr*corr;
}
void
@@ -242,11 +245,16 @@ namespace gr {
int isps = (int)(d_sps + 0.5f);
int i = 0;
while(i < noutput_items) {
- // Look for the correlator output to cross the threshold
- if (d_corr_mag[i] <= d_thresh) {
+ // Look for the correlator output to cross the threshold Sum
+ // power over two consecutive symbols in case we're offset in
+ // time. If off by 1/2 a symbol, the peak of any one point is
+ // much lower.
+ float corr_mag = d_corr_mag[i] + d_corr_mag[i+1];
+ if (corr_mag <= d_thresh) {
i++;
continue;
}
+
// Go to (just past) the current correlator output peak
while ((i < (noutput_items-1)) &&
(d_corr_mag[i] < d_corr_mag[i+1]))
@@ -262,8 +270,9 @@ namespace gr {
add_item_tag(0, nitems_written(0) + i, pmt::intern("corr_start"),
pmt::from_double(d_corr_mag[i]), d_src_id);
+#if 0
// Use Parabolic interpolation to estimate a fractional
- // sample delay. There are more accurate methods as
+ // sample delay. There are more accurate methods as
// the sample delay estimate using this method is biased.
// But this method is simple and fast.
// center between [-0.5,0.5] units of samples
@@ -275,6 +284,15 @@ namespace gr {
double denom = 2*(d_corr_mag[i-1]-2*d_corr_mag[i]+d_corr_mag[i+1]);
center = nom/denom;
}
+#else
+ // Calculates the center of mass between the three points around the
peak.
+ // Estimate is linear.
+ double nom = 0, den = 0;
+ nom = d_corr_mag[i-1] + 2*d_corr_mag[i] + 3*d_corr_mag[i+1];
+ den = d_corr_mag[i-1] + d_corr_mag[i] + d_corr_mag[i+1];
+ double center = nom / den;
+ center = (center - 2.0); // adjust for bias in center of mass
calculation
+#endif
// Calculate the phase offset of the incoming signal.
//
- [Commit-gnuradio] [gnuradio] 13/24: digital: Dealing with scaling issues with corr_est., (continued)
- [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, 2016/06/13
- [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 <=
- [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
- [Commit-gnuradio] [gnuradio] 21/24: digital: adding packet_formatter_ofdm to replace packet_header_ofdm., git, 2016/06/13
- [Commit-gnuradio] [gnuradio] 22/24: digital: refactoring formatting/parsing code., git, 2016/06/13
- [Commit-gnuradio] [gnuradio] 02/24: digital: adding examples for using packet utilities., git, 2016/06/13
- [Commit-gnuradio] [gnuradio] 16/24: digital: Examples for dealing with packet comms, git, 2016/06/13
- [Commit-gnuradio] [gnuradio] 05/24: digital: More examples to help debug packet blocks/code., git, 2016/06/13