improve readibility of snr values
authorS?bastien Deronne <sebastien.deronne@gmail.com>
Sat, 11 Jul 2015 00:59:27 +0200
changeset 11491 dfb21289dde4
parent 11490 4e23f40d0df5
child 11492 2e3b8610f78b
improve readibility of snr values
src/wifi/model/interference-helper.cc
src/wifi/model/yans-wifi-phy.cc
--- a/src/wifi/model/interference-helper.cc	Thu Jul 09 15:13:34 2015 -0700
+++ b/src/wifi/model/interference-helper.cc	Sat Jul 11 00:59:27 2015 +0200
@@ -243,8 +243,8 @@
   //receiver noise Floor (W) which accounts for thermal noise and non-idealities of the receiver
   double noiseFloor = m_noiseFigure * Nt;
   double noise = noiseFloor + noiseInterference;
-  double snr = signal / noise;
-  NS_LOG_DEBUG ("signal= " << signal << ", noise=" << noiseFloor << ", interference=" << noiseInterference << ", snr=" << snr);
+  double snr = signal / noise; //linear scale
+  NS_LOG_DEBUG ("signal(W)= " << signal << ", noise(W)=" << noiseFloor << ", interference(W)=" << noiseInterference << ", snr(linear)=" << snr);
   return snr;
 }
 
--- a/src/wifi/model/yans-wifi-phy.cc	Thu Jul 09 15:13:34 2015 -0700
+++ b/src/wifi/model/yans-wifi-phy.cc	Sat Jul 11 00:59:27 2015 +0200
@@ -728,7 +728,7 @@
   struct InterferenceHelper::SnrPer snrPer;
   snrPer = m_interference.CalculatePlcpHeaderSnrPer (event);
 
-  NS_LOG_DEBUG ("snr=" << snrPer.snr << ", per=" << snrPer.per);
+  NS_LOG_DEBUG ("snr(dB)=" << RatioToDb(snrPer.snr) << ", per=" << snrPer.per);
 
   if (m_random->GetValue () > snrPer.per)   //plcp reception succeeded
     {
@@ -1094,7 +1094,7 @@
   if (m_plcpSuccess == true)
     {
       NS_LOG_DEBUG ("mode=" << (event->GetPayloadMode ().GetDataRate ()) <<
-                    ", snr=" << snrPer.snr << ", per=" << snrPer.per << ", size=" << packet->GetSize ());
+                    ", snr(dB)=" << RatioToDb(snrPer.snr) << ", per=" << snrPer.per << ", size=" << packet->GetSize ());
 
       if (m_random->GetValue () > snrPer.per)
         {