commit-gnuradio
[Top][All Lists]
Advanced

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

[Commit-gnuradio] r7088 - gnuradio/branches/developers/trondeau/ofdm2/gn


From: trondeau
Subject: [Commit-gnuradio] r7088 - gnuradio/branches/developers/trondeau/ofdm2/gnuradio-core/src/lib/general
Date: Sat, 8 Dec 2007 10:41:57 -0700 (MST)

Author: trondeau
Date: 2007-12-08 10:41:56 -0700 (Sat, 08 Dec 2007)
New Revision: 7088

Modified:
   
gnuradio/branches/developers/trondeau/ofdm2/gnuradio-core/src/lib/general/gr_ofdm_frame_sink.cc
   
gnuradio/branches/developers/trondeau/ofdm2/gnuradio-core/src/lib/general/gr_ofdm_mapper_bcv.cc
Log:
Grrr... Apparently, static data type conversions and math are not necessarily 
the same. This fixes the bug in generating QAM64 and 8PSK constellations in the 
OFDM system.

Modified: 
gnuradio/branches/developers/trondeau/ofdm2/gnuradio-core/src/lib/general/gr_ofdm_frame_sink.cc
===================================================================
--- 
gnuradio/branches/developers/trondeau/ofdm2/gnuradio-core/src/lib/general/gr_ofdm_frame_sink.cc
     2007-12-08 05:24:39 UTC (rev 7087)
+++ 
gnuradio/branches/developers/trondeau/ofdm2/gnuradio-core/src/lib/general/gr_ofdm_frame_sink.cc
     2007-12-08 17:41:56 UTC (rev 7088)
@@ -216,7 +216,7 @@
 
   d_sym_position  = sym_position;
   d_sym_value_out = sym_value_out;
-  d_nbits = (unsigned long)(log10(d_sym_value_out.size()) / log10(2));
+  d_nbits = (unsigned long)ceil(log10(d_sym_value_out.size()) / log10(2));
 
   return true;
 }

Modified: 
gnuradio/branches/developers/trondeau/ofdm2/gnuradio-core/src/lib/general/gr_ofdm_mapper_bcv.cc
===================================================================
--- 
gnuradio/branches/developers/trondeau/ofdm2/gnuradio-core/src/lib/general/gr_ofdm_mapper_bcv.cc
     2007-12-08 05:24:39 UTC (rev 7087)
+++ 
gnuradio/branches/developers/trondeau/ofdm2/gnuradio-core/src/lib/general/gr_ofdm_mapper_bcv.cc
     2007-12-08 17:41:56 UTC (rev 7088)
@@ -54,8 +54,8 @@
 {
   if (!(d_occupied_carriers <= d_fft_length))
     throw std::invalid_argument("gr_ofdm_mapper_bcv: occupied carriers must be 
<= fft_length");
-
-  d_nbits = (unsigned long)(log10(d_constellation.size()) / log10(2));
+  
+  d_nbits = (unsigned long)ceil(log10(d_constellation.size()) / log10(2.0));
 }
 
 gr_ofdm_mapper_bcv::~gr_ofdm_mapper_bcv(void)





reply via email to

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