commit-gnuradio
[Top][All Lists]
Advanced

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

[Commit-gnuradio] r7841 - gnuradio/branches/developers/trondeau/ofdmtimi


From: trondeau
Subject: [Commit-gnuradio] r7841 - gnuradio/branches/developers/trondeau/ofdmtiming/gnuradio-core/src/lib/general
Date: Tue, 26 Feb 2008 12:51:19 -0700 (MST)

Author: trondeau
Date: 2008-02-26 12:51:18 -0700 (Tue, 26 Feb 2008)
New Revision: 7841

Modified:
   
gnuradio/branches/developers/trondeau/ofdmtiming/gnuradio-core/src/lib/general/gr_ofdm_sampler.cc
Log:
Fixed the number of items consumed when dealing with the preamble; also made a 
few other cosmetic changes.

Modified: 
gnuradio/branches/developers/trondeau/ofdmtiming/gnuradio-core/src/lib/general/gr_ofdm_sampler.cc
===================================================================
--- 
gnuradio/branches/developers/trondeau/ofdmtiming/gnuradio-core/src/lib/general/gr_ofdm_sampler.cc
   2008-02-26 19:04:26 UTC (rev 7840)
+++ 
gnuradio/branches/developers/trondeau/ofdmtiming/gnuradio-core/src/lib/general/gr_ofdm_sampler.cc
   2008-02-26 19:51:18 UTC (rev 7841)
@@ -55,14 +55,15 @@
     ninput_items_required[i] = nreqd;
 }
 
+
 int
 gr_ofdm_sampler::general_work (int noutput_items,
                               gr_vector_int &ninput_items,
                               gr_vector_const_void_star &input_items,
                               gr_vector_void_star &output_items)
 {
-  gr_complex *iptr = (gr_complex *) input_items[0];
-  char *trigger = (char *) input_items[1];
+  const gr_complex *iptr = (const gr_complex *) input_items[0];
+  const char *trigger = (const char *) input_items[1];
 
   gr_complex *optr = (gr_complex *) output_items[0];
   char *outsig = (char *) output_items[1];
@@ -93,7 +94,7 @@
     }
 
     d_state = STATE_FRAME;
-    consume_each(index - d_fft_length + 2); // consume up to one fft_length 
away to keep the history
+    consume_each(index - d_fft_length + 1); // consume up to one fft_length 
away to keep the history
     ret = 1;
     break;
     
@@ -103,8 +104,8 @@
     //FIXME: we could also have a power squelch system here to enter 
STATE_NO_SIG if no power is received
 
     // skip over fft length history and cyclic prefix
-    pos = d_symbol_length;  // keeps track of where we are in the input buffer
-    for(i=0; i < d_fft_length; i++) {
+    pos = d_symbol_length;         // keeps track of where we are in the input 
buffer
+    while(pos < d_symbol_length + d_fft_length) {
       *optr++ = iptr[pos++];
     }
 
@@ -113,11 +114,11 @@
     break;
 
   case(STATE_NO_SIG):
-  default: 
+  default:
     consume_each(index-d_fft_length); // consume everything we've gone through 
so far leaving the fft length history
     ret = 0;
     break;
- }
+  }
 
   return ret;
 }





reply via email to

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