summaryrefslogtreecommitdiff
path: root/gnuradio-core/src/lib/general
diff options
context:
space:
mode:
authortrondeau2007-02-22 15:16:10 +0000
committertrondeau2007-02-22 15:16:10 +0000
commit7c0a2f98979a0aa155a0b8a73e952e328fbd08ce (patch)
treee1d84f718506fc52f06bd2c1a87ccbe9c6789a63 /gnuradio-core/src/lib/general
parent9b4666694c33d4865ffa223fd957d8c791aac67a (diff)
downloadgnuradio-7c0a2f98979a0aa155a0b8a73e952e328fbd08ce.tar.gz
gnuradio-7c0a2f98979a0aa155a0b8a73e952e328fbd08ce.tar.bz2
gnuradio-7c0a2f98979a0aa155a0b8a73e952e328fbd08ce.zip
removed function in access code correlator that should fix the problem observed in tunnel.py (originally fixed using the whitener offset)
git-svn-id: http://gnuradio.org/svn/gnuradio/trunk@4585 221aa14e-8319-0410-a670-987f0aec2ac5
Diffstat (limited to 'gnuradio-core/src/lib/general')
-rw-r--r--gnuradio-core/src/lib/general/gr_correlate_access_code_bb.cc9
-rw-r--r--gnuradio-core/src/lib/general/gr_correlate_access_code_bb.h2
2 files changed, 4 insertions, 7 deletions
diff --git a/gnuradio-core/src/lib/general/gr_correlate_access_code_bb.cc b/gnuradio-core/src/lib/general/gr_correlate_access_code_bb.cc
index 4656f8c52..18253e968 100644
--- a/gnuradio-core/src/lib/general/gr_correlate_access_code_bb.cc
+++ b/gnuradio-core/src/lib/general/gr_correlate_access_code_bb.cc
@@ -45,7 +45,7 @@ gr_correlate_access_code_bb::gr_correlate_access_code_bb (
gr_make_io_signature (1, 1, sizeof(char)),
gr_make_io_signature (1, 1, sizeof(char))),
d_data_reg(0), d_flag_reg(0), d_flag_bit(0), d_mask(0),
- d_threshold(threshold), d_flip(0)
+ d_threshold(threshold)
{
if (!set_access_code(access_code)){
@@ -94,7 +94,7 @@ gr_correlate_access_code_bb::work (int noutput_items,
// compute output value
unsigned int t = 0;
- t |= d_flip ^ (((d_data_reg >> 63) & 0x1) << 0);
+ t |= ((d_data_reg >> 63) & 0x1) << 0;
t |= ((d_flag_reg >> 63) & 0x1) << 1; // flag bit
out[i] = t;
@@ -106,8 +106,8 @@ gr_correlate_access_code_bb::work (int noutput_items,
wrong_bits = (d_data_reg ^ d_access_code) & d_mask;
nwrong = gr_count_bits64(wrong_bits);
- // test for access code with up to threshold errors or its compelement
- new_flag = (nwrong <= d_threshold) || (nwrong >= (64-d_threshold));
+ // test for access code with up to threshold errors
+ new_flag = (nwrong <= d_threshold);
#if 0
if(new_flag) {
@@ -120,7 +120,6 @@ gr_correlate_access_code_bb::work (int noutput_items,
d_flag_reg = (d_flag_reg << 1);
if (new_flag) {
d_flag_reg |= d_flag_bit;
- d_flip = nwrong >= (64-d_threshold); // flip bits if this is true
}
}
diff --git a/gnuradio-core/src/lib/general/gr_correlate_access_code_bb.h b/gnuradio-core/src/lib/general/gr_correlate_access_code_bb.h
index 8a2bdefc1..5f9b23076 100644
--- a/gnuradio-core/src/lib/general/gr_correlate_access_code_bb.h
+++ b/gnuradio-core/src/lib/general/gr_correlate_access_code_bb.h
@@ -62,8 +62,6 @@ class gr_correlate_access_code_bb : public gr_sync_block
unsigned long long d_mask; // masks access_code bits (top N bits are set where
// N is the number of bits in the access code)
unsigned int d_threshold; // how many bits may be wrong in sync vector
- unsigned int d_flip; // flip bits if 180 degress out of sync
-
protected:
gr_correlate_access_code_bb(const std::string &access_code, int threshold);