View | Details | Raw Unified | Return to bug 543
Collapse All | Expand All

(-)a/src/devices/wifi/interference-helper.cc (-6 / +7 lines)
 Lines 137-151    Link Here 
137
}
137
}
138
138
139
void 
139
void 
140
InterferenceHelper::SetNoiseFloorW (double noiseFloor)
140
InterferenceHelper::SetNoiseFigure (double value)
141
{
141
{
142
  m_noiseFloorW = noiseFloor;
142
  m_noiseFigure = value;
143
}
143
}
144
144
145
double 
145
double 
146
InterferenceHelper::GetNoiseFloorW (void) const
146
InterferenceHelper::GetNoiseFigure (void) const
147
{
147
{
148
  return m_noiseFloorW;
148
  return m_noiseFigure;
149
}
149
}
150
150
151
void 
151
void 
 Lines 260-268    Link Here 
260
{
260
{
261
  // thermal noise at 290K in J/s = W
261
  // thermal noise at 290K in J/s = W
262
  static const double BOLTZMANN = 1.3803e-23;
262
  static const double BOLTZMANN = 1.3803e-23;
263
  // Nt is the power of thermal noise in W
263
  double Nt = BOLTZMANN * 290.0 * mode.GetBandwidth ();
264
  double Nt = BOLTZMANN * 290.0 * mode.GetBandwidth ();
264
  // receiver noise Floor (W)
265
  // receiver noise Floor (W) which accounts for thermal noise and non-idealities of the receiver
265
  double noiseFloor = m_noiseFloorW * Nt;
266
  double noiseFloor = m_noiseFigure * Nt;
266
  double noise = noiseFloor + noiseInterference;
267
  double noise = noiseFloor + noiseInterference;
267
  double snr = signal / noise;
268
  double snr = signal / noise;
268
  return snr;
269
  return snr;
(-)a/src/devices/wifi/interference-helper.h (-3 / +3 lines)
 Lines 50-59    Link Here 
50
  ~InterferenceHelper ();
50
  ~InterferenceHelper ();
51
51
52
  void Configure80211aParameters (void);
52
  void Configure80211aParameters (void);
53
  void SetNoiseFloorW (double noiseFloor);
53
  void SetNoiseFigure (double value);
54
  void SetErrorRateModel (Ptr<ErrorRateModel> rate);
54
  void SetErrorRateModel (Ptr<ErrorRateModel> rate);
55
55
56
  double GetNoiseFloorW (void) const;
56
  double GetNoiseFigure (void) const;
57
  Ptr<ErrorRateModel> GetErrorRateModel (void) const;
57
  Ptr<ErrorRateModel> GetErrorRateModel (void) const;
58
58
59
59
 Lines 99-105    Link Here 
99
  WifiMode m_shortPlcpHeaderMode;
99
  WifiMode m_shortPlcpHeaderMode;
100
  uint32_t m_plcpHeaderLength;
100
  uint32_t m_plcpHeaderLength;
101
  Time m_maxPacketDuration;
101
  Time m_maxPacketDuration;
102
  double m_noiseFloorW;
102
  double m_noiseFigure; /**< noise figure (linear) */
103
  Events m_events;
103
  Events m_events;
104
  bool m_80211a;
104
  bool m_80211a;
105
  Ptr<ErrorRateModel> m_errorRateModel;
105
  Ptr<ErrorRateModel> m_errorRateModel;
(-)a/src/devices/wifi/yans-wifi-phy.cc (-9 / +13 lines)
 Lines 93-103    Link Here 
93
                   MakeDoubleAccessor (&YansWifiPhy::SetTxPowerStart, 
93
                   MakeDoubleAccessor (&YansWifiPhy::SetTxPowerStart, 
94
                                       &YansWifiPhy::GetTxPowerStart),
94
                                       &YansWifiPhy::GetTxPowerStart),
95
                   MakeDoubleChecker<double> ())
95
                   MakeDoubleChecker<double> ())
96
    .AddAttribute ("RxNoise",
96
    .AddAttribute ("RxNoiseFigure",
97
                   "Ratio of energy lost by receiver (dB).",
97
                   "Loss (dB) in the Signal-to-Noise-Ratio due to non-idealities in the receiver."
98
                   " Quoting Wikipedia, this is \"the difference in decibels (dB) between"
99
                   " the noise output of the actual receiver to the noise output of an "
100
                   " ideal receiver with the same overall gain and bandwidth when the receivers "
101
                   " are connected to sources at the standard noise temperature T0 (usually 290 K)\". ",
98
                   DoubleValue (7),
102
                   DoubleValue (7),
99
                   MakeDoubleAccessor (&YansWifiPhy::SetRxNoise,
103
                   MakeDoubleAccessor (&YansWifiPhy::SetRxNoiseFigure,
100
                                       &YansWifiPhy::GetRxNoise),
104
                                       &YansWifiPhy::GetRxNoiseFigure),
101
                   MakeDoubleChecker<double> ())
105
                   MakeDoubleChecker<double> ())
102
    .AddAttribute ("Standard", "The standard chosen configures a set of transmission modes"
106
    .AddAttribute ("Standard", "The standard chosen configures a set of transmission modes"
103
                   " and some PHY-specific constants.",
107
                   " and some PHY-specific constants.",
 Lines 155-164    Link Here 
155
159
156
160
157
void 
161
void 
158
YansWifiPhy::SetRxNoise (double db)
162
YansWifiPhy::SetRxNoiseFigure (double noiseFigureDb)
159
{
163
{
160
  NS_LOG_FUNCTION (this << db);
164
  NS_LOG_FUNCTION (this << noiseFigureDb);
161
  m_interference.SetNoiseFloorW (DbToRatio (db));
165
  m_interference.SetNoiseFigure (DbToRatio (noiseFigureDb));
162
}
166
}
163
void 
167
void 
164
YansWifiPhy::SetTxPowerStart (double start)
168
YansWifiPhy::SetTxPowerStart (double start)
 Lines 219-227    Link Here 
219
}
223
}
220
224
221
double 
225
double 
222
YansWifiPhy::GetRxNoise (void) const
226
YansWifiPhy::GetRxNoiseFigure (void) const
223
{
227
{
224
  return RatioToDb (m_interference.GetNoiseFloorW ());
228
  return RatioToDb (m_interference.GetNoiseFigure ());
225
}
229
}
226
double 
230
double 
227
YansWifiPhy::GetTxPowerStart (void) const
231
YansWifiPhy::GetTxPowerStart (void) const
(-)a/src/devices/wifi/yans-wifi-phy.h (-2 / +2 lines)
 Lines 75-81    Link Here 
75
                           WifiPreamble preamble);
75
                           WifiPreamble preamble);
76
76
77
  void SetStandard (enum WifiPhyStandard standard);
77
  void SetStandard (enum WifiPhyStandard standard);
78
  void SetRxNoise (double ratio);
78
  void SetRxNoiseFigure (double noiseFigureDb);
79
  void SetTxPowerStart (double start);
79
  void SetTxPowerStart (double start);
80
  void SetTxPowerEnd (double end);
80
  void SetTxPowerEnd (double end);
81
  void SetNTxPower (uint32_t n);
81
  void SetNTxPower (uint32_t n);
 Lines 86-92    Link Here 
86
  void SetErrorRateModel (Ptr<ErrorRateModel> rate);
86
  void SetErrorRateModel (Ptr<ErrorRateModel> rate);
87
  void SetDevice (Ptr<Object> device);
87
  void SetDevice (Ptr<Object> device);
88
  void SetMobility (Ptr<Object> mobility);
88
  void SetMobility (Ptr<Object> mobility);
89
  double GetRxNoise (void) const;
89
  double GetRxNoiseFigure (void) const;
90
  double GetTxGain (void) const;
90
  double GetTxGain (void) const;
91
  double GetRxGain (void) const;
91
  double GetRxGain (void) const;
92
  double GetEdThreshold (void) const;
92
  double GetEdThreshold (void) const;

Return to bug 543