commit-gnuradio
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Commit-gnuradio] r4217 - gnuradio/branches/developers/trondeau/digital-


From: trondeau
Subject: [Commit-gnuradio] r4217 - gnuradio/branches/developers/trondeau/digital-wip2/gnuradio-core/src/lib/general
Date: Tue, 2 Jan 2007 16:50:32 -0700 (MST)

Author: trondeau
Date: 2007-01-02 16:50:32 -0700 (Tue, 02 Jan 2007)
New Revision: 4217

Modified:
   
gnuradio/branches/developers/trondeau/digital-wip2/gnuradio-core/src/lib/general/gr_correlate_access_code_bb.cc
   
gnuradio/branches/developers/trondeau/digital-wip2/gnuradio-core/src/lib/general/gr_correlate_access_code_bb.h
Log:
removed flip bit and checking for phase inversion (this block does not care 
about phase orientation).

Modified: 
gnuradio/branches/developers/trondeau/digital-wip2/gnuradio-core/src/lib/general/gr_correlate_access_code_bb.cc
===================================================================
--- 
gnuradio/branches/developers/trondeau/digital-wip2/gnuradio-core/src/lib/general/gr_correlate_access_code_bb.cc
     2007-01-02 14:45:28 UTC (rev 4216)
+++ 
gnuradio/branches/developers/trondeau/digital-wip2/gnuradio-core/src/lib/general/gr_correlate_access_code_bb.cc
     2007-01-02 23:50:32 UTC (rev 4217)
@@ -45,7 +45,7 @@
                   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)){
@@ -88,13 +88,13 @@
 {
   const unsigned char *in = (const unsigned char *) input_items[0];
   unsigned char *out = (unsigned char *) output_items[0];
-  
+
   for (int i = 0; i < noutput_items; i++){
 
     // 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,13 +106,17 @@
     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) || (nwrong >= (64-d_threshold));
+    new_flag = (nwrong <= d_threshold);
 
-#if 0   
+#if 0
     if(new_flag) {
-      printf("%llx  ==>  %llx  :  d_flip=%u\n", d_access_code, d_data_reg, 
d_flip);
+      fprintf("access code found (%llx)\n", d_access_code);
     }
+    else {
+      printf("%llx  ==>  %llx\n", d_access_code, d_data_reg);
+    }
 #endif
 
     // shift in new data and new flag
@@ -120,7 +124,6 @@
     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
     }
   }
 

Modified: 
gnuradio/branches/developers/trondeau/digital-wip2/gnuradio-core/src/lib/general/gr_correlate_access_code_bb.h
===================================================================
--- 
gnuradio/branches/developers/trondeau/digital-wip2/gnuradio-core/src/lib/general/gr_correlate_access_code_bb.h
      2007-01-02 14:45:28 UTC (rev 4216)
+++ 
gnuradio/branches/developers/trondeau/digital-wip2/gnuradio-core/src/lib/general/gr_correlate_access_code_bb.h
      2007-01-02 23:50:32 UTC (rev 4217)
@@ -62,7 +62,6 @@
   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:





reply via email to

[Prev in Thread] Current Thread [Next in Thread]