From ce9e786d2344cb29552fab462e860e3daa2cd0bb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Deronne?= Date: Sat, 11 Jul 2015 00:59:27 +0200 Subject: [PATCH] improve readibility of snr values --- src/wifi/model/interference-helper.cc | 4 ++-- src/wifi/model/yans-wifi-phy.cc | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/wifi/model/interference-helper.cc b/src/wifi/model/interference-helper.cc index 3d071c686..feef1f2d7 100644 --- a/src/wifi/model/interference-helper.cc +++ b/src/wifi/model/interference-helper.cc @@ -243,8 +243,8 @@ InterferenceHelper::CalculateSnr (double signal, double noiseInterference, WifiM //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; } diff --git a/src/wifi/model/yans-wifi-phy.cc b/src/wifi/model/yans-wifi-phy.cc index c2b9f996b..e89660b5f 100644 --- a/src/wifi/model/yans-wifi-phy.cc +++ b/src/wifi/model/yans-wifi-phy.cc @@ -728,7 +728,7 @@ YansWifiPhy::StartReceivePacket (Ptr packet, 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 @@ YansWifiPhy::EndReceive (Ptr packet, enum WifiPreamble preamble, struct 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) {