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 (uint32_t centerFrequency, double txPowerW, uint16_t guardBandwidth) |
Create a transmit power spectral density corresponding to DSSS. | |
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 subchannels. | |
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 RU. | |
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.11ax). | |
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.11n/ac). | |
static Ptr< SpectrumValue > | CreateNoisePowerSpectralDensity (double noiseFigure, Ptr< SpectrumModel > spectrumModel) |
Create a thermal noise power spectral density. | |
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 > | 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 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 for 11a/11g/11n/11ac/11ax Channel width may vary between 5, 10, 20, 40, 80, and 160 MHz. | |
static double | DbmToW (double dbm) |
Convert from dBm to Watts. | |
static double | GetBandPowerW (Ptr< SpectrumValue > psd, const WifiSpectrumBandIndices &band) |
Calculate the power of the specified band composed of uniformly-sized sub-bands. | |
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 void | NormalizeSpectrumMask (Ptr< SpectrumValue > c, double txPowerW) |
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 42 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 (MHz) |
txPowerW | transmit power (W) to allocate |
guardBandwidth | width of the guard band (MHz) |
Definition at line 128 of file wifi-spectrum-value-helper.cc.
References 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.
centerFrequency | center frequency (MHz) |
channelWidth | channel width (MHz) |
txPowerW | transmit power (W) to allocate |
guardBandwidth | width of the guard band (MHz) |
minInnerBandDbr | the minimum relative power in the inner band (in dBr) |
minOuterbandDbr | the minimum relative power in the outer band (in dBr) |
lowestPointDbr | maximum relative power of the outermost subcarriers of the guard band (in dBr) |
puncturedSubchannels | bitmap indicating whether a 20 MHz subchannel is punctured or not |
Definition at line 228 of file wifi-spectrum-value-helper.cc.
References CreateSpectrumMaskForOfdm(), GetSpectrumModel(), ns3::Integral(), NormalizeSpectrumMask(), NS_ASSERT, NS_ASSERT_MSG, NS_LOG_DEBUG, and NS_LOG_FUNCTION.
Referenced by ns3::OfdmPhy::GetTxPowerSpectralDensity(), and ns3::HePhy::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.
centerFrequency | center frequency (MHz) |
channelWidth | channel width (MHz) |
txPowerW | transmit power (W) to allocate |
guardBandwidth | width of the guard band (MHz) |
ru | the RU band used by the STA |
Definition at line 506 of file wifi-spectrum-value-helper.cc.
References 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).
Channel width may vary between 20, 40, 80, and 160 MHz.
centerFrequency | center frequency (MHz) |
channelWidth | channel width (MHz) |
txPowerW | transmit power (W) to allocate |
guardBandwidth | width of the guard band (MHz) |
minInnerBandDbr | the minimum relative power in the inner band (in dBr) |
minOuterbandDbr | the minimum relative power in the outer band (in dBr) |
lowestPointDbr | maximum relative power of the outermost subcarriers of the guard band (in dBr) |
puncturedSubchannels | bitmap indicating whether a 20 MHz subchannel is punctured or not |
Definition at line 371 of file wifi-spectrum-value-helper.cc.
References CreateSpectrumMaskForOfdm(), GetSpectrumModel(), ns3::Integral(), NormalizeSpectrumMask(), NS_ASSERT_MSG, NS_FATAL_ERROR, and NS_LOG_FUNCTION.
Referenced by 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.
centerFrequency | center frequency (MHz) |
channelWidth | channel width (MHz) |
txPowerW | transmit power (W) to allocate |
guardBandwidth | width of the guard band (MHz) |
minInnerBandDbr | the minimum relative power in the inner band (in dBr) |
minOuterbandDbr | the minimum relative power in the outer band (in dBr) |
lowestPointDbr | maximum relative power of the outermost subcarriers of the guard band (in dBr) |
Definition at line 305 of file wifi-spectrum-value-helper.cc.
References 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 thermal noise power spectral density.
noiseFigure | the noise figure |
spectrumModel | the spectrum model |
Definition at line 551 of file wifi-spectrum-value-helper.cc.
References DbmToW(), ns3::Integral(), NS_LOG_FUNCTION, and NS_LOG_INFO.
|
static |
Create a power spectral density corresponding to the noise.
centerFrequency | center frequency (MHz) |
channelWidth | channel width (MHz) |
carrierSpacing | carrier spacing (Hz) |
noiseFigure | the noise figure in dB w.r.t. a reference temperature of 290K |
guardBandwidth | width of the guard band (MHz) |
Definition at line 539 of file wifi-spectrum-value-helper.cc.
References CreateNoisePowerSpectralDensity(), and GetSpectrumModel().
Referenced by CreateNoisePowerSpectralDensity().
|
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 (MHz) |
channelWidth | channel width (MHz) |
txPowerW | transmit power (W) to allocate |
guardBandwidth | width of the guard band (MHz) |
minInnerBandDbr | the minimum relative power in the inner band (in dBr) |
minOuterbandDbr | the minimum relative power in the outer band (in dBr) |
lowestPointDbr | maximum relative power of the outermost subcarriers of the guard band (in dBr) |
Definition at line 156 of file wifi-spectrum-value-helper.cc.
References 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) |
allocatedSubBands | vector of start and stop subcarrier indexes of the allocated sub bands |
maskBand | start and stop subcarrier indexes of transmit mask (in case signal doesn't cover whole SpectrumModel) |
txPowerPerBandW | 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) |
minInnerBandDbr | the minimum relative power in the inner band (i.e., -20 dBr in the figure above) |
minOuterbandDbr | the minimum relative power in the outer band (i.e., -28 dBr in the figure above) |
lowestPointDbr | maximum relative power of the outermost subcarriers of the guard band (in dBr) |
puncturedSubBands | vector of start and stop subcarrier indexes of the punctured sub bands |
puncturedSlopeWidth | size (in number of subcarriers) of the punctured band slope |
Definition at line 570 of file wifi-spectrum-value-helper.cc.
References DbmToW(), NS_ASSERT, NS_FATAL_ERROR, NS_LOG_DEBUG, NS_LOG_FUNCTION, NS_LOG_INFO, and NS_LOG_LOGIC.
Referenced by CreateDuplicated20MhzTxPowerSpectralDensity(), CreateHeOfdmTxPowerSpectralDensity(), CreateHtOfdmTxPowerSpectralDensity(), and CreateOfdmTxPowerSpectralDensity().
Convert from dBm to Watts.
Taken from wifi-utils since the original method couldn't be called from here due to resulting circular dependencies of spectrum and wifi modules.
dbm | the power in dBm |
Definition at line 791 of file wifi-spectrum-value-helper.cc.
Referenced by CreateNoisePowerSpectralDensity(), and CreateSpectrumMaskForOfdm().
|
static |
Calculate the power of the specified band composed of uniformly-sized sub-bands.
psd | received Power Spectral Density in W/Hz |
band | a pair of start and stop indexes that defines the band |
Definition at line 797 of file wifi-spectrum-value-helper.cc.
|
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).
centerFrequency | center frequency (MHz) |
channelWidth | channel width (MHz) |
carrierSpacing | carrier spacing (Hz) |
guardBandwidth | width of the guard band (MHz) |
Definition at line 72 of file wifi-spectrum-value-helper.cc.
References f(), 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(), CreateNoisePowerSpectralDensity(), 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) |
txPowerW | total transmit power (W) to allocate |
Definition at line 775 of file wifi-spectrum-value-helper.cc.
References ns3::Integral(), NS_LOG_FUNCTION, and NS_LOG_LOGIC.
Referenced by CreateDuplicated20MhzTxPowerSpectralDensity(), CreateHeOfdmTxPowerSpectralDensity(), CreateHtOfdmTxPowerSpectralDensity(), and CreateOfdmTxPowerSpectralDensity().