commit-gnuradio
[Top][All Lists]
Advanced

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

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


From: trondeau
Subject: [Commit-gnuradio] r7990 - gnuradio/branches/developers/trondeau/ofdm/gnuradio-core/src/lib/general
Date: Tue, 11 Mar 2008 16:14:03 -0600 (MDT)

Author: trondeau
Date: 2008-03-11 16:14:02 -0600 (Tue, 11 Mar 2008)
New Revision: 7990

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:
Adding a crude bit of code to evenly fill out the occupied carriers with 1's if 
not specified. This is to allow the user to specify the number of occupied 
carriers while still hardcoding the DC carrier removal. I've also reduced the 
number of carriers removed around DC to just 2 (E7) instead of the previous 4 
(C3).

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-11 21:08:35 UTC (rev 7989)
+++ 
gnuradio/branches/developers/trondeau/ofdm/gnuradio-core/src/lib/general/gr_ofdm_frame_sink.cc
      2008-03-11 22:14:02 UTC (rev 7990)
@@ -201,9 +201,20 @@
     d_resid(0), 
d_nresid(0),d_phase(0),d_freq(0),d_phase_gain(phase_gain),d_freq_gain(freq_gain),
     d_eq_gain(0.05)
 {
-  std::string carriers;
-  carriers  = "ffffffffffffffffffffffffC3ffffffffffffffffffffffff";
+  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) {
+    carriers.insert(0, "f");
+    carriers.insert(carriers.length(), "f");
+    diff -= 2;
+  }
+  if(diff) {                   // if there's an 
+    carriers.insert(0, "f");
+  }
+
+
   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-11 21:08:35 UTC (rev 7989)
+++ 
gnuradio/branches/developers/trondeau/ofdm/gnuradio-core/src/lib/general/gr_ofdm_mapper_bcv.cc
      2008-03-11 22:14:02 UTC (rev 7990)
@@ -58,12 +58,23 @@
   // this is not the final form of this solution since we still use the 
occupied_tones concept,
   // which would get us into trouble if the number of carriers we seek is 
greater than the occupied carriers.
   // Eventually, we will get rid of the occupied_carriers concept.
-  std::string carriers = "ffffffffffffffffffffffffC3ffffffffffffffffffffffff";
+  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) {
+    carriers.insert(0, "f");
+    carriers.insert(carriers.length(), "f");
+    diff -= 2;
+  }
+  if(diff) {                   // if there's an 
+    carriers.insert(0, "f");
+  }
+  
   // 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 
   // residual nulls (if odd) will be packed on the right. 
-  int diff = (d_fft_length/4 - carriers.length())/2; 
+  diff = (d_fft_length/4 - carriers.length())/2; 
 
   int i,j,k;
   for(i = 0; i < carriers.length(); i++) {





reply via email to

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