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

(-)a/src/spectrum/model/wifi-spectrum-value-helper.cc (-59 / +40 lines)
 Lines 74-82    Link Here 
74
static std::map<WifiSpectrumModelId, Ptr<SpectrumModel> > g_wifiSpectrumModelMap; ///< static initializer for the class
74
static std::map<WifiSpectrumModelId, Ptr<SpectrumModel> > g_wifiSpectrumModelMap; ///< static initializer for the class
75
75
76
Ptr<SpectrumModel>
76
Ptr<SpectrumModel>
77
WifiSpectrumValueHelper::GetSpectrumModel (uint32_t centerFrequency, uint8_t channelWidth, double bandBandwidth, uint8_t guardBandwidth)
77
WifiSpectrumValueHelper::GetSpectrumModel (uint32_t centerFrequency, uint8_t channelWidth, double bandBandwidth, double guardBandwidth)
78
{
78
{
79
  NS_LOG_FUNCTION (centerFrequency << (uint16_t)channelWidth << bandBandwidth << (uint16_t)guardBandwidth);
79
  NS_LOG_FUNCTION (centerFrequency << (uint16_t)channelWidth << bandBandwidth << guardBandwidth);
80
  Ptr<SpectrumModel> ret;
80
  Ptr<SpectrumModel> ret;
81
  WifiSpectrumModelId key (centerFrequency, channelWidth, bandBandwidth);
81
  WifiSpectrumModelId key (centerFrequency, channelWidth, bandBandwidth);
82
  std::map<WifiSpectrumModelId, Ptr<SpectrumModel> >::iterator it = g_wifiSpectrumModelMap.find (key);
82
  std::map<WifiSpectrumModelId, Ptr<SpectrumModel> >::iterator it = g_wifiSpectrumModelMap.find (key);
 Lines 96-105    Link Here 
96
        {
96
        {
97
          // round up to the nearest odd number of subbands so that bands
97
          // round up to the nearest odd number of subbands so that bands
98
          // are symmetric around center frequency
98
          // are symmetric around center frequency
99
          NS_LOG_DEBUG ("Total bandwidth evenly divided by 312.5 KHz");
100
          numBands += 1;    
99
          numBands += 1;    
101
        }
100
        }
102
      NS_ASSERT_MSG (numBands % 2 == 1, "Number of bands should be odd");
101
      NS_ASSERT_MSG (numBands % 2 == 1, "Number of bands should be odd");
102
      NS_LOG_DEBUG ("Num bands " << numBands << " band bandwidth " << bandBandwidth);
103
      // lay down numBands/2 bands symmetrically around center frequency
103
      // lay down numBands/2 bands symmetrically around center frequency
104
      // and place an additional band at center frequency
104
      // and place an additional band at center frequency
105
      double startingFrequencyHz = centerFrequencyHz - (numBands/2 * bandBandwidth) - bandBandwidth/2;
105
      double startingFrequencyHz = centerFrequencyHz - (numBands/2 * bandBandwidth) - bandBandwidth/2;
 Lines 124-132    Link Here 
124
124
125
// Power allocated to 71 center subbands out of 135 total subbands in the band 
125
// Power allocated to 71 center subbands out of 135 total subbands in the band 
126
Ptr<SpectrumValue>
126
Ptr<SpectrumValue>
127
WifiSpectrumValueHelper::CreateDsssTxPowerSpectralDensity (uint32_t centerFrequency, double txPowerW, uint8_t guardBandwidth)
127
WifiSpectrumValueHelper::CreateDsssTxPowerSpectralDensity (uint32_t centerFrequency, double txPowerW, double guardBandwidth)
128
{
128
{
129
  NS_LOG_FUNCTION (centerFrequency << txPowerW << (uint16_t)guardBandwidth);
129
  NS_LOG_FUNCTION (centerFrequency << txPowerW << guardBandwidth);
130
  uint8_t channelWidth = 22;  // DSSS channels are 22 MHz wide
130
  uint8_t channelWidth = 22;  // DSSS channels are 22 MHz wide
131
  double bandBandwidth = 312500;
131
  double bandBandwidth = 312500;
132
  Ptr<SpectrumValue> c = Create<SpectrumValue> (GetSpectrumModel (centerFrequency, channelWidth, bandBandwidth, guardBandwidth));
132
  Ptr<SpectrumValue> c = Create<SpectrumValue> (GetSpectrumModel (centerFrequency, channelWidth, bandBandwidth, guardBandwidth));
 Lines 148-206    Link Here 
148
}
148
}
149
149
150
Ptr<SpectrumValue>
150
Ptr<SpectrumValue>
151
WifiSpectrumValueHelper::CreateOfdmTxPowerSpectralDensity (uint32_t centerFrequency, uint8_t channelWidth, double txPowerW, uint8_t guardBandwidth)
151
WifiSpectrumValueHelper::CreateOfdmTxPowerSpectralDensity (uint32_t centerFrequency, uint8_t channelWidth, double txPowerW, double guardBandwidth)
152
{
152
{
153
  NS_LOG_FUNCTION (centerFrequency << (uint16_t)channelWidth << txPowerW << (uint16_t)guardBandwidth);
153
  NS_LOG_FUNCTION (centerFrequency << (uint16_t)channelWidth << txPowerW << guardBandwidth);
154
  double bandBandwidth = 312500;
154
  double bandBandwidth = 0;
155
  switch (channelWidth)
156
    {
157
    case 20:
158
      bandBandwidth = 312500;
159
      break;
160
    case 10:
161
      bandBandwidth = 156250;
162
      break;
163
    case 5:
164
      bandBandwidth = 78125;
165
      break;
166
    default:
167
      NS_FATAL_ERROR ("Channel width " << (uint16_t) channelWidth << " should be correctly set.");
168
      return 0;
169
    }
170
155
  Ptr<SpectrumValue> c = Create<SpectrumValue> (GetSpectrumModel (centerFrequency, channelWidth, bandBandwidth, guardBandwidth));
171
  Ptr<SpectrumValue> c = Create<SpectrumValue> (GetSpectrumModel (centerFrequency, channelWidth, bandBandwidth, guardBandwidth));
156
  uint32_t nGuardBands = static_cast<uint32_t>(((2 * guardBandwidth * 1e6) / bandBandwidth) + 0.5);
172
  uint32_t nGuardBands = static_cast<uint32_t>(((2 * guardBandwidth * 1e6) / bandBandwidth) + 0.5);
157
  uint32_t nAllocatedBands = static_cast<uint32_t>(((channelWidth * 1e6) / bandBandwidth) + 0.5);
173
  uint32_t nAllocatedBands = static_cast<uint32_t>(((channelWidth * 1e6) / bandBandwidth) + 0.5);
158
  NS_ASSERT_MSG (c->GetSpectrumModel ()->GetNumBands () == (nAllocatedBands + nGuardBands + 1), "Unexpected number of bands " << c->GetSpectrumModel ()->GetNumBands ());
174
  NS_ASSERT_MSG (c->GetSpectrumModel ()->GetNumBands () == (nAllocatedBands + nGuardBands + 1), "Unexpected number of bands " << c->GetSpectrumModel ()->GetNumBands ());
159
  double txPowerPerBand = 0;
175
  // 52 subcarriers (48 data + 4 pilot)
160
  uint32_t start1 = 0;
176
  // skip guard band and 6 subbands, then place power in 26 subbands, then
161
  uint32_t stop1 = 0;
177
  // skip the center subband, then place power in 26 subbands, then skip
162
  uint32_t start2 = 0;
178
  // the final 6 subbands and the guard band.
163
  uint32_t stop2 = 0;
179
  double txPowerPerBand = txPowerW / 52;
164
  switch (channelWidth)
165
    {
166
    case 20:
167
      // 52 subcarriers (48 data + 4 pilot)
168
      // skip guard band and 6 subbands, then place power in 26 subbands, then
169
      // skip the center subband, then place power in 26 subbands, then skip
170
      // the final 6 subbands and the guard band.
171
      txPowerPerBand = txPowerW / 52;
172
      start1 = (nGuardBands / 2) + 6;
173
      stop1 = start1 + 26 - 1;
174
      start2 = stop1 + 2;
175
      stop2 = start2 + 26 - 1;
176
      break;
177
    case 10:
178
      // 28 subcarriers (24 data + 4 pilot)
179
      // skip guard band and 2 subbands, then place power in 14 subbands, then
180
      // skip the center subband, then place power in 14 subbands, then skip
181
      // the final 2 subbands and the guard band.
182
      txPowerPerBand = txPowerW / 28;
183
      start1 = (nGuardBands / 2) + 2;
184
      stop1 = start1 + 14 - 1;
185
      start2 = stop1 + 2;
186
      stop2 = start2 + 14 - 1;
187
      break;
188
    case 5:
189
      // 16 subcarriers (12 data + 4 pilot)
190
      // skip guard band and 2 subbands, then place power in 8 subbands, then
191
      // skip the center subband, then place power in 8 subbands, then skip
192
      // the final 2 subbands and the guard.
193
      txPowerPerBand = txPowerW / 16;
194
      start1 = (nGuardBands / 2) + 2;
195
      stop1 = start1 + 8 - 1;
196
      start2 = stop1 + 2;
197
      stop2 = start2 + 8 - 1;
198
      break;
199
    default:
200
      NS_FATAL_ERROR ("Channel width should be correctly set.");
201
      return 0;
202
    }
203
  NS_LOG_DEBUG ("Power per band " << txPowerPerBand);
180
  NS_LOG_DEBUG ("Power per band " << txPowerPerBand);
181
  uint32_t start1 = (nGuardBands / 2) + 6;
182
  uint32_t stop1 = start1 + 26 - 1;
183
  uint32_t start2 = stop1 + 2;
184
  uint32_t stop2 = start2 + 26 - 1;
204
  Values::iterator vit = c->ValuesBegin ();
185
  Values::iterator vit = c->ValuesBegin ();
205
  Bands::const_iterator bit = c->ConstBandsBegin ();
186
  Bands::const_iterator bit = c->ConstBandsBegin ();
206
  for (size_t i = 0; i < c->GetSpectrumModel ()->GetNumBands (); i++, vit++, bit++)
187
  for (size_t i = 0; i < c->GetSpectrumModel ()->GetNumBands (); i++, vit++, bit++)
 Lines 221-229    Link Here 
221
}
202
}
222
203
223
Ptr<SpectrumValue>
204
Ptr<SpectrumValue>
224
WifiSpectrumValueHelper::CreateHtOfdmTxPowerSpectralDensity (uint32_t centerFrequency, uint8_t channelWidth, double txPowerW, uint8_t guardBandwidth)
205
WifiSpectrumValueHelper::CreateHtOfdmTxPowerSpectralDensity (uint32_t centerFrequency, uint8_t channelWidth, double txPowerW, double guardBandwidth)
225
{
206
{
226
  NS_LOG_FUNCTION (centerFrequency << (uint16_t)channelWidth << txPowerW << (uint16_t)guardBandwidth);
207
  NS_LOG_FUNCTION (centerFrequency << (uint16_t)channelWidth << txPowerW << guardBandwidth);
227
  double bandBandwidth = 312500;
208
  double bandBandwidth = 312500;
228
  Ptr<SpectrumValue> c = Create<SpectrumValue> (GetSpectrumModel (centerFrequency, channelWidth, bandBandwidth, guardBandwidth));
209
  Ptr<SpectrumValue> c = Create<SpectrumValue> (GetSpectrumModel (centerFrequency, channelWidth, bandBandwidth, guardBandwidth));
229
  Values::iterator vit = c->ValuesBegin ();
210
  Values::iterator vit = c->ValuesBegin ();
 Lines 389-397    Link Here 
389
}
370
}
390
371
391
Ptr<SpectrumValue>
372
Ptr<SpectrumValue>
392
WifiSpectrumValueHelper::CreateHeOfdmTxPowerSpectralDensity (uint32_t centerFrequency, uint8_t channelWidth, double txPowerW, uint8_t guardBandwidth)
373
WifiSpectrumValueHelper::CreateHeOfdmTxPowerSpectralDensity (uint32_t centerFrequency, uint8_t channelWidth, double txPowerW, double guardBandwidth)
393
{
374
{
394
  NS_LOG_FUNCTION (centerFrequency << (uint16_t)channelWidth << txPowerW << (uint16_t)guardBandwidth);
375
  NS_LOG_FUNCTION (centerFrequency << (uint16_t)channelWidth << txPowerW << guardBandwidth);
395
  double bandBandwidth = 78125;
376
  double bandBandwidth = 78125;
396
  Ptr<SpectrumValue> c = Create<SpectrumValue> (GetSpectrumModel (centerFrequency, channelWidth, bandBandwidth, guardBandwidth));
377
  Ptr<SpectrumValue> c = Create<SpectrumValue> (GetSpectrumModel (centerFrequency, channelWidth, bandBandwidth, guardBandwidth));
397
  Values::iterator vit = c->ValuesBegin ();
378
  Values::iterator vit = c->ValuesBegin ();
 Lines 524-530    Link Here 
524
}
505
}
525
506
526
Ptr<SpectrumValue>
507
Ptr<SpectrumValue>
527
WifiSpectrumValueHelper::CreateNoisePowerSpectralDensity (uint32_t centerFrequency, uint8_t channelWidth, double bandBandwidth, double noiseFigure, uint8_t guardBandwidth)
508
WifiSpectrumValueHelper::CreateNoisePowerSpectralDensity (uint32_t centerFrequency, uint8_t channelWidth, double bandBandwidth, double noiseFigure, double guardBandwidth)
528
{
509
{
529
  Ptr<SpectrumModel> model = GetSpectrumModel (centerFrequency, channelWidth, bandBandwidth, guardBandwidth);
510
  Ptr<SpectrumModel> model = GetSpectrumModel (centerFrequency, channelWidth, bandBandwidth, guardBandwidth);
530
  return CreateNoisePowerSpectralDensity (noiseFigure, model);
511
  return CreateNoisePowerSpectralDensity (noiseFigure, model);
 Lines 549-557    Link Here 
549
}
530
}
550
531
551
Ptr<SpectrumValue>
532
Ptr<SpectrumValue>
552
WifiSpectrumValueHelper::CreateRfFilter (uint32_t centerFrequency, uint8_t channelWidth, double bandGranularity, uint8_t guardBandwidth)
533
WifiSpectrumValueHelper::CreateRfFilter (uint32_t centerFrequency, uint8_t channelWidth, double bandGranularity, double guardBandwidth)
553
{
534
{
554
  NS_LOG_FUNCTION (centerFrequency << (uint16_t)channelWidth << bandGranularity << (uint16_t)guardBandwidth);
535
  NS_LOG_FUNCTION (centerFrequency << (uint16_t)channelWidth << bandGranularity << guardBandwidth);
555
  Ptr<SpectrumValue> c = Create <SpectrumValue> (GetSpectrumModel (centerFrequency, channelWidth, bandGranularity, guardBandwidth));
536
  Ptr<SpectrumValue> c = Create <SpectrumValue> (GetSpectrumModel (centerFrequency, channelWidth, bandGranularity, guardBandwidth));
556
  size_t numBands = c->GetSpectrumModel ()->GetNumBands ();
537
  size_t numBands = c->GetSpectrumModel ()->GetNumBands ();
557
  Bands::const_iterator bit = c->ConstBandsBegin ();
538
  Bands::const_iterator bit = c->ConstBandsBegin ();
(-)a/src/spectrum/model/wifi-spectrum-value-helper.h (-9 / +13 lines)
 Lines 43-50    Link Here 
43
  
43
  
44
  /**
44
  /**
45
   * Return a SpectrumModel instance corresponding to the center frequency
45
   * Return a SpectrumModel instance corresponding to the center frequency
46
   * and channel width.  The model includes +/- 10 MHz of guard bands
46
   * and channel width.  The spectrum model spans the channel width 
47
   * (i.e. the model will span (channelWidth + 20) MHz of bandwidth).
47
   * +/- the guard bands (i.e. the model will span (channelWidth + 
48
   * 2 * guardBandwidth) MHz of bandwidth).  
48
   *
49
   *
49
   * \param centerFrequency center frequency (MHz)
50
   * \param centerFrequency center frequency (MHz)
50
   * \param channelWidth channel width (MHz)
51
   * \param channelWidth channel width (MHz)
 Lines 54-60    Link Here 
54
   * \return the static SpectrumModel instance corresponding to the
55
   * \return the static SpectrumModel instance corresponding to the
55
   * given carrier frequency and channel width configuration. 
56
   * given carrier frequency and channel width configuration. 
56
   */
57
   */
57
  static Ptr<SpectrumModel> GetSpectrumModel (uint32_t centerFrequency, uint8_t channelWidth, double bandBandwidth, uint8_t guardBandwidth);
58
  static Ptr<SpectrumModel> GetSpectrumModel (uint32_t centerFrequency, uint8_t channelWidth, double bandBandwidth, double guardBandwidth);
58
59
59
  /**
60
  /**
60
   * Create a transmit power spectral density corresponding to DSSS 
61
   * Create a transmit power spectral density corresponding to DSSS 
 Lines 62-77    Link Here 
62
   * The center frequency typically corresponds to 802.11b channel 
63
   * The center frequency typically corresponds to 802.11b channel 
63
   * center frequencies but is not restricted to those frequencies.
64
   * center frequencies but is not restricted to those frequencies.
64
   *
65
   *
66
   * \note There is no channel width parameter; this method assumes 22 MHz
67
   *
65
   * \param centerFrequency center frequency (MHz)
68
   * \param centerFrequency center frequency (MHz)
66
   * \param txPowerW  transmit power (W) to allocate
69
   * \param txPowerW  transmit power (W) to allocate
67
   * \param guardBandwidth width of the guard band (MHz)
70
   * \param guardBandwidth width of the guard band (MHz)
68
   * \returns a pointer to a newly allocated SpectrumValue representing the DSSS Transmit Power Spectral Density in W/Hz
71
   * \returns a pointer to a newly allocated SpectrumValue representing the DSSS Transmit Power Spectral Density in W/Hz
69
   */
72
   */
70
  static Ptr<SpectrumValue> CreateDsssTxPowerSpectralDensity (uint32_t centerFrequency, double txPowerW, uint8_t guardBandwidth);
73
  static Ptr<SpectrumValue> CreateDsssTxPowerSpectralDensity (uint32_t centerFrequency, double txPowerW, double guardBandwidth);
71
74
72
  /**
75
  /**
73
   * Create a transmit power spectral density corresponding to OFDM 
76
   * Create a transmit power spectral density corresponding to OFDM 
74
   * (802.11a/g).  Channel width may vary between 20, 10, and 5 MHz.
77
   * (802.11a/g).  Channel width may vary between 20, 10, and 5 MHz.
78
   * Guard bandwidth also typically varies with channel width.
75
   *
79
   *
76
   * \param centerFrequency center frequency (MHz)
80
   * \param centerFrequency center frequency (MHz)
77
   * \param channelWidth channel width (MHz)
81
   * \param channelWidth channel width (MHz)
 Lines 79-85    Link Here 
79
   * \param guardBandwidth width of the guard band (MHz)
83
   * \param guardBandwidth width of the guard band (MHz)
80
   * \return a pointer to a newly allocated SpectrumValue representing the OFDM Transmit Power Spectral Density in W/Hz for each Band
84
   * \return a pointer to a newly allocated SpectrumValue representing the OFDM Transmit Power Spectral Density in W/Hz for each Band
81
   */
85
   */
82
  static Ptr<SpectrumValue> CreateOfdmTxPowerSpectralDensity (uint32_t centerFrequency, uint8_t channelWidth, double txPowerW, uint8_t guardBandwidth);
86
  static Ptr<SpectrumValue> CreateOfdmTxPowerSpectralDensity (uint32_t centerFrequency, uint8_t channelWidth, double txPowerW, double guardBandwidth);
83
87
84
  /**
88
  /**
85
   * Create a transmit power spectral density corresponding to OFDM 
89
   * Create a transmit power spectral density corresponding to OFDM 
 Lines 92-98    Link Here 
92
   * \param guardBandwidth width of the guard band (MHz)
96
   * \param guardBandwidth width of the guard band (MHz)
93
   * \return a pointer to a newly allocated SpectrumValue representing the HT OFDM Transmit Power Spectral Density in W/Hz for each Band
97
   * \return a pointer to a newly allocated SpectrumValue representing the HT OFDM Transmit Power Spectral Density in W/Hz for each Band
94
   */
98
   */
95
  static Ptr<SpectrumValue> CreateHtOfdmTxPowerSpectralDensity (uint32_t centerFrequency, uint8_t channelWidth, double txPowerW, uint8_t guardBandwidth);
99
  static Ptr<SpectrumValue> CreateHtOfdmTxPowerSpectralDensity (uint32_t centerFrequency, uint8_t channelWidth, double txPowerW, double guardBandwidth);
96
100
97
  /**
101
  /**
98
   * Create a transmit power spectral density corresponding to OFDM 
102
   * Create a transmit power spectral density corresponding to OFDM 
 Lines 105-111    Link Here 
105
   * \param guardBandwidth width of the guard band (MHz)
109
   * \param guardBandwidth width of the guard band (MHz)
106
   * \return a pointer to a newly allocated SpectrumValue representing the HE OFDM Transmit Power Spectral Density in W/Hz for each Band
110
   * \return a pointer to a newly allocated SpectrumValue representing the HE OFDM Transmit Power Spectral Density in W/Hz for each Band
107
   */
111
   */
108
  static Ptr<SpectrumValue> CreateHeOfdmTxPowerSpectralDensity (uint32_t centerFrequency, uint8_t channelWidth, double txPowerW, uint8_t guardBandwidth);
112
  static Ptr<SpectrumValue> CreateHeOfdmTxPowerSpectralDensity (uint32_t centerFrequency, uint8_t channelWidth, double txPowerW, double guardBandwidth);
109
113
110
  /**
114
  /**
111
   * Create a power spectral density corresponding to the noise
115
   * Create a power spectral density corresponding to the noise
 Lines 117-123    Link Here 
117
   * \param guardBandwidth width of the guard band (MHz)
121
   * \param guardBandwidth width of the guard band (MHz)
118
   * \return a pointer to a newly allocated SpectrumValue representing the noise Power Spectral Density in W/Hz for each Band
122
   * \return a pointer to a newly allocated SpectrumValue representing the noise Power Spectral Density in W/Hz for each Band
119
   */
123
   */
120
  static Ptr<SpectrumValue> CreateNoisePowerSpectralDensity (uint32_t centerFrequency, uint8_t channelWidth, double bandBandwidth, double noiseFigure, uint8_t guardBandwidth);
124
  static Ptr<SpectrumValue> CreateNoisePowerSpectralDensity (uint32_t centerFrequency, uint8_t channelWidth, double bandBandwidth, double noiseFigure, double guardBandwidth);
121
125
122
  /**
126
  /**
123
   * Create a thermal noise power spectral density
127
   * Create a thermal noise power spectral density
 Lines 139-145    Link Here 
139
   * \return a pointer to a SpectrumValue representing the RF filter applied
143
   * \return a pointer to a SpectrumValue representing the RF filter applied
140
   * to an received power spectral density
144
   * to an received power spectral density
141
   */
145
   */
142
  static Ptr<SpectrumValue> CreateRfFilter (uint32_t centerFrequency, uint8_t channelWidth, double bandBandwidth, uint8_t guardBandwidth);
146
  static Ptr<SpectrumValue> CreateRfFilter (uint32_t centerFrequency, uint8_t channelWidth, double bandBandwidth, double guardBandwidth);
143
};
147
};
144
148
145
/**
149
/**
(-)a/src/wifi/model/spectrum-wifi-phy.cc (-6 / +20 lines)
 Lines 25-30    Link Here 
25
25
26
#include "spectrum-wifi-phy.h"
26
#include "spectrum-wifi-phy.h"
27
#include "ns3/wifi-spectrum-value-helper.h"
27
#include "ns3/wifi-spectrum-value-helper.h"
28
#include "ns3/abort.h"
28
#include "ns3/log.h"
29
#include "ns3/log.h"
29
#include "ns3/boolean.h"
30
#include "ns3/boolean.h"
30
#include "wifi-spectrum-signal-parameters.h"
31
#include "wifi-spectrum-signal-parameters.h"
 Lines 296-301    Link Here 
296
      break;
297
      break;
297
    case WIFI_MOD_CLASS_DSSS:
298
    case WIFI_MOD_CLASS_DSSS:
298
    case WIFI_MOD_CLASS_HR_DSSS:
299
    case WIFI_MOD_CLASS_HR_DSSS:
300
      NS_ABORT_MSG_IF (channelWidth != 22, "Invalid channel width for DSSS");
299
      v = WifiSpectrumValueHelper::CreateDsssTxPowerSpectralDensity (centerFrequency, txPowerW, GetGuardBandwidth ());
301
      v = WifiSpectrumValueHelper::CreateDsssTxPowerSpectralDensity (centerFrequency, txPowerW, GetGuardBandwidth ());
300
      break;
302
      break;
301
    case WIFI_MOD_CLASS_HT:
303
    case WIFI_MOD_CLASS_HT:
 Lines 354-361    Link Here 
354
    case WIFI_PHY_STANDARD_80211a:
356
    case WIFI_PHY_STANDARD_80211a:
355
    case WIFI_PHY_STANDARD_80211g:
357
    case WIFI_PHY_STANDARD_80211g:
356
    case WIFI_PHY_STANDARD_holland:
358
    case WIFI_PHY_STANDARD_holland:
357
    case WIFI_PHY_STANDARD_80211_10MHZ:
358
    case WIFI_PHY_STANDARD_80211_5MHZ:
359
    case WIFI_PHY_STANDARD_80211b:
359
    case WIFI_PHY_STANDARD_80211b:
360
    case WIFI_PHY_STANDARD_80211n_2_4GHZ:
360
    case WIFI_PHY_STANDARD_80211n_2_4GHZ:
361
    case WIFI_PHY_STANDARD_80211n_5GHZ:
361
    case WIFI_PHY_STANDARD_80211n_5GHZ:
 Lines 363-368    Link Here 
363
      // Use OFDM subcarrier width of 312.5 KHz as band granularity
363
      // Use OFDM subcarrier width of 312.5 KHz as band granularity
364
      bandBandwidth = 312500;
364
      bandBandwidth = 312500;
365
      break;
365
      break;
366
    case WIFI_PHY_STANDARD_80211_10MHZ:
367
      // Use OFDM subcarrier width of 156.25 KHz as band granularity
368
      bandBandwidth = 156250;
369
      break;
370
    case WIFI_PHY_STANDARD_80211_5MHZ:
371
      // Use OFDM subcarrier width of 78.125 KHz as band granularity
372
      bandBandwidth = 78125;
373
      break;
366
    case WIFI_PHY_STANDARD_80211ax_2_4GHZ:
374
    case WIFI_PHY_STANDARD_80211ax_2_4GHZ:
367
    case WIFI_PHY_STANDARD_80211ax_5GHZ:
375
    case WIFI_PHY_STANDARD_80211ax_5GHZ:
368
      // Use OFDM subcarrier width of 78.125 KHz as band granularity
376
      // Use OFDM subcarrier width of 78.125 KHz as band granularity
 Lines 375-381    Link Here 
375
  return bandBandwidth;
383
  return bandBandwidth;
376
}
384
}
377
385
378
uint32_t
386
double
379
SpectrumWifiPhy::GetGuardBandwidth (void) const
387
SpectrumWifiPhy::GetGuardBandwidth (void) const
380
{
388
{
381
  double guardBandwidth = 0;
389
  double guardBandwidth = 0;
 Lines 384-400    Link Here 
384
    case WIFI_PHY_STANDARD_80211a:
392
    case WIFI_PHY_STANDARD_80211a:
385
    case WIFI_PHY_STANDARD_80211g:
393
    case WIFI_PHY_STANDARD_80211g:
386
    case WIFI_PHY_STANDARD_holland:
394
    case WIFI_PHY_STANDARD_holland:
387
    case WIFI_PHY_STANDARD_80211_10MHZ:
388
    case WIFI_PHY_STANDARD_80211_5MHZ:
389
    case WIFI_PHY_STANDARD_80211b:
395
    case WIFI_PHY_STANDARD_80211b:
390
    case WIFI_PHY_STANDARD_80211n_2_4GHZ:
396
    case WIFI_PHY_STANDARD_80211n_2_4GHZ:
391
    case WIFI_PHY_STANDARD_80211n_5GHZ:
397
    case WIFI_PHY_STANDARD_80211n_5GHZ:
392
    case WIFI_PHY_STANDARD_80211ac:
398
    case WIFI_PHY_STANDARD_80211ac:
393
    case WIFI_PHY_STANDARD_80211ax_2_4GHZ:
399
    case WIFI_PHY_STANDARD_80211ax_2_4GHZ:
394
    case WIFI_PHY_STANDARD_80211ax_5GHZ:
400
    case WIFI_PHY_STANDARD_80211ax_5GHZ:
395
      // Use 10 MHZ
401
      // Use 10 MHZ as per Table D-6 802.11-2016, class A, -10 dB f2 mask point 
396
      guardBandwidth = 10;
402
      guardBandwidth = 10;
397
      break;
403
      break;
404
    case WIFI_PHY_STANDARD_80211_10MHZ:
405
      // Use 5 MHz as per Table D-5 802.11-2016, class A, -10 dB f2 mask point
406
      guardBandwidth = 5;
407
      break;
408
    case WIFI_PHY_STANDARD_80211_5MHZ:
409
      // Use 2.5 MHz as per Table D-4 802.11-2016, class A, -10 dB f2 mask point
410
      guardBandwidth = 2.5;
411
      break;
398
    default:
412
    default:
399
      NS_FATAL_ERROR ("Standard unknown: " << GetStandard ());
413
      NS_FATAL_ERROR ("Standard unknown: " << GetStandard ());
400
      break;
414
      break;
(-)a/src/wifi/model/spectrum-wifi-phy.h (-1 / +1 lines)
 Lines 155-161    Link Here 
155
  /**
155
  /**
156
   * \return the width of the guard band (MHz)
156
   * \return the width of the guard band (MHz)
157
   */
157
   */
158
  uint32_t GetGuardBandwidth (void) const;
158
  double GetGuardBandwidth (void) const;
159
159
160
  /**
160
  /**
161
   * Callback invoked when the Phy model starts to process a signal
161
   * Callback invoked when the Phy model starts to process a signal

Return to bug 2813