--- 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);
}