From 2dc5d96c9aef068a868d4234addebc4d2d0bcb5b Mon Sep 17 00:00:00 2001 From: Marco Miozzo Date: Thu, 12 Jan 2012 17:40:46 +0100 Subject: [PATCH] Remove CB size quantization error in evaluating the error distribution --- src/lte/model/lte-mi-error-model.cc | 22 +++++++++++++++++++++- 1 file changed, 21 insertions(+), 1 deletion(-) diff --git a/src/lte/model/lte-mi-error-model.cc b/src/lte/model/lte-mi-error-model.cc index defeaabc0..a471ae5c2 100644 --- a/src/lte/model/lte-mi-error-model.cc +++ b/src/lte/model/lte-mi-error-model.cc @@ -31,7 +31,7 @@ #include #include "stdlib.h" #include -#include // for DEBUGing +//#include // for DEBUGing @@ -303,7 +303,27 @@ LteMiErrorModel::MappingMiBler (double mib, uint8_t mcs, uint16_t cbSize) NS_LOG_FUNCTION (" MCS " << (uint16_t)mcs << " TBS " << tbsIndex << " CB size " << cbSize << " CB size curve " << cbMiSizeTable[cbIndex]); b = bEcrTable[cbIndex][tbsIndex]; + if (b<0.0) + { + //take the lowest CB size including this CB for removing CB size + //quatization errors + int i = cbIndex; + while (b<0) + { + b = bEcrTable[i++][tbsIndex]; + } + } c = cEcrTable[cbIndex][tbsIndex]; + if (c<0.0) + { + //take the lowest CB size including this CB for removing CB size + //quatization errors + int i = cbIndex; + while (c<0) + { + c = cEcrTable[i++][tbsIndex]; + } + } // see IEEE802.16m EMD formula 55 of section 4.3.2.1 double bler = 0.5*( 1 - erf((mib-b)/(sqrt(2)*c)) ); NS_LOG_FUNCTION ("MIB: " << mib << " BLER:" << bler);