[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Commit-gnuradio] [gnuradio] 20/57: digital: correlate_access_code_tag d
From: |
git |
Subject: |
[Commit-gnuradio] [gnuradio] 20/57: digital: correlate_access_code_tag d_mask was set improperly when access code len = 64. |
Date: |
Wed, 21 May 2014 03:10:26 +0000 (UTC) |
This is an automated email from the git hooks/post-receive script.
trondeau pushed a commit to branch master
in repository gnuradio.
commit ba2951861b99f59df79022f98f51a12273fe2aa8
Author: Tom Rondeau <address@hidden>
Date: Thu Mar 27 14:29:03 2014 -0700
digital: correlate_access_code_tag d_mask was set improperly when access
code len = 64.
---
gr-digital/lib/correlate_access_code_bb_impl.cc | 12 ++++++------
gr-digital/lib/correlate_access_code_tag_bb_impl.cc | 8 +++-----
gr-digital/python/digital/qa_correlate_access_code.py | 14 +++++++-------
3 files changed, 16 insertions(+), 18 deletions(-)
diff --git a/gr-digital/lib/correlate_access_code_bb_impl.cc
b/gr-digital/lib/correlate_access_code_bb_impl.cc
index dea831d..532871a 100644
--- a/gr-digital/lib/correlate_access_code_bb_impl.cc
+++ b/gr-digital/lib/correlate_access_code_bb_impl.cc
@@ -1,19 +1,19 @@
/* -*- c++ -*- */
/*
* Copyright 2004,2006,2010-2012 Free Software Foundation, Inc.
- *
+ *
* This file is part of GNU Radio
- *
+ *
* GNU Radio is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 3, or (at your option)
* any later version.
- *
+ *
* GNU Radio is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
- *
+ *
* You should have received a copy of the GNU General Public License
* along with GNU Radio; see the file COPYING. If not, write to
* the Free Software Foundation, Inc., 51 Franklin Street,
@@ -97,7 +97,7 @@ namespace gr {
t |= ((d_data_reg >> 63) & 0x1) << 0;
t |= ((d_flag_reg >> 63) & 0x1) << 1; // flag bit
out[i] = t;
-
+
// compute hamming distance between desired access code and current data
unsigned long long wrong_bits = 0;
unsigned int nwrong = d_threshold+1;
@@ -128,6 +128,6 @@ namespace gr {
return noutput_items;
}
-
+
} /* namespace digital */
} /* namespace gr */
diff --git a/gr-digital/lib/correlate_access_code_tag_bb_impl.cc
b/gr-digital/lib/correlate_access_code_tag_bb_impl.cc
index f6574dd..31ae6d9 100644
--- a/gr-digital/lib/correlate_access_code_tag_bb_impl.cc
+++ b/gr-digital/lib/correlate_access_code_tag_bb_impl.cc
@@ -27,7 +27,6 @@
#include "correlate_access_code_tag_bb_impl.h"
#include <gnuradio/io_signature.h>
#include <stdexcept>
-//#include <gnuradio/blocks/count_bits.h>
#include <volk/volk.h>
#include <cstdio>
#include <iostream>
@@ -78,8 +77,8 @@ namespace gr {
if(d_len > 64)
return false;
- // set d_len bottom bits to 1.
- d_mask = (1ULL << d_len) - 1;
+ // set len top bits to 1.
+ d_mask = ((~0ULL) >> (64 - d_len)) << (64 - d_len);
d_access_code = 0;
for(unsigned i=0; i < d_len; i++){
@@ -113,7 +112,7 @@ namespace gr {
wrong_bits = (d_data_reg ^ d_access_code) & d_mask;
volk_64u_popcnt(&nwrong, wrong_bits);
- // shift in new data and new flag
+ // shift in new data
d_data_reg = (d_data_reg << 1) | (in[i] & 0x1);
if(nwrong <= d_threshold) {
if(VERBOSE)
@@ -132,4 +131,3 @@ namespace gr {
} /* namespace digital */
} /* namespace gr */
-
diff --git a/gr-digital/python/digital/qa_correlate_access_code.py
b/gr-digital/python/digital/qa_correlate_access_code.py
index 198a254..d89b457 100755
--- a/gr-digital/python/digital/qa_correlate_access_code.py
+++ b/gr-digital/python/digital/qa_correlate_access_code.py
@@ -1,24 +1,24 @@
#!/usr/bin/env python
#
# Copyright 2006,2007,2010,2011,2013 Free Software Foundation, Inc.
-#
+#
# This file is part of GNU Radio
-#
+#
# GNU Radio is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 3, or (at your option)
# any later version.
-#
+#
# GNU Radio is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
-#
+#
# You should have received a copy of the GNU General Public License
# along with GNU Radio; see the file COPYING. If not, write to
# the Free Software Foundation, Inc., 51 Franklin Street,
# Boston, MA 02110-1301, USA.
-#
+#
from gnuradio import gr, gr_unittest, digital, blocks
@@ -74,7 +74,7 @@ class test_correlate_access_code(gr_unittest.TestCase):
self.tb.run()
result_data = dst.data()
self.assertEqual(expected_result, result_data)
-
+
def test_003(self):
code = tuple(string_to_1_0_list(default_access_code))
access_code = to_1_0_string(code)
@@ -93,4 +93,4 @@ class test_correlate_access_code(gr_unittest.TestCase):
if __name__ == '__main__':
gr_unittest.run(test_correlate_access_code,
"test_correlate_access_code.xml")
-
+
- [Commit-gnuradio] [gnuradio] 01/57: cmake and build: fixes for cross-compiling to enable ControlPort with ICE., (continued)
- [Commit-gnuradio] [gnuradio] 01/57: cmake and build: fixes for cross-compiling to enable ControlPort with ICE., git, 2014/05/20
- [Commit-gnuradio] [gnuradio] 06/57: Bring codec2 up to the latest version, and add support for all six bit rates., git, 2014/05/20
- [Commit-gnuradio] [gnuradio] 12/57: qtgui: removing unused NumberDisplayPlot; the number sink doesn't have a canvas like the other plotters do and so doesn't require this., git, 2014/05/20
- [Commit-gnuradio] [gnuradio] 04/57: controlport: allows reset_perf_counters to be called over controlport; gr-perf-monitorx has button to call this., git, 2014/05/20
- [Commit-gnuradio] [gnuradio] 07/57: vocoder: add default mode parameter and updated documentation, git, 2014/05/20
- [Commit-gnuradio] [gnuradio] 10/57: controlport: in gr-perf-monitorx, if all work times returned are 0, avoid a divide-by-zero fault., git, 2014/05/20
- [Commit-gnuradio] [gnuradio] 11/57: docs: doxygen mangles sections named with the same reference name. ControlPort and Vocoder both used 'using' - renamed for each., git, 2014/05/20
- [Commit-gnuradio] [gnuradio] 13/57: volk: adding a rate 1/2, K=7 convolutional decoder volk kernel., git, 2014/05/20
- [Commit-gnuradio] [gnuradio] 14/57: block interleave/deinterleave with statefull deinterleave, git, 2014/05/20
- [Commit-gnuradio] [gnuradio] 03/57: controlport: adding a 'toggle' interface for ControlPort., git, 2014/05/20
- [Commit-gnuradio] [gnuradio] 20/57: digital: correlate_access_code_tag d_mask was set improperly when access code len = 64.,
git <=
- [Commit-gnuradio] [gnuradio] 09/57: documentation - fix example in case anyone gets confused, git, 2014/05/20
- [Commit-gnuradio] [gnuradio] 08/57: Corrected codec2 encoder documentation., git, 2014/05/20
- [Commit-gnuradio] [gnuradio] 15/57: tests for block mode, git, 2014/05/20
- [Commit-gnuradio] [gnuradio] 19/57: volk: missing updates for volk qa and profile from last checkin., git, 2014/05/20
- [Commit-gnuradio] [gnuradio] 25/57: fec: encoder now outputs bytes to make it more easily integratable with modulators., git, 2014/05/20
- [Commit-gnuradio] [gnuradio] 21/57: fec: improved fecapi stuff., git, 2014/05/20
- [Commit-gnuradio] [gnuradio] 23/57: fec: wip: allowing ber block to be used as a streaming block., git, 2014/05/20
- [Commit-gnuradio] [gnuradio] 17/57: adding ber sink to qt gui, git, 2014/05/20
- [Commit-gnuradio] [gnuradio] 24/57: digital: use FFT filters for the correlate_and_sync block., git, 2014/05/20
- [Commit-gnuradio] [gnuradio] 27/57: grc: adding advanced tab feature to set a block's alias., git, 2014/05/20