diff -r 33085beb900d src/devices/wifi/interference-helper.cc --- a/src/devices/wifi/interference-helper.cc Mon Apr 06 22:05:02 2009 -0700 +++ b/src/devices/wifi/interference-helper.cc Wed Apr 08 15:01:35 2009 +0200 @@ -137,15 +137,15 @@ } void -InterferenceHelper::SetNoiseFloorW (double noiseFloor) +InterferenceHelper::SetNoiseFigure (double value) { - m_noiseFloorW = noiseFloor; + m_noiseFigure = value; } double -InterferenceHelper::GetNoiseFloorW (void) const +InterferenceHelper::GetNoiseFigure (void) const { - return m_noiseFloorW; + return m_noiseFigure; } void @@ -260,9 +260,10 @@ { // thermal noise at 290K in J/s = W static const double BOLTZMANN = 1.3803e-23; + // Nt is the power of thermal noise in W double Nt = BOLTZMANN * 290.0 * mode.GetBandwidth (); - // receiver noise Floor (W) - double noiseFloor = m_noiseFloorW * Nt; + // 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; return snr; diff -r 33085beb900d src/devices/wifi/interference-helper.h --- a/src/devices/wifi/interference-helper.h Mon Apr 06 22:05:02 2009 -0700 +++ b/src/devices/wifi/interference-helper.h Wed Apr 08 15:01:35 2009 +0200 @@ -50,10 +50,10 @@ ~InterferenceHelper (); void Configure80211aParameters (void); - void SetNoiseFloorW (double noiseFloor); + void SetNoiseFigure (double value); void SetErrorRateModel (Ptr rate); - double GetNoiseFloorW (void) const; + double GetNoiseFigure (void) const; Ptr GetErrorRateModel (void) const; @@ -99,7 +99,7 @@ WifiMode m_shortPlcpHeaderMode; uint32_t m_plcpHeaderLength; Time m_maxPacketDuration; - double m_noiseFloorW; + double m_noiseFigure; /**< noise figure (linear) */ Events m_events; bool m_80211a; Ptr m_errorRateModel; diff -r 33085beb900d src/devices/wifi/yans-wifi-phy.cc --- a/src/devices/wifi/yans-wifi-phy.cc Mon Apr 06 22:05:02 2009 -0700 +++ b/src/devices/wifi/yans-wifi-phy.cc Wed Apr 08 15:01:35 2009 +0200 @@ -93,11 +93,15 @@ MakeDoubleAccessor (&YansWifiPhy::SetTxPowerStart, &YansWifiPhy::GetTxPowerStart), MakeDoubleChecker ()) - .AddAttribute ("RxNoise", - "Ratio of energy lost by receiver (dB).", + .AddAttribute ("RxNoiseFigure", + "Loss (dB) in the Signal-to-Noise-Ratio due to non-idealities in the receiver." + " Quoting Wikipedia, this is \"the difference in decibels (dB) between" + " the noise output of the actual receiver to the noise output of an " + " ideal receiver with the same overall gain and bandwidth when the receivers " + " are connected to sources at the standard noise temperature T0 (usually 290 K)\". ", DoubleValue (7), - MakeDoubleAccessor (&YansWifiPhy::SetRxNoise, - &YansWifiPhy::GetRxNoise), + MakeDoubleAccessor (&YansWifiPhy::SetRxNoiseFigure, + &YansWifiPhy::GetRxNoiseFigure), MakeDoubleChecker ()) .AddAttribute ("Standard", "The standard chosen configures a set of transmission modes" " and some PHY-specific constants.", @@ -155,10 +159,10 @@ void -YansWifiPhy::SetRxNoise (double db) +YansWifiPhy::SetRxNoiseFigure (double noiseFigureDb) { - NS_LOG_FUNCTION (this << db); - m_interference.SetNoiseFloorW (DbToRatio (db)); + NS_LOG_FUNCTION (this << noiseFigureDb); + m_interference.SetNoiseFigure (DbToRatio (noiseFigureDb)); } void YansWifiPhy::SetTxPowerStart (double start) @@ -219,9 +223,9 @@ } double -YansWifiPhy::GetRxNoise (void) const +YansWifiPhy::GetRxNoiseFigure (void) const { - return RatioToDb (m_interference.GetNoiseFloorW ()); + return RatioToDb (m_interference.GetNoiseFigure ()); } double YansWifiPhy::GetTxPowerStart (void) const diff -r 33085beb900d src/devices/wifi/yans-wifi-phy.h --- a/src/devices/wifi/yans-wifi-phy.h Mon Apr 06 22:05:02 2009 -0700 +++ b/src/devices/wifi/yans-wifi-phy.h Wed Apr 08 15:01:35 2009 +0200 @@ -75,7 +75,7 @@ WifiPreamble preamble); void SetStandard (enum WifiPhyStandard standard); - void SetRxNoise (double ratio); + void SetRxNoiseFigure (double noiseFigureDb); void SetTxPowerStart (double start); void SetTxPowerEnd (double end); void SetNTxPower (uint32_t n); @@ -86,7 +86,7 @@ void SetErrorRateModel (Ptr rate); void SetDevice (Ptr device); void SetMobility (Ptr mobility); - double GetRxNoise (void) const; + double GetRxNoiseFigure (void) const; double GetTxGain (void) const; double GetRxGain (void) const; double GetEdThreshold (void) const;