commit-gnuradio
[Top][All Lists]
Advanced

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

[Commit-gnuradio] r8010 - gnuradio/branches/developers/trondeau/ofdm/gnu


From: trondeau
Subject: [Commit-gnuradio] r8010 - gnuradio/branches/developers/trondeau/ofdm/gnuradio-core/src/lib/general
Date: Wed, 12 Mar 2008 17:28:38 -0600 (MDT)

Author: trondeau
Date: 2008-03-12 17:28:38 -0600 (Wed, 12 Mar 2008)
New Revision: 8010

Modified:
   
gnuradio/branches/developers/trondeau/ofdm/gnuradio-core/src/lib/general/gr_ofdm_frame_sink.cc
   
gnuradio/branches/developers/trondeau/ofdm/gnuradio-core/src/lib/general/gr_ofdm_mapper_bcv.cc
Log:
More hacking to pack in carries on the side if they isn't a multiple of four. 
Something somewhere else down the line is preventing the receiver from working 
if we don't use an occupied_tones evenly disivible by four.

Modified: 
gnuradio/branches/developers/trondeau/ofdm/gnuradio-core/src/lib/general/gr_ofdm_frame_sink.cc
===================================================================
--- 
gnuradio/branches/developers/trondeau/ofdm/gnuradio-core/src/lib/general/gr_ofdm_frame_sink.cc
      2008-03-12 20:30:25 UTC (rev 8009)
+++ 
gnuradio/branches/developers/trondeau/ofdm/gnuradio-core/src/lib/general/gr_ofdm_frame_sink.cc
      2008-03-12 23:28:38 UTC (rev 8010)
@@ -204,17 +204,26 @@
   std::string carriers = "FE7F";
 
   // A bit hacky to fill out carriers to occupied_carriers length
-  int diff = (d_occupied_carriers/4 - carriers.length()); 
-  while(diff > 1) {
+  int diff = (d_occupied_carriers - 4*carriers.length()); 
+  while(diff > 7) {
     carriers.insert(0, "f");
     carriers.insert(carriers.length(), "f");
-    diff -= 2;
+    diff -= 8;
   }
-  if(diff) {                   // if there's an 
-    carriers.insert(0, "f");
+  
+  // if there's extras left to be processed
+  // put the first carriers onto the end if there's at least 4 carriers
+  if(diff >= 4) {
+    carriers.insert(carriers.length(), "f");
+    diff -= 4;
   }
+  // if we still have carriers left, stick them in front
+  if(diff) {
+    char c[2] = {0,0};
+    c[0] = (pow(2,diff) - 1) + 0x30;
+    carriers.insert(0, c);
+  }
 
-
   int i,j,k;
   for(i = 0; i < (int)(d_occupied_carriers/4); i++) {
     char c = carriers[i];

Modified: 
gnuradio/branches/developers/trondeau/ofdm/gnuradio-core/src/lib/general/gr_ofdm_mapper_bcv.cc
===================================================================
--- 
gnuradio/branches/developers/trondeau/ofdm/gnuradio-core/src/lib/general/gr_ofdm_mapper_bcv.cc
      2008-03-12 20:30:25 UTC (rev 8009)
+++ 
gnuradio/branches/developers/trondeau/ofdm/gnuradio-core/src/lib/general/gr_ofdm_mapper_bcv.cc
      2008-03-12 23:28:38 UTC (rev 8010)
@@ -61,15 +61,24 @@
   std::string carriers = "FE7F";
 
   // A bit hacky to fill out carriers to occupied_carriers length
-  int diff = (d_occupied_carriers/4 - carriers.length()); 
-  while(diff > 1) {
+  int diff = (d_occupied_carriers - 4*carriers.length()); 
+  while(diff > 7) {
     carriers.insert(0, "f");
     carriers.insert(carriers.length(), "f");
-    diff -= 2;
+    diff -= 8;
   }
-  if(diff) {                   // if there's an 
-    carriers.insert(0, "f");
+  // if there's extras left to be processed
+  // put the first carriers onto the end if there's at least 4 carriers
+  if(diff >= 4) {
+    carriers.insert(carriers.length(), "f");
+    diff -= 4;
   }
+  // if we still have carriers left, stick them in front
+  if(diff) {
+    char c[2] = {0,0};
+    c[0] = (pow(2,diff) - 1) + 0x30;
+    carriers.insert(0, c);
+  }
   
   // find out how many zeros to pad on the sides; the difference between the 
fft length and the subcarrier
   // mapping size in chunks of four. This is the number to pack on the left 
and this number plus any 





reply via email to

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