--- a/src/devices/wifi/interference-helper.cc Thu Apr 09 15:17:28 2009 +0100
+++ b/src/devices/wifi/interference-helper.cc Wed Apr 15 13:56:01 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;
--- a/src/devices/wifi/interference-helper.h Thu Apr 09 15:17:28 2009 +0100
+++ b/src/devices/wifi/interference-helper.h Wed Apr 15 13:56:01 2009 +0200
@@ -50,10 +50,10 @@
~InterferenceHelper ();
void Configure80211aParameters (void);
- void SetNoiseFloorW (double noiseFloor);
+ void SetNoiseFigure (double value);
void SetErrorRateModel (Ptr<ErrorRateModel> rate);
- double GetNoiseFloorW (void) const;
+ double GetNoiseFigure (void) const;
Ptr<ErrorRateModel> 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<ErrorRateModel> m_errorRateModel;
--- a/src/devices/wifi/yans-wifi-phy.cc Thu Apr 09 15:17:28 2009 +0100
+++ b/src/devices/wifi/yans-wifi-phy.cc Wed Apr 15 13:56:01 2009 +0200
@@ -93,11 +93,17 @@
MakeDoubleAccessor (&YansWifiPhy::SetTxPowerStart,
&YansWifiPhy::GetTxPowerStart),
MakeDoubleChecker<double> ())
- .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."
+ " According to Wikipedia (http://en.wikipedia.org/wiki/Noise_figure), 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)\"."
+ " For",
DoubleValue (7),
- MakeDoubleAccessor (&YansWifiPhy::SetRxNoise,
- &YansWifiPhy::GetRxNoise),
+ MakeDoubleAccessor (&YansWifiPhy::SetRxNoiseFigure,
+ &YansWifiPhy::GetRxNoiseFigure),
MakeDoubleChecker<double> ())
.AddAttribute ("Standard", "The standard chosen configures a set of transmission modes"
" and some PHY-specific constants.",
@@ -155,10 +161,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 +225,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
--- a/src/devices/wifi/yans-wifi-phy.h Thu Apr 09 15:17:28 2009 +0100
+++ b/src/devices/wifi/yans-wifi-phy.h Wed Apr 15 13:56:01 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<ErrorRateModel> rate);
void SetDevice (Ptr<Object> device);
void SetMobility (Ptr<Object> mobility);
- double GetRxNoise (void) const;
+ double GetRxNoiseFigure (void) const;
double GetTxGain (void) const;
double GetRxGain (void) const;
double GetEdThreshold (void) const;