LENA-226 adjust coding style in LteFfConverter (lte-common.cc)
authorMarco Miozzo <marco.miozzo@cttc.es>
Tue, 13 Mar 2012 11:00:13 +0100
changeset 8680 6f04863cf772
parent 8675 e65859f03e99
child 8681 420e472419eb
LENA-226 adjust coding style in LteFfConverter (lte-common.cc)
src/lte/model/lte-common.cc
--- a/src/lte/model/lte-common.cc	Thu Mar 08 12:18:49 2012 +0100
+++ b/src/lte/model/lte-common.cc	Tue Mar 13 11:00:13 2012 +0100
@@ -79,9 +79,15 @@
 {
   // convert from double to fixed point notation Sxxxxxxxxxxx.xxx
   // truncate val to notation limits
-  if (val > 4095.88) val = 4095.88;
-  if (val < -4096) val = -4096;
-  int16_t valFp = (int16_t)(val * pow (2, 3));
+  if (val > 4095.88)
+    {
+      val = 4095.88;
+    }
+  if (val < -4096)
+    {
+      val = -4096;
+    }
+  int16_t valFp = (int16_t)(val * 8);
   return (valFp);
 }
 
@@ -89,7 +95,7 @@
 LteFfConverter::fpS11dot3toDouble (uint16_t val)
 {
   // convert from fixed point notation Sxxxxxxxxxxx.xxx to double
-  double valD = ((int16_t)val) / pow (2, 3);
+  double valD = ((int16_t)val) / 8.0;
   return (valD);
 }