This class defines all functions to create a spectrum model for Wi-Fi based on a a spectral model aligned with an OFDM subcarrier spacing of 312.5 KHz (model also reused for DSSS modulations) More...
#include "wifi-spectrum-value-helper.h"
Public Member Functions | |
virtual | ~WifiSpectrumValueHelper ()=default |
Destructor. | |
Static Public Member Functions | |
static Ptr< SpectrumValue > | CreateDsssTxPowerSpectralDensity (MHz_u centerFrequency, Watt_u txPower, MHz_u guardBandwidth) |
Create a transmit power spectral density corresponding to DSSS. | |
static Ptr< SpectrumValue > | CreateDuplicated20MhzTxPowerSpectralDensity (const std::vector< MHz_u > ¢erFrequencies, MHz_u channelWidth, Watt_u txPower, MHz_u guardBandwidth, dBr_u minInnerBand=-20, dBr_u minOuterband=-28, dBr_u lowestPoint=-40, const std::vector< bool > &puncturedSubchannels={}) |
Create a transmit power spectral density corresponding to OFDM duplicated over multiple 20 MHz subchannels. | |
static Ptr< SpectrumValue > | CreateHeMuOfdmTxPowerSpectralDensity (const std::vector< MHz_u > ¢erFrequencies, MHz_u channelWidth, Watt_u txPower, MHz_u guardBandwidth, const std::vector< WifiSpectrumBandIndices > &ru) |
Create a transmit power spectral density corresponding to the OFDMA part of HE TB PPDUs for a given RU. | |
static Ptr< SpectrumValue > | CreateHeOfdmTxPowerSpectralDensity (const std::vector< MHz_u > ¢erFrequencies, MHz_u channelWidth, Watt_u txPower, MHz_u guardBandwidth, dBr_u minInnerBand=-20, dBr_u minOuterband=-28, dBr_u lowestPoint=-40, const std::vector< bool > &puncturedSubchannels={}) |
Create a transmit power spectral density corresponding to OFDM High Efficiency (HE) (802.11ax) made of one or more frequency segment(s). | |
static Ptr< SpectrumValue > | CreateHeOfdmTxPowerSpectralDensity (MHz_u centerFrequency, MHz_u channelWidth, Watt_u txPower, MHz_u guardBandwidth, dBr_u minInnerBand=-20, dBr_u minOuterband=-28, dBr_u lowestPoint=-40, const std::vector< bool > &puncturedSubchannels={}) |
Create a transmit power spectral density corresponding to OFDM High Efficiency (HE) (802.11ax) for contiguous channels. | |
static Ptr< SpectrumValue > | CreateHtOfdmTxPowerSpectralDensity (const std::vector< MHz_u > ¢erFrequencies, MHz_u channelWidth, Watt_u txPower, MHz_u guardBandwidth, dBr_u minInnerBand=-20, dBr_u minOuterband=-28, dBr_u lowestPoint=-40) |
Create a transmit power spectral density corresponding to OFDM High Throughput (HT) (802.11n/ac). | |
static Ptr< SpectrumValue > | CreateOfdmTxPowerSpectralDensity (MHz_u centerFrequency, MHz_u channelWidth, Watt_u txPower, MHz_u guardBandwidth, dBr_u minInnerBand=-20, dBr_u minOuterband=-28, dBr_u lowestPoint=-40) |
Create a transmit power spectral density corresponding to OFDM (802.11a/g). | |
static void | CreateSpectrumMaskForOfdm (Ptr< SpectrumValue > c, const std::vector< std::vector< WifiSpectrumBandIndices > > &allocatedSubBandsPerSegment, const WifiSpectrumBandIndices &maskBand, Watt_u txPowerPerBand, uint32_t nGuardBands, uint32_t innerSlopeWidth, dBr_u minInnerBand, dBr_u minOuterband, dBr_u lowestPoint, const std::vector< std::vector< WifiSpectrumBandIndices > > &puncturedSubBands={}, uint32_t puncturedSlopeWidth=0) |
Create a transmit power spectral density corresponding to OFDM transmit spectrum mask requirements for 11a/11g/11n/11ac/11ax Channel width may vary between 5, 10, 20, 40, 80, and 160 MHz. | |
static Watt_u | GetBandPowerW (Ptr< SpectrumValue > psd, const std::vector< WifiSpectrumBandIndices > &segments) |
Calculate the power of the specified band composed of uniformly-sized sub-bands. | |
static Ptr< SpectrumModel > | GetSpectrumModel (const std::vector< MHz_u > ¢erFrequencies, MHz_u channelWidth, Hz_u carrierSpacing, MHz_u guardBandwidth) |
Return a SpectrumModel instance corresponding to the center frequency and channel width. | |
static void | NormalizeSpectrumMask (Ptr< SpectrumValue > c, Watt_u txPower) |
Normalize the transmit spectrum mask generated by CreateSpectrumMaskForOfdm so that the total transmitted power corresponds to the input value. | |
This class defines all functions to create a spectrum model for Wi-Fi based on a a spectral model aligned with an OFDM subcarrier spacing of 312.5 KHz (model also reused for DSSS modulations)
Definition at line 35 of file wifi-spectrum-value-helper.h.
|
virtualdefault |
Destructor.
|
static |
Create a transmit power spectral density corresponding to DSSS.
The center frequency typically corresponds to 802.11b channel center frequencies but is not restricted to those frequencies.
centerFrequency | center frequency |
txPower | transmit power to allocate |
guardBandwidth | width of the guard band |
Definition at line 160 of file wifi-spectrum-value-helper.cc.
References ns3::Create(), GetSpectrumModel(), NS_ASSERT, and NS_LOG_FUNCTION.
Referenced by ns3::DsssPhy::GetTxPowerSpectralDensity().
|
static |
Create a transmit power spectral density corresponding to OFDM duplicated over multiple 20 MHz subchannels.
Channel width may vary between 20, 40, 80, and 160 MHz.
centerFrequencies | center frequency per segment |
channelWidth | total allocated channel width over all segments |
txPower | transmit power to allocate |
guardBandwidth | width of the guard band |
minInnerBand | the minimum relative power in the inner band |
minOuterband | the minimum relative power in the outer band |
lowestPoint | maximum relative power of the outermost subcarriers of the guard band |
puncturedSubchannels | bitmap indicating whether a 20 MHz subchannel is punctured or not |
Definition at line 259 of file wifi-spectrum-value-helper.cc.
References ns3::Create(), CreateSpectrumMaskForOfdm(), GetSpectrumModel(), ns3::Integral(), NormalizeSpectrumMask(), NS_ASSERT, NS_ASSERT_MSG, NS_LOG_DEBUG, and NS_LOG_FUNCTION.
Referenced by ns3::HePhy::GetTxPowerSpectralDensity(), and ns3::OfdmPhy::GetTxPowerSpectralDensity().
|
static |
Create a transmit power spectral density corresponding to the OFDMA part of HE TB PPDUs for a given RU.
An ideal (i.e. rectangular) spectral mask is considered for the time being.
centerFrequencies | center frequency per segment |
channelWidth | total allocated channel width over all segments |
txPower | transmit power to allocate |
guardBandwidth | width of the guard band |
ru | the RU band used by the STA |
Definition at line 643 of file wifi-spectrum-value-helper.cc.
References ns3::Create(), GetSpectrumModel(), and NS_LOG_FUNCTION.
Referenced by ns3::HePhy::GetTxPowerSpectralDensity(), and TestMultipleHeTbPreambles::RxHeTbPpdu().
|
static |
Create a transmit power spectral density corresponding to OFDM High Efficiency (HE) (802.11ax) made of one or more frequency segment(s).
Channel width may vary between 20, 40, 80, and 160 MHz.
centerFrequencies | center frequency per segment |
channelWidth | total allocated channel width over all segments |
txPower | transmit power to allocate |
guardBandwidth | width of the guard band |
minInnerBand | the minimum relative power in the inner band |
minOuterband | the minimum relative power in the outer band |
lowestPoint | maximum relative power of the outermost subcarriers of the guard band |
puncturedSubchannels | bitmap indicating whether a 20 MHz subchannel is punctured or not |
Definition at line 474 of file wifi-spectrum-value-helper.cc.
References ns3::Create(), CreateSpectrumMaskForOfdm(), GetSpectrumModel(), ns3::Integral(), NormalizeSpectrumMask(), NS_ASSERT_MSG, NS_FATAL_ERROR, and NS_LOG_FUNCTION.
|
static |
Create a transmit power spectral density corresponding to OFDM High Efficiency (HE) (802.11ax) for contiguous channels.
Channel width may vary between 20, 40, 80, and 160 MHz.
centerFrequency | center frequency |
channelWidth | channel width |
txPower | transmit power to allocate |
guardBandwidth | width of the guard band |
minInnerBand | the minimum relative power in the inner band |
minOuterband | the minimum relative power in the outer band |
lowestPoint | maximum relative power of the outermost subcarriers of the guard band |
puncturedSubchannels | bitmap indicating whether a 20 MHz subchannel is punctured or not |
Definition at line 453 of file wifi-spectrum-value-helper.cc.
References CreateHeOfdmTxPowerSpectralDensity().
Referenced by CreateHeOfdmTxPowerSpectralDensity(), WifiOfdmMaskSlopesTestCase::DoSetup(), ns3::HePhy::GetTxPowerSpectralDensity(), WifiPhyThresholdsTest::MakeForeignSignal(), WifiPhyThresholdsTest::MakeWifiSignal(), TestMultipleHeTbPreambles::RxHeTbPpdu(), TestAmpduReception::SendAmpduWithThreeMpdus(), WifiPhyReceptionTest::SendPacket(), and TestUnsupportedBandwidthReception::SendPpdu().
|
static |
Create a transmit power spectral density corresponding to OFDM High Throughput (HT) (802.11n/ac).
Channel width may vary between 20, 40, 80, and 160 MHz.
centerFrequencies | center frequency per segment |
channelWidth | total allocated channel width over all segments |
txPower | transmit power to allocate |
guardBandwidth | width of the guard band |
minInnerBand | the minimum relative power in the inner band |
minOuterband | the minimum relative power in the outer band |
lowestPoint | maximum relative power of the outermost subcarriers of the guard band |
Definition at line 364 of file wifi-spectrum-value-helper.cc.
References ns3::Create(), CreateSpectrumMaskForOfdm(), GetSpectrumModel(), ns3::Integral(), NormalizeSpectrumMask(), NS_ASSERT_MSG, NS_LOG_DEBUG, and NS_LOG_FUNCTION.
Referenced by WifiOfdmMaskSlopesTestCase::DoSetup(), and ns3::HtPhy::GetTxPowerSpectralDensity().
|
static |
Create a transmit power spectral density corresponding to OFDM (802.11a/g).
Channel width may vary between 20, 10, and 5 MHz. Guard bandwidth also typically varies with channel width.
centerFrequency | center frequency |
channelWidth | channel width |
txPower | transmit power to allocate |
guardBandwidth | width of the guard band |
minInnerBand | the minimum relative power in the inner band |
minOuterband | the minimum relative power in the outer band |
lowestPoint | maximum relative power of the outermost subcarriers of the guard band |
Definition at line 188 of file wifi-spectrum-value-helper.cc.
References ns3::Create(), CreateSpectrumMaskForOfdm(), GetSpectrumModel(), ns3::Integral(), NormalizeSpectrumMask(), NS_ASSERT_MSG, NS_FATAL_ERROR, NS_LOG_DEBUG, and NS_LOG_FUNCTION.
Referenced by WifiOfdmMaskSlopesTestCase::DoSetup(), ns3::OfdmPhy::GetTxPowerSpectralDensity(), and SpectrumWifiPhyBasicTest::MakeSignal().
|
static |
Create a transmit power spectral density corresponding to OFDM transmit spectrum mask requirements for 11a/11g/11n/11ac/11ax Channel width may vary between 5, 10, 20, 40, 80, and 160 MHz.
The default (standard) values are illustrated below.
[ guard band ][ channel width ][ guard band ] __________ __________ _ 0 dBr / | | \ / |_| \ _ -20 dBr . ' ' . . ' ' . _ -28 dBr .' '. .' '. .' '. _ lowest point
|--—| |--—| outerBand left/right |---—| |– —| middle band left/right |-| |-| inner band left/right |--------------------—| allocated sub-bands |--------------------------------------------------—| mask band
Please take note that, since guard tones are within the allocated band while not being ideally allocated any power, the inner band had to be shifted inwards and a flat junction band (at -20 dBr) had to be added between the inner and the middle bands.
c | spectrumValue to allocate according to transmit power spectral density mask (in W/Hz for each band) |
allocatedSubBandsPerSegment | vector of start and stop subcarrier indexes of the allocated sub bands, for each segment |
maskBand | start and stop subcarrier indexes of transmit mask (in case signal doesn't cover whole SpectrumModel) |
txPowerPerBand | power allocated to each subcarrier in the allocated sub bands |
nGuardBands | size (in number of subcarriers) of the guard band (left and right) |
innerSlopeWidth | size (in number of subcarriers) of the inner band (i.e. slope going from 0 dBr to -20 dBr in the figure above) |
minInnerBand | the minimum relative power in the inner band (i.e., -20 dBr in the figure above) |
minOuterband | the minimum relative power in the outer band (i.e., -28 dBr in the figure above) |
lowestPoint | maximum relative power of the outermost subcarriers of the guard band |
puncturedSubBands | vector of start and stop subcarrier indexes of the punctured sub bands, for each segment |
puncturedSlopeWidth | size (in number of subcarriers) of the punctured band slope |
Definition at line 686 of file wifi-spectrum-value-helper.cc.
References ns3::DbmToW(), NS_ASSERT, NS_ASSERT_MSG, NS_FATAL_ERROR, NS_LOG_DEBUG, NS_LOG_FUNCTION, NS_LOG_INFO, and NS_LOG_LOGIC.
Referenced by CreateDuplicated20MhzTxPowerSpectralDensity(), CreateHeOfdmTxPowerSpectralDensity(), CreateHtOfdmTxPowerSpectralDensity(), and CreateOfdmTxPowerSpectralDensity().
|
static |
Calculate the power of the specified band composed of uniformly-sized sub-bands.
psd | received Power Spectral Density in W/Hz |
segments | a vector of pair of start and stop indexes that defines each segment of the band |
Definition at line 1098 of file wifi-spectrum-value-helper.cc.
References NS_ASSERT_MSG.
|
static |
Return a SpectrumModel instance corresponding to the center frequency and channel width.
The spectrum model spans the channel width +/- the guard bands (i.e. the model will span (channelWidth + 2 * guardBandwidth) MHz of bandwidth).
centerFrequencies | center frequency per segment |
channelWidth | total allocated channel width over all segments |
carrierSpacing | carrier spacing |
guardBandwidth | total width of the guard band, which will be split over the segments |
Definition at line 83 of file wifi-spectrum-value-helper.cc.
References ns3::Create(), ns3::BandInfo::fc, ns3::BandInfo::fh, ns3::BandInfo::fl, ns3::g_wifiSpectrumModelMap, NS_ASSERT, NS_ASSERT_MSG, NS_LOG_DEBUG, NS_LOG_FUNCTION, and NS_LOG_LOGIC.
Referenced by CreateDsssTxPowerSpectralDensity(), CreateDuplicated20MhzTxPowerSpectralDensity(), CreateHeMuOfdmTxPowerSpectralDensity(), CreateHeOfdmTxPowerSpectralDensity(), CreateHtOfdmTxPowerSpectralDensity(), CreateOfdmTxPowerSpectralDensity(), and ns3::WifiSpectrumPhyInterface::SetRxSpectrumModel().
|
static |
Normalize the transmit spectrum mask generated by CreateSpectrumMaskForOfdm so that the total transmitted power corresponds to the input value.
c | spectrumValue to normalize (in W/Hz for each band) |
txPower | total transmit power to allocate |
Definition at line 1081 of file wifi-spectrum-value-helper.cc.
References ns3::Integral(), NS_LOG_FUNCTION, and NS_LOG_LOGIC.
Referenced by CreateDuplicated20MhzTxPowerSpectralDensity(), CreateHeOfdmTxPowerSpectralDensity(), CreateHtOfdmTxPowerSpectralDensity(), and CreateOfdmTxPowerSpectralDensity().