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. More... | |
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. More... | |
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. More... | |
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. More... | |
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). More... | |
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). More... | |
static Ptr< SpectrumValue > | CreateNoisePowerSpectralDensity (double noiseFigure, Ptr< SpectrumModel > spectrumModel) |
Create a thermal noise power spectral density. More... | |
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. More... | |
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). More... | |
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. More... | |
static double | DbmToW (double dbm) |
Convert from dBm to Watts. More... | |
static double | GetBandPowerW (Ptr< SpectrumValue > psd, const WifiSpectrumBandIndices &band) |
Calculate the power of the specified band composed of uniformly-sized sub-bands. More... | |
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. More... | |
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. More... | |
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 127 of file wifi-spectrum-value-helper.cc.
References ns3::SpectrumValue::ConstBandsBegin(), ns3::SpectrumModel::GetNumBands(), ns3::SpectrumValue::GetSpectrumModel(), GetSpectrumModel(), NS_ASSERT, NS_LOG_FUNCTION, and ns3::SpectrumValue::ValuesBegin().
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 225 of file wifi-spectrum-value-helper.cc.
References CreateSpectrumMaskForOfdm(), ns3::SpectrumModel::GetNumBands(), ns3::SpectrumValue::GetSpectrumModel(), GetSpectrumModel(), ns3::Integral(), NormalizeSpectrumMask(), NS_ASSERT, NS_ASSERT_MSG, NS_LOG_DEBUG, NS_LOG_FUNCTION, two-ray-to-three-gpp-ch-calibration::start, and two-ray-to-three-gpp-ch-calibration::stop.
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 500 of file wifi-spectrum-value-helper.cc.
References ns3::SpectrumValue::ConstBandsBegin(), ns3::SpectrumModel::GetNumBands(), ns3::SpectrumValue::GetSpectrumModel(), GetSpectrumModel(), NS_LOG_FUNCTION, and ns3::SpectrumValue::ValuesBegin().
Referenced by ns3::HePhy::GetTxPowerSpectralDensity().
|
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 366 of file wifi-spectrum-value-helper.cc.
References CreateSpectrumMaskForOfdm(), ns3::SpectrumModel::GetNumBands(), ns3::SpectrumValue::GetSpectrumModel(), GetSpectrumModel(), ns3::Integral(), NormalizeSpectrumMask(), NS_ASSERT_MSG, NS_FATAL_ERROR, NS_LOG_FUNCTION, two-ray-to-three-gpp-ch-calibration::start, and two-ray-to-three-gpp-ch-calibration::stop.
Referenced by ns3::HePhy::GetTxPowerSpectralDensity().
|
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 301 of file wifi-spectrum-value-helper.cc.
References CreateSpectrumMaskForOfdm(), ns3::SpectrumModel::GetNumBands(), ns3::SpectrumValue::GetSpectrumModel(), GetSpectrumModel(), ns3::Integral(), NormalizeSpectrumMask(), NS_ASSERT_MSG, NS_LOG_DEBUG, NS_LOG_FUNCTION, two-ray-to-three-gpp-ch-calibration::start, and two-ray-to-three-gpp-ch-calibration::stop.
Referenced by ns3::HtPhy::GetTxPowerSpectralDensity().
|
static |
Create a thermal noise power spectral density.
noiseFigure | the noise figure |
spectrumModel | the spectrum model |
Definition at line 545 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 533 of file wifi-spectrum-value-helper.cc.
References GetSpectrumModel().
|
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 154 of file wifi-spectrum-value-helper.cc.
References CreateSpectrumMaskForOfdm(), ns3::SpectrumModel::GetNumBands(), ns3::SpectrumValue::GetSpectrumModel(), GetSpectrumModel(), ns3::Integral(), NormalizeSpectrumMask(), NS_ASSERT_MSG, NS_FATAL_ERROR, NS_LOG_DEBUG, and NS_LOG_FUNCTION.
Referenced by ns3::OfdmPhy::GetTxPowerSpectralDensity().
|
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 564 of file wifi-spectrum-value-helper.cc.
References ns3::SpectrumValue::ConstBandsBegin(), DbmToW(), ns3::SpectrumModel::GetNumBands(), ns3::SpectrumValue::GetSpectrumModel(), max, min, NS_ASSERT, NS_FATAL_ERROR, NS_LOG_DEBUG, NS_LOG_FUNCTION, NS_LOG_INFO, NS_LOG_LOGIC, and ns3::SpectrumValue::ValuesBegin().
Referenced by CreateDuplicated20MhzTxPowerSpectralDensity(), CreateHeOfdmTxPowerSpectralDensity(), CreateHtOfdmTxPowerSpectralDensity(), and CreateOfdmTxPowerSpectralDensity().
|
static |
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 785 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 791 of file wifi-spectrum-value-helper.cc.
References ns3::SpectrumValue::ConstBandsBegin(), and ns3::SpectrumValue::ConstValuesBegin().
Referenced by ns3::SpectrumWifiPhy::StartRx().
|
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, ns3::SpectrumModel::GetUid(), 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 769 of file wifi-spectrum-value-helper.cc.
References ns3::SpectrumValue::GetSpectrumModel(), ns3::Integral(), NS_LOG_FUNCTION, NS_LOG_LOGIC, and ns3::SpectrumValue::ValuesBegin().
Referenced by CreateDuplicated20MhzTxPowerSpectralDensity(), CreateHeOfdmTxPowerSpectralDensity(), CreateHtOfdmTxPowerSpectralDensity(), and CreateOfdmTxPowerSpectralDensity().