Bug 1888 - COST231 propagation loss model: corrections
authorBiljana Bojović <biljana.bojovic@gmail.com>
Wed, 26 Mar 2014 23:47:30 +0100
changeset 10684 156ee4e1f4aa
parent 10683 3347a2736785
child 10685 57d0311475c8
Bug 1888 - COST231 propagation loss model: corrections
RELEASE_NOTES
src/propagation/model/cost231-propagation-loss-model.cc
--- a/RELEASE_NOTES	Wed Mar 26 23:39:32 2014 +0100
+++ b/RELEASE_NOTES	Wed Mar 26 23:47:30 2014 +0100
@@ -62,6 +62,7 @@
 - Bug 1882 - int64x64 tests trigger valgrind bug
 - Bug 1883 - IPv6 don't consider the prefix and network when choosing output address
 - Bug 1887 - Point-to-point traces should contain PPP headers
+- Bug 1888 - COST231 propagation loss model: corrections
 - Bug 1889 - PointToPointNetDevive: In some cases MacTxDrop trace is not called
 - Bug 1890 - UdpClientTrace: MPEG frame size is squeezed into (insufficient) 16 bit integer
 - Bug 1891 - UdpSocketImpl::GetSockName doesn't return the IPv6 address
--- a/src/propagation/model/cost231-propagation-loss-model.cc	Wed Mar 26 23:39:32 2014 +0100
+++ b/src/propagation/model/cost231-propagation-loss-model.cc	Wed Mar 26 23:47:30 2014 +0100
@@ -166,15 +166,18 @@
       return 0.0;
     }
 
-  double log_f = std::log (m_frequency / 1000000000) / 2.302;
-  double C_H = 0.8 + ((1.11 * log_f) - 0.7) * m_SSAntennaHeight - (1.56 * log_f);
-  double log_BSH = std::log (m_BSAntennaHeight) / 2.303;
+  double frequency_MHz = m_frequency * 1e-6;
+
+  double distance_km = distance * 1e-3;
+
+  double C_H = 0.8 + ((1.11 * std::log10(frequency_MHz)) - 0.7) * m_SSAntennaHeight - (1.56 * std::log10(frequency_MHz));
 
   // from the COST231 wiki entry
-  // 2.303 is for the logarithm base change
+  // See also http://www.lx.it.pt/cost231/final_report.htm
+  // Ch. 4, eq. 4.4.3, pg. 135
 
-  double loss_in_db = 46.3 + (33.9 * log_f) - (13.82 * log_BSH) - C_H + ((44.9 - 6.55 * log_BSH) * std::log (distance)
-                                                                         / 2.303) + C + m_shadowing;
+  double loss_in_db = 46.3 + (33.9 * std::log10(frequency_MHz)) - (13.82 * std::log10 (m_BSAntennaHeight)) - C_H
+		  	  	  + ((44.9 - 6.55 * std::log10 (m_BSAntennaHeight)) * std::log10 (distance_km)) + C + m_shadowing;
 
   NS_LOG_DEBUG ("dist =" << distance << ", Path Loss = " << loss_in_db);