29 #include "ns3/fatal-error.h"
30 #include "ns3/assert.h"
54 : m_centerFrequency (
f),
88 NS_LOG_FUNCTION (centerFrequency << channelWidth << bandBandwidth << guardBandwidth);
99 double centerFrequencyHz = centerFrequency * 1e6;
100 double bandwidth = (channelWidth + (2.0 * guardBandwidth)) * 1e6;
102 uint32_t numBands =
static_cast<uint32_t
> ((bandwidth / bandBandwidth) + 0.5);
104 if (numBands % 2 == 0)
110 NS_ASSERT_MSG (numBands % 2 == 1,
"Number of bands should be odd");
111 NS_LOG_DEBUG (
"Num bands " << numBands <<
" band bandwidth " << bandBandwidth);
114 double startingFrequencyHz = centerFrequencyHz - (numBands / 2 * bandBandwidth) - bandBandwidth / 2;
115 for (
size_t i = 0; i < numBands; i++)
118 double f = startingFrequencyHz + (i * bandBandwidth);
120 f += bandBandwidth / 2;
122 f += bandBandwidth / 2;
124 NS_LOG_DEBUG (
"creating band " << i <<
" (" << info.
fl <<
":" << info.
fc <<
":" << info.
fh <<
")");
125 bands.push_back (info);
127 ret = Create<SpectrumModel> (std::move (bands));
139 uint16_t channelWidth = 22;
140 uint32_t bandBandwidth = 312500;
144 uint32_t nGuardBands =
static_cast<uint32_t
> (((2 * guardBandwidth * 1e6) / bandBandwidth) + 0.5);
145 uint32_t nAllocatedBands =
static_cast<uint32_t
> (((channelWidth * 1e6) / bandBandwidth) + 0.5);
148 double txPowerPerBand = txPowerW / nAllocatedBands;
149 for (
size_t i = 0; i < c->
GetSpectrumModel ()->GetNumBands (); i++, vit++, bit++)
151 if ((i >= (nGuardBands / 2)) && (i <= ((nGuardBands / 2) + nAllocatedBands - 1)))
153 *vit = txPowerPerBand / (bit->fh - bit->fl);
161 double minInnerBandDbr,
double minOuterBandDbr,
double lowestPointDbr)
163 NS_LOG_FUNCTION (centerFrequency << channelWidth << txPowerW << guardBandwidth << minInnerBandDbr << minOuterBandDbr << lowestPointDbr);
164 uint32_t bandBandwidth = 0;
165 uint32_t innerSlopeWidth = 0;
166 switch (channelWidth)
169 bandBandwidth = 312500;
170 innerSlopeWidth =
static_cast<uint32_t
> ((2e6 / bandBandwidth) + 0.5);
173 bandBandwidth = 156250;
174 innerSlopeWidth =
static_cast<uint32_t
> ((1e6 / bandBandwidth) + 0.5);
177 bandBandwidth = 78125;
178 innerSlopeWidth =
static_cast<uint32_t
> ((5e5 / bandBandwidth) + 0.5);
181 NS_FATAL_ERROR (
"Channel width " << channelWidth <<
" should be correctly set.");
186 uint32_t nGuardBands =
static_cast<uint32_t
> (((2 * guardBandwidth * 1e6) / bandBandwidth) + 0.5);
187 uint32_t nAllocatedBands =
static_cast<uint32_t
> (((channelWidth * 1e6) / bandBandwidth) + 0.5);
193 double txPowerPerBandW = txPowerW / 52;
194 NS_LOG_DEBUG (
"Power per band " << txPowerPerBandW <<
"W");
195 uint32_t start1 = (nGuardBands / 2) + 6;
196 uint32_t stop1 = start1 + 26 - 1;
197 uint32_t start2 = stop1 + 2;
198 uint32_t stop2 = start2 + 26 - 1;
201 std::vector <WifiSpectrumBand> subBands;
202 subBands.push_back (std::make_pair (start1, stop1));
203 subBands.push_back (std::make_pair (start2, stop2));
206 txPowerPerBandW, nGuardBands,
207 innerSlopeWidth, minInnerBandDbr,
208 minOuterBandDbr, lowestPointDbr);
216 double minInnerBandDbr,
double minOuterBandDbr,
double lowestPointDbr)
218 NS_LOG_FUNCTION (centerFrequency << channelWidth << txPowerW << guardBandwidth << minInnerBandDbr << minOuterBandDbr << lowestPointDbr);
219 uint32_t bandBandwidth = 312500;
221 uint32_t nGuardBands =
static_cast<uint32_t
> (((2 * guardBandwidth * 1e6) / bandBandwidth) + 0.5);
222 uint32_t nAllocatedBands =
static_cast<uint32_t
> (((channelWidth * 1e6) / bandBandwidth) + 0.5);
224 double txPowerPerBandW = 0.0;
229 uint32_t start1 = (nGuardBands / 2) + 4;
230 uint32_t stop1 = start1 + 28 - 1;
231 uint32_t start2 = stop1 + 2;
232 uint32_t stop2 = start2 + 28 - 1;
233 uint32_t start3 = stop2 + (2 * 4);
234 uint32_t stop3 = start3 + 28 - 1;
235 uint32_t start4 = stop3 + 2;
236 uint32_t stop4 = start4 + 28 - 1;
237 uint32_t start5 = stop4 + (2 * 4);
238 uint32_t stop5 = start5 + 28 - 1;
239 uint32_t start6 = stop5 + 2;
240 uint32_t stop6 = start6 + 28 - 1;
241 uint32_t start7 = stop6 + (2 * 4);
242 uint32_t stop7 = start7 + 28 - 1;
243 uint32_t start8 = stop7 + 2;
244 uint32_t stop8 = start8 + 28 - 1;
245 uint32_t start9 = stop8 + (2 * 4);
246 uint32_t stop9 = start9 + 28 - 1;
247 uint32_t start10 = stop9 + 2;
248 uint32_t stop10 = start10 + 28 - 1;
249 uint32_t start11 = stop10 + (2 * 4);
250 uint32_t stop11 = start11 + 28 - 1;
251 uint32_t start12 = stop11 + 2;
252 uint32_t stop12 = start12 + 28 - 1;
253 uint32_t start13 = stop12 + (2 * 4);
254 uint32_t stop13 = start13 + 28 - 1;
255 uint32_t start14 = stop13 + 2;
256 uint32_t stop14 = start14 + 28 - 1;
257 uint32_t start15 = stop14 + (2 * 4);
258 uint32_t stop15 = start15 + 28 - 1;
259 uint32_t start16 = stop15 + 2;
260 uint32_t stop16 = start16 + 28 - 1;
262 uint32_t innerSlopeWidth =
static_cast<uint32_t
> ((2e6 / bandBandwidth) + 0.5);
263 std::vector <WifiSpectrumBand> subBands;
265 switch (channelWidth)
269 txPowerPerBandW = txPowerW / 56;
270 subBands.push_back (std::make_pair (start1, stop1));
271 subBands.push_back (std::make_pair (start2, stop2));
276 txPowerPerBandW = txPowerW / 112;
277 subBands.push_back (std::make_pair (start1, stop1));
278 subBands.push_back (std::make_pair (start2, stop2));
279 subBands.push_back (std::make_pair (start3, stop3));
280 subBands.push_back (std::make_pair (start4, stop4));
285 txPowerPerBandW = txPowerW / 224;
286 subBands.push_back (std::make_pair (start1, stop1));
287 subBands.push_back (std::make_pair (start2, stop2));
288 subBands.push_back (std::make_pair (start3, stop3));
289 subBands.push_back (std::make_pair (start4, stop4));
290 subBands.push_back (std::make_pair (start5, stop5));
291 subBands.push_back (std::make_pair (start6, stop6));
292 subBands.push_back (std::make_pair (start7, stop7));
293 subBands.push_back (std::make_pair (start8, stop8));
298 txPowerPerBandW = txPowerW / 448;
299 subBands.push_back (std::make_pair (start1, stop1));
300 subBands.push_back (std::make_pair (start2, stop2));
301 subBands.push_back (std::make_pair (start3, stop3));
302 subBands.push_back (std::make_pair (start4, stop4));
303 subBands.push_back (std::make_pair (start5, stop5));
304 subBands.push_back (std::make_pair (start6, stop6));
305 subBands.push_back (std::make_pair (start7, stop7));
306 subBands.push_back (std::make_pair (start8, stop8));
307 subBands.push_back (std::make_pair (start9, stop9));
308 subBands.push_back (std::make_pair (start10, stop10));
309 subBands.push_back (std::make_pair (start11, stop11));
310 subBands.push_back (std::make_pair (start12, stop12));
311 subBands.push_back (std::make_pair (start13, stop13));
312 subBands.push_back (std::make_pair (start14, stop14));
313 subBands.push_back (std::make_pair (start15, stop15));
314 subBands.push_back (std::make_pair (start16, stop16));
320 txPowerPerBandW, nGuardBands,
321 innerSlopeWidth, minInnerBandDbr,
322 minOuterBandDbr, lowestPointDbr);
330 double minInnerBandDbr,
double minOuterBandDbr,
double lowestPointDbr)
332 NS_LOG_FUNCTION (centerFrequency << channelWidth << txPowerW << guardBandwidth << minInnerBandDbr << minOuterBandDbr << lowestPointDbr);
333 uint32_t bandBandwidth = 78125;
335 uint32_t nGuardBands =
static_cast<uint32_t
> (((2 * guardBandwidth * 1e6) / bandBandwidth) + 0.5);
336 uint32_t nAllocatedBands =
static_cast<uint32_t
> (((channelWidth * 1e6) / bandBandwidth) + 0.5);
338 double txPowerPerBandW = 0.0;
348 uint32_t innerSlopeWidth =
static_cast<uint32_t
> ((1e6 / bandBandwidth) + 0.5);
349 std::vector <WifiSpectrumBand> subBands;
351 switch (channelWidth)
355 txPowerPerBandW = txPowerW / 242;
356 innerSlopeWidth =
static_cast<uint32_t
> ((5e5 / bandBandwidth) + 0.5);
360 start1 = (nGuardBands / 2) + 6;
361 stop1 = start1 + 121 - 1;
363 stop2 = start2 + 121 - 1;
364 subBands.push_back (std::make_pair (start1, stop1));
365 subBands.push_back (std::make_pair (start2, stop2));
369 txPowerPerBandW = txPowerW / 484;
373 start1 = (nGuardBands / 2) + 12;
374 stop1 = start1 + 242 - 1;
376 stop2 = start2 + 242 - 1;
377 subBands.push_back (std::make_pair (start1, stop1));
378 subBands.push_back (std::make_pair (start2, stop2));
382 txPowerPerBandW = txPowerW / 996;
386 start1 = (nGuardBands / 2) + 12;
387 stop1 = start1 + 498 - 1;
389 stop2 = start2 + 498 - 1;
390 subBands.push_back (std::make_pair (start1, stop1));
391 subBands.push_back (std::make_pair (start2, stop2));
395 txPowerPerBandW = txPowerW / (2 * 996);
396 start1 = (nGuardBands / 2) + 12;
397 stop1 = start1 + 498 - 1;
399 stop2 = start2 + 498 - 1;
400 start3 = stop2 + (2 * 12);
401 stop3 = start3 + 498 - 1;
403 stop4 = start4 + 498 - 1;
404 subBands.push_back (std::make_pair (start1, stop1));
405 subBands.push_back (std::make_pair (start2, stop2));
406 subBands.push_back (std::make_pair (start3, stop3));
407 subBands.push_back (std::make_pair (start4, stop4));
410 NS_FATAL_ERROR (
"ChannelWidth " << channelWidth <<
" unsupported");
416 txPowerPerBandW, nGuardBands,
417 innerSlopeWidth, minInnerBandDbr,
418 minOuterBandDbr, lowestPointDbr);
427 NS_LOG_FUNCTION (centerFrequency << channelWidth << txPowerW << guardBandwidth << ru.first << ru.second);
428 uint32_t bandBandwidth = 78125;
434 double txPowerPerBandW = (txPowerW / (ru.second - ru.first + 1));
436 for (
size_t i = 0; i < numBands; i++, vit++, bit++)
438 if (i < ru.first || i > ru.second)
444 *vit = (txPowerPerBandW / (bit->fh - bit->fl));
465 const double kT_dBm_Hz = -174.0;
466 double kT_W_Hz =
DbmToW (kT_dBm_Hz);
467 double noiseFigureLinear = std::pow (10.0, noiseFigureDb / 10.0);
468 double noisePowerSpectralDensity = kT_W_Hz * noiseFigureLinear;
471 (*noisePsd) = noisePowerSpectralDensity;
472 NS_LOG_INFO (
"NoisePowerSpectralDensity has integrated power of " <<
Integral (*noisePsd));
479 uint32_t startIndex = band.first;
480 uint32_t stopIndex = band.second;
481 NS_LOG_FUNCTION (centerFrequency << totalChannelWidth << bandBandwidth << guardBandwidth << startIndex << stopIndex);
487 for (
size_t i = startIndex; i <= stopIndex; i++, vit++, bit++)
491 NS_LOG_LOGIC (
"Added subbands " << startIndex <<
" to " << stopIndex <<
" to filter");
497 double txPowerPerBandW, uint32_t nGuardBands, uint32_t innerSlopeWidth,
498 double minInnerBandDbr,
double minOuterBandDbr,
double lowestPointDbr)
500 NS_LOG_FUNCTION (c << allocatedSubBands.front ().first << allocatedSubBands.back ().second << maskBand.first << maskBand.second <<
501 txPowerPerBandW << nGuardBands << innerSlopeWidth << minInnerBandDbr << minOuterBandDbr << lowestPointDbr);
502 uint32_t numSubBands = allocatedSubBands.size ();
504 uint32_t numMaskBands = maskBand.second - maskBand.first + 1;
505 NS_ASSERT (numSubBands && numBands && numMaskBands);
506 NS_LOG_LOGIC (
"Power per band " << txPowerPerBandW <<
"W");
509 double txPowerRefDbm = (10.0 * std::log10 (txPowerPerBandW * 1000.0));
510 double txPowerInnerBandMinDbm = txPowerRefDbm + minInnerBandDbr;
511 double txPowerMiddleBandMinDbm = txPowerRefDbm + minOuterBandDbr;
512 double txPowerOuterBandMinDbm = txPowerRefDbm + lowestPointDbr;
515 uint32_t outerSlopeWidth = nGuardBands / 4;
516 uint32_t middleSlopeWidth = outerSlopeWidth - (innerSlopeWidth / 2);
518 maskBand.first + outerSlopeWidth - 1);
520 outerBandLeft.second + middleSlopeWidth);
521 WifiSpectrumBand innerBandLeft (allocatedSubBands.front ().first - innerSlopeWidth,
522 allocatedSubBands.front ().first - 1);
524 innerBandLeft.first - 1);
528 outerBandRight.first - 1);
530 allocatedSubBands.back ().second + innerSlopeWidth);
532 middleBandRight.first - 1);
533 NS_LOG_DEBUG (
"outerBandLeft=[" << outerBandLeft.first <<
";" << outerBandLeft.second <<
"] " <<
534 "middleBandLeft=[" << middleBandLeft.first <<
";" << middleBandLeft.second <<
"] " <<
535 "flatJunctionLeft=[" << flatJunctionLeft.first <<
";" << flatJunctionLeft.second <<
"] " <<
536 "innerBandLeft=[" << innerBandLeft.first <<
";" << innerBandLeft.second <<
"] " <<
537 "subBands=[" << allocatedSubBands.front ().first <<
";" << allocatedSubBands.back ().second <<
"] " <<
538 "innerBandRight=[" << innerBandRight.first <<
";" << innerBandRight.second <<
"] " <<
539 "flatJunctionRight=[" << flatJunctionRight.first <<
";" << flatJunctionRight.second <<
"] " <<
540 "middleBandRight=[" << middleBandRight.first <<
";" << middleBandRight.second <<
"] " <<
541 "outerBandRight=[" << outerBandRight.first <<
";" << outerBandRight.second <<
"] ");
542 NS_ASSERT (numMaskBands == ((allocatedSubBands.back ().second - allocatedSubBands.front ().first + 1)
543 + 2 * (innerSlopeWidth + middleSlopeWidth + outerSlopeWidth)
544 + (flatJunctionLeft.second - flatJunctionLeft.first + 1)
545 + (flatJunctionRight.second - flatJunctionRight.first + 1)));
548 double innerSlope = (-1 * minInnerBandDbr) / innerSlopeWidth;
549 double middleSlope = (-1 * (minOuterBandDbr - minInnerBandDbr)) / middleSlopeWidth;
550 double outerSlope = (txPowerMiddleBandMinDbm - txPowerOuterBandMinDbm) / outerSlopeWidth;
555 double txPowerW = 0.0;
556 for (
size_t i = 0; i < numBands; i++, vit++, bit++)
558 if (i < maskBand.first || i > maskBand.second)
562 else if (i <= outerBandLeft.second && i >= outerBandLeft.first)
564 txPowerW =
DbmToW (txPowerOuterBandMinDbm + ((i - outerBandLeft.first) * outerSlope));
566 else if (i <= middleBandLeft.second && i >= middleBandLeft.first)
568 txPowerW =
DbmToW (txPowerMiddleBandMinDbm + ((i - middleBandLeft.first) * middleSlope));
570 else if (i <= flatJunctionLeft.second && i >= flatJunctionLeft.first)
572 txPowerW =
DbmToW (txPowerInnerBandMinDbm);
574 else if (i <= innerBandLeft.second && i >= innerBandLeft.first)
576 txPowerW =
DbmToW (txPowerInnerBandMinDbm + ((i - innerBandLeft.first) * innerSlope));
578 else if (i <= allocatedSubBands.back ().second && i >= allocatedSubBands.front ().first)
580 bool insideSubBand =
false;
581 for (uint32_t j = 0; !insideSubBand && j < numSubBands; j++)
583 insideSubBand = (i <= allocatedSubBands[j].second) && (i >= allocatedSubBands[j].
first);
587 txPowerW = txPowerPerBandW;
591 txPowerW =
DbmToW (txPowerInnerBandMinDbm);
594 else if (i <= innerBandRight.second && i >= innerBandRight.first)
596 txPowerW =
DbmToW (txPowerRefDbm - ((i - innerBandRight.first + 1) * innerSlope));
598 else if (i <= flatJunctionRight.second && i >= flatJunctionRight.first)
600 txPowerW =
DbmToW (txPowerInnerBandMinDbm);
602 else if (i <= middleBandRight.second && i >= middleBandRight.first)
604 txPowerW =
DbmToW (txPowerInnerBandMinDbm - ((i - middleBandRight.first + 1) * middleSlope));
606 else if (i <= outerBandRight.second && i >= outerBandRight.first)
608 txPowerW =
DbmToW (txPowerMiddleBandMinDbm - ((i - outerBandRight.first + 1) * outerSlope));
614 double txPowerDbr = 10 * std::log10 (txPowerW / txPowerPerBandW);
616 *vit = txPowerW / (bit->fh - bit->fl);
618 NS_LOG_INFO (
"Added signal power to subbands " << allocatedSubBands.front ().first <<
"-" << allocatedSubBands.back ().second);
626 double currentTxPowerW =
Integral (*c);
627 double normalizationRatio = currentTxPowerW / txPowerW;
628 NS_LOG_LOGIC (
"Current power: " << currentTxPowerW <<
"W vs expected power: " << txPowerW <<
"W" <<
629 " -> ratio (C/E) = " << normalizationRatio);
633 *vit = (*vit) / normalizationRatio;
640 return std::pow (10.0, 0.1 * (dBm - 30.0));
646 double powerWattPerHertz = 0.0;
650 while (valueIt <= end)
652 powerWattPerHertz += *valueIt;
655 return powerWattPerHertz * (bandIt->fh - bandIt->fl);
677 for (
int i = -4; i < 13 + 7; i++)
680 bi.
fl = 2407.0e6 + i * 5.0e6;
681 bi.
fh = 2407.0e6 + (i + 1) * 5.0e6;
682 bi.
fc = (bi.
fl + bi.
fh) / 2;
683 bands.push_back (bi);
712 double txPowerDensity = txPower / 20e6;
717 (*txPsd)[
channel - 1] = txPowerDensity * 1e-4;
718 (*txPsd)[
channel] = txPowerDensity * 1e-4;
719 (*txPsd)[
channel + 1] = txPowerDensity * 0.0015849;
720 (*txPsd)[
channel + 2] = txPowerDensity * 0.0015849;
721 (*txPsd)[
channel + 3] = txPowerDensity;
722 (*txPsd)[
channel + 4] = txPowerDensity;
723 (*txPsd)[
channel + 5] = txPowerDensity;
724 (*txPsd)[
channel + 6] = txPowerDensity;
725 (*txPsd)[
channel + 7] = txPowerDensity * 0.0015849;
726 (*txPsd)[
channel + 8] = txPowerDensity * 0.0015849;
727 (*txPsd)[
channel + 9] = txPowerDensity * 1e-4;
728 (*txPsd)[
channel + 10] = txPowerDensity * 1e-4;
double f(double x, void *params)
size_t GetNumBands() const
SpectrumModelUid_t GetUid() const
Values::const_iterator ConstValuesBegin() const
Values::iterator ValuesBegin()
Bands::const_iterator ConstBandsBegin() const
Ptr< const SpectrumModel > GetSpectrumModel() const
Static class to initialize the values for the 2.4 GHz Wi-Fi spectrum model.
WifiSpectrumModel5MhzInitializer()
virtual Ptr< SpectrumValue > CreateConstant(double psd)
Creates a SpectrumValue instance with a constant value for all frequencies.
virtual Ptr< SpectrumValue > CreateRfFilter(uint8_t channel)
Creates a SpectrumValue instance which represents the frequency response of the RF filter which is us...
virtual Ptr< SpectrumValue > CreateTxPowerSpectralDensity(double txPower, uint8_t channel)
Creates a SpectrumValue instance that represents the TX Power Spectral Density of a wifi device corre...
virtual ~WifiSpectrumValue5MhzFactory()
Destructor.
virtual ~WifiSpectrumValueHelper()
Destructor.
static Ptr< SpectrumValue > CreateHtOfdmTxPowerSpectralDensity(uint32_t centerFrequency, uint16_t channelWidth, double txPowerW, uint16_t guardBandwidth, double minInnerBandDbr=-20, double minOuterbandDbr=-28, double lowestPointDbr=-40)
Create a transmit power spectral density corresponding to OFDM High Throughput (HT) (802....
static Ptr< SpectrumValue > CreateOfdmTxPowerSpectralDensity(uint32_t centerFrequency, uint16_t channelWidth, double txPowerW, uint16_t guardBandwidth, double minInnerBandDbr=-20, double minOuterbandDbr=-28, double lowestPointDbr=-40)
Create a transmit power spectral density corresponding to OFDM (802.11a/g).
static Ptr< SpectrumValue > CreateDsssTxPowerSpectralDensity(uint32_t centerFrequency, double txPowerW, uint16_t guardBandwidth)
Create a transmit power spectral density corresponding to DSSS.
static Ptr< SpectrumModel > GetSpectrumModel(uint32_t centerFrequency, uint16_t channelWidth, uint32_t bandBandwidth, uint16_t guardBandwidth)
Return a SpectrumModel instance corresponding to the center frequency and channel width.
static Ptr< SpectrumValue > CreateNoisePowerSpectralDensity(uint32_t centerFrequency, uint16_t channelWidth, uint32_t bandBandwidth, double noiseFigure, uint16_t guardBandwidth)
Create a power spectral density corresponding to the noise.
static Ptr< SpectrumValue > CreateHeMuOfdmTxPowerSpectralDensity(uint32_t centerFrequency, uint16_t channelWidth, double txPowerW, uint16_t guardBandwidth, WifiSpectrumBand ru)
Create a transmit power spectral density corresponding to the OFDMA part of HE TB PPDUs for a given R...
static double DbmToW(double dbm)
Convert from dBm to Watts.
static void NormalizeSpectrumMask(Ptr< SpectrumValue > c, double txPowerW)
Normalize the transmit spectrum mask generated by CreateSpectrumMaskForOfdm so that the total transmi...
static Ptr< SpectrumValue > CreateHeOfdmTxPowerSpectralDensity(uint32_t centerFrequency, uint16_t channelWidth, double txPowerW, uint16_t guardBandwidth, double minInnerBandDbr=-20, double minOuterbandDbr=-28, double lowestPointDbr=-40)
Create a transmit power spectral density corresponding to OFDM High Efficiency (HE) (802....
static void CreateSpectrumMaskForOfdm(Ptr< SpectrumValue > c, std::vector< WifiSpectrumBand > allocatedSubBands, WifiSpectrumBand maskBand, double txPowerPerBandW, uint32_t nGuardBands, uint32_t innerSlopeWidth, double minInnerBandDbr, double minOuterbandDbr, double lowestPointDbr)
Create a transmit power spectral density corresponding to OFDM transmit spectrum mask requirements fo...
static double GetBandPowerW(Ptr< SpectrumValue > psd, const WifiSpectrumBand &band)
Calculate the power of the specified band composed of uniformly-sized sub-bands.
static Ptr< SpectrumValue > CreateRfFilter(uint32_t centerFrequency, uint16_t totalChannelWidth, uint32_t bandBandwidth, uint16_t guardBandwidth, WifiSpectrumBand band)
Create a spectral density corresponding to the RF filter.
#define NS_ASSERT(condition)
At runtime, in debugging builds, if this condition is not true, the program prints the source file,...
#define NS_ASSERT_MSG(condition, message)
At runtime, in debugging builds, if this condition is not true, the program prints the message to out...
#define NS_FATAL_ERROR(msg)
Report a fatal error with a message and terminate.
#define NS_LOG_COMPONENT_DEFINE(name)
Define a Log component with a specific name.
#define NS_LOG_DEBUG(msg)
Use NS_LOG to output a message of level LOG_DEBUG.
#define NS_LOG_LOGIC(msg)
Use NS_LOG to output a message of level LOG_LOGIC.
#define NS_LOG_FUNCTION(parameters)
If log level LOG_FUNCTION is enabled, this macro will output all input parameters separated by ",...
#define NS_LOG_INFO(msg)
Use NS_LOG to output a message of level LOG_INFO.
Every class exported by the ns3 library is enclosed in the ns3 namespace.
static Ptr< SpectrumModel > g_WifiSpectrumModel5Mhz
static initializer for the class
std::pair< uint32_t, uint32_t > WifiSpectrumBand
typedef for a pair of start and stop sub-band indexes
double Integral(const SpectrumValue &arg)
std::vector< BandInfo > Bands
Container of BandInfo.
static class ns3::WifiSpectrumModel5MhzInitializer g_WifiSpectrumModel5MhzInitializerInstance
initialization instance for WifiSpectrumModel5Mhz
bool operator<(const EventId &a, const EventId &b)
static std::map< WifiSpectrumModelId, Ptr< SpectrumModel > > g_wifiSpectrumModelMap
static initializer for the class
The building block of a SpectrumModel.
double fc
center frequency
double fl
lower limit of subband
double fh
upper limit of subband
Wifi Spectrum Model structure.
uint32_t m_centerFrequency
center frequency (in MHz)
uint16_t m_guardBandwidth
guard band width (in MHz)
double m_bandBandwidth
width of each band (in Hz)
uint16_t m_channelWidth
channel width (in MHz)
WifiSpectrumModelId(uint32_t f, uint16_t w, double b, uint16_t g)
Constructor.