26 #include "ns3/assert.h"
27 #include "ns3/fatal-error.h"
68 static std::map<WifiSpectrumModelId, Ptr<SpectrumModel>>
73 uint16_t channelWidth,
74 uint32_t carrierSpacing,
75 uint16_t guardBandwidth)
77 NS_LOG_FUNCTION(centerFrequency << channelWidth << carrierSpacing << guardBandwidth);
88 double centerFrequencyHz = centerFrequency * 1e6;
89 double bandwidth = (channelWidth + (2.0 * guardBandwidth)) * 1e6;
91 auto numBands =
static_cast<uint32_t
>((bandwidth / carrierSpacing) + 0.5);
93 if (numBands % 2 == 0)
99 NS_ASSERT_MSG(numBands % 2 == 1,
"Number of bands should be odd");
100 NS_LOG_DEBUG(
"Num bands " << numBands <<
" band bandwidth " << carrierSpacing);
103 double startingFrequencyHz =
104 centerFrequencyHz - (numBands / 2 * carrierSpacing) - carrierSpacing / 2;
105 for (
size_t i = 0; i < numBands; i++)
108 double f = startingFrequencyHz + (i * carrierSpacing);
110 f += carrierSpacing / 2;
112 f += carrierSpacing / 2;
114 NS_LOG_DEBUG(
"creating band " << i <<
" (" << info.
fl <<
":" << info.
fc <<
":"
116 bands.push_back(info);
118 ret = Create<SpectrumModel>(std::move(bands));
129 uint16_t guardBandwidth)
132 uint16_t channelWidth = 22;
133 uint32_t carrierSpacing = 312500;
135 GetSpectrumModel(centerFrequency, channelWidth, carrierSpacing, guardBandwidth));
138 auto nGuardBands =
static_cast<uint32_t
>(((2 * guardBandwidth * 1e6) / carrierSpacing) + 0.5);
139 auto nAllocatedBands =
static_cast<uint32_t
>(((channelWidth * 1e6) / carrierSpacing) + 0.5);
142 double txPowerPerBand = txPowerW / nAllocatedBands;
143 for (
size_t i = 0; i < c->
GetSpectrumModel()->GetNumBands(); i++, vit++, bit++)
145 if ((i >= (nGuardBands / 2)) && (i <= ((nGuardBands / 2) + nAllocatedBands - 1)))
147 *vit = txPowerPerBand / (bit->fh - bit->fl);
155 uint16_t channelWidth,
157 uint16_t guardBandwidth,
158 double minInnerBandDbr,
159 double minOuterBandDbr,
160 double lowestPointDbr)
162 NS_LOG_FUNCTION(centerFrequency << channelWidth << txPowerW << guardBandwidth << minInnerBandDbr
163 << minOuterBandDbr << lowestPointDbr);
164 uint32_t carrierSpacing = 0;
165 uint32_t innerSlopeWidth = 0;
166 switch (channelWidth)
169 carrierSpacing = 312500;
170 innerSlopeWidth =
static_cast<uint32_t
>((2e6 / carrierSpacing) + 0.5);
173 carrierSpacing = 156250;
175 static_cast<uint32_t
>((1e6 / carrierSpacing) + 0.5);
178 carrierSpacing = 78125;
180 static_cast<uint32_t
>((5e5 / carrierSpacing) + 0.5);
183 NS_FATAL_ERROR(
"Channel width " << channelWidth <<
" should be correctly set.");
188 GetSpectrumModel(centerFrequency, channelWidth, carrierSpacing, guardBandwidth));
189 auto nGuardBands =
static_cast<uint32_t
>(((2 * guardBandwidth * 1e6) / carrierSpacing) + 0.5);
190 auto nAllocatedBands =
static_cast<uint32_t
>(((channelWidth * 1e6) / carrierSpacing) + 0.5);
197 double txPowerPerBandW = txPowerW / 52;
198 NS_LOG_DEBUG(
"Power per band " << txPowerPerBandW <<
"W");
199 uint32_t start1 = (nGuardBands / 2) + 6;
200 uint32_t stop1 = start1 + 26 - 1;
201 uint32_t start2 = stop1 + 2;
202 uint32_t stop2 = start2 + 26 - 1;
205 std::vector<WifiSpectrumBandIndices> subBands{
206 std::make_pair(start1, stop1),
207 std::make_pair(start2, stop2),
226 uint32_t centerFrequency,
227 uint16_t channelWidth,
229 uint16_t guardBandwidth,
230 double minInnerBandDbr,
231 double minOuterBandDbr,
232 double lowestPointDbr,
233 const std::vector<bool>& puncturedSubchannels)
235 NS_LOG_FUNCTION(centerFrequency << channelWidth << txPowerW << guardBandwidth << minInnerBandDbr
236 << minOuterBandDbr << lowestPointDbr);
237 uint32_t carrierSpacing = 312500;
239 GetSpectrumModel(centerFrequency, channelWidth, carrierSpacing, guardBandwidth));
240 auto nGuardBands =
static_cast<uint32_t
>(((2 * guardBandwidth * 1e6) / carrierSpacing) + 0.5);
241 auto nAllocatedBands =
static_cast<uint32_t
>(((channelWidth * 1e6) / carrierSpacing) + 0.5);
244 std::size_t num20MhzBands = channelWidth / 20;
245 std::size_t numAllocatedSubcarriersPer20MHz = 52;
246 NS_ASSERT(puncturedSubchannels.empty() || (puncturedSubchannels.size() == num20MhzBands));
247 double txPowerPerBandW = (txPowerW / numAllocatedSubcarriersPer20MHz) / num20MhzBands;
248 NS_LOG_DEBUG(
"Power per band " << txPowerPerBandW <<
"W");
250 std::size_t numSubcarriersPer20MHz = (20 * 1e6) / carrierSpacing;
251 std::size_t numUnallocatedSubcarriersPer20MHz =
252 numSubcarriersPer20MHz - numAllocatedSubcarriersPer20MHz;
253 std::vector<WifiSpectrumBandIndices>
255 subBands.resize(num20MhzBands *
257 uint32_t
start = (nGuardBands / 2) + (numUnallocatedSubcarriersPer20MHz / 2);
260 for (
auto it = subBands.begin(); it != subBands.end();)
262 if (!puncturedSubchannels.empty() && puncturedSubchannels.at(index++))
265 NS_LOG_DEBUG(
"20 MHz subchannel " << +index <<
" is punctured");
269 stop =
start + (numAllocatedSubcarriersPer20MHz / 2) - 1;
273 stop =
start + (numAllocatedSubcarriersPer20MHz / 2) - 1;
276 start =
stop + numUnallocatedSubcarriersPer20MHz;
280 auto innerSlopeWidth =
static_cast<uint32_t
>(
281 (2e6 / carrierSpacing) +
302 uint16_t channelWidth,
304 uint16_t guardBandwidth,
305 double minInnerBandDbr,
306 double minOuterBandDbr,
307 double lowestPointDbr)
309 NS_LOG_FUNCTION(centerFrequency << channelWidth << txPowerW << guardBandwidth << minInnerBandDbr
310 << minOuterBandDbr << lowestPointDbr);
311 uint32_t carrierSpacing = 312500;
313 GetSpectrumModel(centerFrequency, channelWidth, carrierSpacing, guardBandwidth));
314 auto nGuardBands =
static_cast<uint32_t
>(((2 * guardBandwidth * 1e6) / carrierSpacing) + 0.5);
315 auto nAllocatedBands =
static_cast<uint32_t
>(((channelWidth * 1e6) / carrierSpacing) + 0.5);
318 std::size_t num20MhzBands = channelWidth / 20;
319 std::size_t numAllocatedSubcarriersPer20MHz = 56;
320 double txPowerPerBandW = (txPowerW / numAllocatedSubcarriersPer20MHz) / num20MhzBands;
321 NS_LOG_DEBUG(
"Power per band " << txPowerPerBandW <<
"W");
323 std::size_t numSubcarriersPer20MHz = (20 * 1e6) / carrierSpacing;
324 std::size_t numUnallocatedSubcarriersPer20MHz =
325 numSubcarriersPer20MHz - numAllocatedSubcarriersPer20MHz;
326 std::vector<WifiSpectrumBandIndices>
328 subBands.resize(num20MhzBands *
330 uint32_t
start = (nGuardBands / 2) + (numUnallocatedSubcarriersPer20MHz / 2);
332 for (
auto it = subBands.begin(); it != subBands.end();)
334 stop =
start + (numAllocatedSubcarriersPer20MHz / 2) - 1;
338 stop =
start + (numAllocatedSubcarriersPer20MHz / 2) - 1;
341 start =
stop + numUnallocatedSubcarriersPer20MHz;
345 auto innerSlopeWidth =
static_cast<uint32_t
>(
346 (2e6 / carrierSpacing) +
367 uint32_t centerFrequency,
368 uint16_t channelWidth,
370 uint16_t guardBandwidth,
371 double minInnerBandDbr,
372 double minOuterBandDbr,
373 double lowestPointDbr,
374 const std::vector<bool>& puncturedSubchannels)
376 NS_LOG_FUNCTION(centerFrequency << channelWidth << txPowerW << guardBandwidth << minInnerBandDbr
377 << minOuterBandDbr << lowestPointDbr);
378 uint32_t carrierSpacing = 78125;
380 GetSpectrumModel(centerFrequency, channelWidth, carrierSpacing, guardBandwidth));
381 auto nGuardBands =
static_cast<uint32_t
>(((2 * guardBandwidth * 1e6) / carrierSpacing) + 0.5);
382 auto nAllocatedBands =
static_cast<uint32_t
>(((channelWidth * 1e6) / carrierSpacing) + 0.5);
385 double txPowerPerBandW = 0.0;
395 auto innerSlopeWidth =
static_cast<uint32_t
>(
396 (1e6 / carrierSpacing) + 0.5);
397 std::vector<WifiSpectrumBandIndices>
400 switch (channelWidth)
404 txPowerPerBandW = txPowerW / 242;
406 static_cast<uint32_t
>((5e5 / carrierSpacing) + 0.5);
410 start1 = (nGuardBands / 2) + 6;
411 stop1 = start1 + 121 - 1;
413 stop2 = start2 + 121 - 1;
414 subBands.emplace_back(start1, stop1);
415 subBands.emplace_back(start2, stop2);
419 txPowerPerBandW = txPowerW / 484;
423 start1 = (nGuardBands / 2) + 12;
424 stop1 = start1 + 242 - 1;
426 stop2 = start2 + 242 - 1;
427 subBands.emplace_back(start1, stop1);
428 subBands.emplace_back(start2, stop2);
432 txPowerPerBandW = txPowerW / 996;
436 start1 = (nGuardBands / 2) + 12;
437 stop1 = start1 + 498 - 1;
439 stop2 = start2 + 498 - 1;
440 subBands.emplace_back(start1, stop1);
441 subBands.emplace_back(start2, stop2);
445 txPowerPerBandW = txPowerW / (2 * 996);
446 start1 = (nGuardBands / 2) + 12;
447 stop1 = start1 + 498 - 1;
449 stop2 = start2 + 498 - 1;
450 start3 = stop2 + (2 * 12);
451 stop3 = start3 + 498 - 1;
453 stop4 = start4 + 498 - 1;
454 subBands.emplace_back(start1, stop1);
455 subBands.emplace_back(start2, stop2);
456 subBands.emplace_back(start3, stop3);
457 subBands.emplace_back(start4, stop4);
460 NS_FATAL_ERROR(
"ChannelWidth " << channelWidth <<
" unsupported");
465 auto puncturedSlopeWidth =
466 static_cast<uint32_t
>((500e3 / carrierSpacing) +
468 std::vector<WifiSpectrumBandIndices> puncturedBands;
469 std::size_t subcarriersPerSuband = (20 * 1e6 / carrierSpacing);
470 uint32_t
start = (nGuardBands / 2);
471 uint32_t
stop =
start + subcarriersPerSuband - 1;
472 for (
auto puncturedSubchannel : puncturedSubchannels)
474 if (puncturedSubchannel)
476 puncturedBands.emplace_back(
start,
stop);
493 puncturedSlopeWidth);
501 uint16_t channelWidth,
503 uint16_t guardBandwidth,
506 NS_LOG_FUNCTION(centerFrequency << channelWidth << txPowerW << guardBandwidth << ru.first
508 uint32_t carrierSpacing = 78125;
510 GetSpectrumModel(centerFrequency, channelWidth, carrierSpacing, guardBandwidth));
515 double txPowerPerBandW = (txPowerW / (ru.second - ru.first + 1));
517 for (
size_t i = 0; i < numBands; i++, vit++, bit++)
519 if (i < ru.first || i > ru.second)
525 *vit = (txPowerPerBandW / (bit->fh - bit->fl));
534 uint16_t channelWidth,
535 uint32_t carrierSpacing,
537 uint16_t guardBandwidth)
540 GetSpectrumModel(centerFrequency, channelWidth, carrierSpacing, guardBandwidth);
552 const double kT_dBm_Hz = -174.0;
553 double kT_W_Hz =
DbmToW(kT_dBm_Hz);
554 double noiseFigureLinear = std::pow(10.0, noiseFigureDb / 10.0);
555 double noisePowerSpectralDensity = kT_W_Hz * noiseFigureLinear;
558 (*noisePsd) = noisePowerSpectralDensity;
566 const std::vector<WifiSpectrumBandIndices>& allocatedSubBands,
568 double txPowerPerBandW,
569 uint32_t nGuardBands,
570 uint32_t innerSlopeWidth,
571 double minInnerBandDbr,
572 double minOuterBandDbr,
573 double lowestPointDbr,
574 const std::vector<WifiSpectrumBandIndices>& puncturedBands,
575 uint32_t puncturedSlopeWidth)
577 NS_LOG_FUNCTION(c << allocatedSubBands.front().first << allocatedSubBands.back().second
578 << maskBand.first << maskBand.second << txPowerPerBandW << nGuardBands
579 << innerSlopeWidth << minInnerBandDbr << minOuterBandDbr << lowestPointDbr
580 << puncturedSlopeWidth);
581 uint32_t numSubBands = allocatedSubBands.size();
583 uint32_t numMaskBands = maskBand.second - maskBand.first + 1;
584 NS_ASSERT(numSubBands && numBands && numMaskBands);
585 NS_LOG_LOGIC(
"Power per band " << txPowerPerBandW <<
"W");
588 double txPowerRefDbm = (10.0 * std::log10(txPowerPerBandW * 1000.0));
589 double txPowerInnerBandMinDbm = txPowerRefDbm + minInnerBandDbr;
590 double txPowerMiddleBandMinDbm = txPowerRefDbm + minOuterBandDbr;
591 double txPowerOuterBandMinDbm =
592 txPowerRefDbm + lowestPointDbr;
595 uint32_t outerSlopeWidth =
598 uint32_t middleSlopeWidth = outerSlopeWidth - (innerSlopeWidth / 2);
602 maskBand.first + outerSlopeWidth - 1);
604 outerBandLeft.second + middleSlopeWidth);
606 allocatedSubBands.front().first - innerSlopeWidth,
607 allocatedSubBands.front().first -
610 middleBandLeft.second + 1,
611 innerBandLeft.first - 1);
613 maskBand.second - outerSlopeWidth + 1,
616 outerBandRight.first - 1);
618 allocatedSubBands.back().second + innerSlopeWidth);
620 std::ostringstream ss;
621 ss <<
"outerBandLeft=[" << outerBandLeft.first <<
";" << outerBandLeft.second <<
"] "
622 <<
"middleBandLeft=[" << middleBandLeft.first <<
";" << middleBandLeft.second <<
"] "
623 <<
"flatJunctionLeft=[" << flatJunctionLeft.first <<
";" << flatJunctionLeft.second <<
"] "
624 <<
"innerBandLeft=[" << innerBandLeft.first <<
";" << innerBandLeft.second <<
"] "
625 <<
"subBands=[" << allocatedSubBands.front().first <<
";" << allocatedSubBands.back().second
627 if (!puncturedBands.empty())
629 ss <<
"puncturedBands=[" << puncturedBands.front().first <<
";"
630 << puncturedBands.back().second <<
"] ";
632 ss <<
"innerBandRight=[" << innerBandRight.first <<
";" << innerBandRight.second <<
"] "
633 <<
"flatJunctionRight=[" << flatJunctionRight.first <<
";" << flatJunctionRight.second
635 <<
"middleBandRight=[" << middleBandRight.first <<
";" << middleBandRight.second <<
"] "
636 <<
"outerBandRight=[" << outerBandRight.first <<
";" << outerBandRight.second <<
"] ";
639 ((allocatedSubBands.back().second - allocatedSubBands.front().first +
641 + 2 * (innerSlopeWidth + middleSlopeWidth + outerSlopeWidth) +
642 (flatJunctionLeft.second - flatJunctionLeft.first + 1)
643 + (flatJunctionRight.second - flatJunctionRight.first + 1)));
646 double innerSlope = (-1 * minInnerBandDbr) / innerSlopeWidth;
647 double middleSlope = (-1 * (minOuterBandDbr - minInnerBandDbr)) / middleSlopeWidth;
648 double outerSlope = (txPowerMiddleBandMinDbm - txPowerOuterBandMinDbm) / outerSlopeWidth;
649 double puncturedSlope = (-1 * minInnerBandDbr) / puncturedSlopeWidth;
654 double txPowerW = 0.0;
655 double previousTxPowerW = 0.0;
656 for (
size_t i = 0; i < numBands; i++, vit++, bit++)
658 if (i < maskBand.first || i > maskBand.second)
662 else if (i <= outerBandLeft.second &&
663 i >= outerBandLeft.first)
665 txPowerW =
DbmToW(txPowerOuterBandMinDbm + ((i - outerBandLeft.first) * outerSlope));
667 else if (i <= middleBandLeft.second && i >= middleBandLeft.first)
669 txPowerW =
DbmToW(txPowerMiddleBandMinDbm + ((i - middleBandLeft.first) * middleSlope));
671 else if (i <= flatJunctionLeft.second && i >= flatJunctionLeft.first)
673 txPowerW =
DbmToW(txPowerInnerBandMinDbm);
675 else if (i <= innerBandLeft.second && i >= innerBandLeft.first)
678 (!puncturedBands.empty() &&
679 (puncturedBands.front().first <= allocatedSubBands.front().first))
680 ?
DbmToW(txPowerInnerBandMinDbm)
682 DbmToW(txPowerInnerBandMinDbm + ((i - innerBandLeft.first) * innerSlope));
684 else if (i <= allocatedSubBands.back().second &&
685 i >= allocatedSubBands.front().first)
687 bool insideSubBand =
false;
688 for (uint32_t j = 0; !insideSubBand && j < numSubBands;
692 (i <= allocatedSubBands[j].second) && (i >= allocatedSubBands[j].
first);
696 bool insidePuncturedSubBand =
false;
698 for (; !insidePuncturedSubBand && j < puncturedBands.size();
701 insidePuncturedSubBand =
702 (i <= puncturedBands[j].second) && (i >= puncturedBands[j].
first);
704 if (insidePuncturedSubBand)
706 uint32_t startPuncturedSlope =
707 (puncturedBands[puncturedBands.size() - 1].second -
708 puncturedSlopeWidth);
709 if (i >= startPuncturedSlope)
711 txPowerW =
DbmToW(txPowerInnerBandMinDbm +
712 ((i - startPuncturedSlope) * puncturedSlope));
717 DbmToW(txPowerRefDbm - ((i - puncturedBands[0].
first) *
723 txPowerW = txPowerPerBandW;
728 txPowerW =
DbmToW(txPowerInnerBandMinDbm);
731 else if (i <= innerBandRight.second && i >= innerBandRight.first)
736 DbmToW(txPowerRefDbm - ((i - innerBandRight.first + 1) *
739 else if (i <= flatJunctionRight.second && i >= flatJunctionRight.first)
741 txPowerW =
DbmToW(txPowerInnerBandMinDbm);
743 else if (i <= middleBandRight.second && i >= middleBandRight.first)
745 txPowerW =
DbmToW(txPowerInnerBandMinDbm -
746 ((i - middleBandRight.first + 1) *
749 else if (i <= outerBandRight.second && i >= outerBandRight.first)
751 txPowerW =
DbmToW(txPowerMiddleBandMinDbm -
752 ((i - outerBandRight.first + 1) *
759 double txPowerDbr = 10 * std::log10(txPowerW / txPowerPerBandW);
761 *vit = txPowerW / (bit->fh - bit->fl);
762 previousTxPowerW = txPowerW;
764 NS_LOG_INFO(
"Added signal power to subbands " << allocatedSubBands.front().first <<
"-"
765 << allocatedSubBands.back().second);
773 double currentTxPowerW =
Integral(*c);
774 double normalizationRatio = currentTxPowerW / txPowerW;
775 NS_LOG_LOGIC(
"Current power: " << currentTxPowerW <<
"W vs expected power: " << txPowerW <<
"W"
776 <<
" -> ratio (C/E) = " << normalizationRatio);
780 *vit = (*vit) / normalizationRatio;
787 return std::pow(10.0, 0.1 * (dBm - 30.0));
793 double powerWattPerHertz = 0.0;
797 while (valueIt <= end)
799 powerWattPerHertz += *valueIt;
802 return powerWattPerHertz * (bandIt->fh - bandIt->fl);
820 return !(left == right);
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 Ptr< SpectrumValue > CreateNoisePowerSpectralDensity(uint32_t centerFrequency, uint16_t channelWidth, uint32_t carrierSpacing, double noiseFigure, uint16_t guardBandwidth)
Create a power spectral density corresponding to the noise.
static Ptr< SpectrumValue > CreateDuplicated20MhzTxPowerSpectralDensity(uint32_t centerFrequency, uint16_t channelWidth, double txPowerW, uint16_t guardBandwidth, double minInnerBandDbr=-20, double minOuterbandDbr=-28, double lowestPointDbr=-40, const std::vector< bool > &puncturedSubchannels=std::vector< bool >{})
Create a transmit power spectral density corresponding to OFDM duplicated over multiple 20 MHz subcha...
static void CreateSpectrumMaskForOfdm(Ptr< SpectrumValue > c, const std::vector< WifiSpectrumBandIndices > &allocatedSubBands, const WifiSpectrumBandIndices &maskBand, double txPowerPerBandW, uint32_t nGuardBands, uint32_t innerSlopeWidth, double minInnerBandDbr, double minOuterbandDbr, double lowestPointDbr, const std::vector< WifiSpectrumBandIndices > &puncturedSubBands=std::vector< WifiSpectrumBandIndices >{}, uint32_t puncturedSlopeWidth=0)
Create a transmit power spectral density corresponding to OFDM transmit spectrum mask requirements fo...
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< SpectrumModel > GetSpectrumModel(uint32_t centerFrequency, uint16_t channelWidth, uint32_t carrierSpacing, uint16_t guardBandwidth)
Return a SpectrumModel instance corresponding to the center frequency and channel width.
static Ptr< SpectrumValue > CreateDsssTxPowerSpectralDensity(uint32_t centerFrequency, double txPowerW, uint16_t guardBandwidth)
Create a transmit power spectral density corresponding to DSSS.
static double GetBandPowerW(Ptr< SpectrumValue > psd, const WifiSpectrumBandIndices &band)
Calculate the power of the specified band composed of uniformly-sized sub-bands.
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 > CreateHeMuOfdmTxPowerSpectralDensity(uint32_t centerFrequency, uint16_t channelWidth, double txPowerW, uint16_t guardBandwidth, const WifiSpectrumBandIndices &ru)
Create a transmit power spectral density corresponding to the OFDMA part of HE TB PPDUs for a given R...
static Ptr< SpectrumValue > CreateHeOfdmTxPowerSpectralDensity(uint32_t centerFrequency, uint16_t channelWidth, double txPowerW, uint16_t guardBandwidth, double minInnerBandDbr=-20, double minOuterbandDbr=-28, double lowestPointDbr=-40, const std::vector< bool > &puncturedSubchannels=std::vector< bool >{})
Create a transmit power spectral density corresponding to OFDM High Efficiency (HE) (802....
#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.
bool operator!=(Callback< R, Args... > a, Callback< R, Args... > b)
Inequality test.
bool operator==(const EventId &a, const EventId &b)
double Integral(const SpectrumValue &arg)
std::vector< BandInfo > Bands
Container of BandInfo.
std::pair< uint32_t, uint32_t > WifiSpectrumBandIndices
typedef for a pair of start and stop sub-band indices
bool operator<(const EventId &a, const EventId &b)
static std::map< WifiSpectrumModelId, Ptr< SpectrumModel > > g_wifiSpectrumModelMap
static initializer for the class
std::ostream & operator<<(std::ostream &os, const Angles &a)
The building block of a SpectrumModel.
double fc
center frequency
double fl
lower limit of subband
double fh
upper limit of subband
Struct defining a frequency range between minFrequency (MHz) and maxFrequency (MHz).
uint16_t maxFrequency
the maximum frequency in MHz
uint16_t minFrequency
the minimum frequency in MHz
Wifi Spectrum Model structure.
uint32_t m_centerFrequency
center frequency (in MHz)
uint16_t m_guardBandwidth
guard band width (in MHz)
uint16_t m_channelWidth
channel width (in MHz)
uint32_t m_carrierSpacing
carrier spacing (in Hz)