noiseFloor -> noiseFigure (bug 543)
This commit is contained in:
@@ -137,15 +137,15 @@ InterferenceHelper::GetMaxPacketDuration (void) const
|
||||
}
|
||||
|
||||
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 @@ InterferenceHelper::CalculateSnr (double signal, double noiseInterference, WifiM
|
||||
{
|
||||
// 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;
|
||||
|
||||
@@ -50,10 +50,10 @@ public:
|
||||
~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 @@ private:
|
||||
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;
|
||||
|
||||
@@ -93,11 +93,17 @@ YansWifiPhy::GetTypeId (void)
|
||||
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 @@ YansWifiPhy::SetStandard (enum WifiPhyStandard standard)
|
||||
|
||||
|
||||
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 @@ YansWifiPhy::SetMobility (Ptr<Object> mobility)
|
||||
}
|
||||
|
||||
double
|
||||
YansWifiPhy::GetRxNoise (void) const
|
||||
YansWifiPhy::GetRxNoiseFigure (void) const
|
||||
{
|
||||
return RatioToDb (m_interference.GetNoiseFloorW ());
|
||||
return RatioToDb (m_interference.GetNoiseFigure ());
|
||||
}
|
||||
double
|
||||
YansWifiPhy::GetTxPowerStart (void) const
|
||||
|
||||
@@ -75,7 +75,7 @@ public:
|
||||
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 @@ public:
|
||||
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;
|
||||
|
||||
Reference in New Issue
Block a user