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 Types | |
typedef std::pair< uint32_t, uint32_t > | StartStop |
typedef for a pair of start and stop sub-band indexes More... | |
Public Member Functions | |
virtual | ~WifiSpectrumValueHelper () |
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 > | CreateHeOfdmTxPowerSpectralDensity (uint32_t centerFrequency, uint16_t channelWidth, double txPowerW, uint16_t guardBandwidth) |
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) |
Create a transmit power spectral density corresponding to OFDM High Throughput (HT) (802.11n/ac). More... | |
static Ptr< SpectrumValue > | CreateNoisePowerSpectralDensity (uint32_t centerFrequency, uint16_t channelWidth, double bandBandwidth, double noiseFigure, uint16_t guardBandwidth) |
Create a power spectral density corresponding to the noise. More... | |
static Ptr< SpectrumValue > | CreateNoisePowerSpectralDensity (double noiseFigure, Ptr< SpectrumModel > spectrumModel) |
Create a thermal noise power spectral density. More... | |
static Ptr< SpectrumValue > | CreateOfdmTxPowerSpectralDensity (uint32_t centerFrequency, uint16_t channelWidth, double txPowerW, uint16_t guardBandwidth) |
Create a transmit power spectral density corresponding to OFDM (802.11a/g). More... | |
static Ptr< SpectrumValue > | CreateRfFilter (uint32_t centerFrequency, uint16_t channelWidth, double bandBandwidth, uint16_t guardBandwidth) |
Create a spectral density corresponding to the RF filter. More... | |
static void | CreateSpectrumMaskForOfdm (Ptr< SpectrumValue > c, std::vector< StartStop > allocatedSubBands, StartStop maskBand, double txPowerPerBandW, uint32_t nGuardBands, uint32_t innerSlopeWidth, double lowestPointDbr) |
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 Ptr< SpectrumModel > | GetSpectrumModel (uint32_t centerFrequency, uint16_t channelWidth, double bandBandwidth, 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 38 of file wifi-spectrum-value-helper.h.
typedef std::pair<uint32_t, uint32_t> ns3::WifiSpectrumValueHelper::StartStop |
typedef for a pair of start and stop sub-band indexes
Definition at line 153 of file wifi-spectrum-value-helper.h.
|
virtual |
Destructor.
Definition at line 629 of file wifi-spectrum-value-helper.cc.
|
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 136 of file wifi-spectrum-value-helper.cc.
References ns3::SpectrumValue::ConstBandsBegin(), ns3::SpectrumModel::GetNumBands(), GetSpectrumModel(), ns3::SpectrumValue::GetSpectrumModel(), NS_ASSERT, NS_LOG_FUNCTION, and ns3::SpectrumValue::ValuesBegin().
Referenced by ns3::SpectrumWifiPhy::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) |
Definition at line 330 of file wifi-spectrum-value-helper.cc.
References CreateSpectrumMaskForOfdm(), ns3::SpectrumModel::GetNumBands(), GetSpectrumModel(), ns3::SpectrumValue::GetSpectrumModel(), ns3::Integral(), NormalizeSpectrumMask(), NS_ASSERT_MSG(), NS_FATAL_ERROR, and NS_LOG_FUNCTION.
Referenced by ns3::SpectrumWifiPhy::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) |
Definition at line 213 of file wifi-spectrum-value-helper.cc.
References CreateSpectrumMaskForOfdm(), ns3::SpectrumModel::GetNumBands(), GetSpectrumModel(), ns3::SpectrumValue::GetSpectrumModel(), ns3::Integral(), NormalizeSpectrumMask(), NS_ASSERT, NS_ASSERT_MSG(), and NS_LOG_FUNCTION.
Referenced by ns3::SpectrumWifiPhy::GetTxPowerSpectralDensity().
|
static |
Create a power spectral density corresponding to the noise.
centerFrequency | center frequency (MHz) |
channelWidth | channel width (MHz) |
bandBandwidth | width of each band (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 427 of file wifi-spectrum-value-helper.cc.
References GetSpectrumModel().
|
static |
Create a thermal noise power spectral density.
noiseFigure | the noise figure |
spectrumModel | the spectrum model |
Definition at line 434 of file wifi-spectrum-value-helper.cc.
References ns3::Integral(), NS_LOG_FUNCTION, and NS_LOG_INFO.
|
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) |
Definition at line 160 of file wifi-spectrum-value-helper.cc.
References CreateSpectrumMaskForOfdm(), ns3::SpectrumModel::GetNumBands(), GetSpectrumModel(), ns3::SpectrumValue::GetSpectrumModel(), ns3::Integral(), NormalizeSpectrumMask(), NS_ASSERT_MSG(), NS_FATAL_ERROR, NS_LOG_DEBUG, and NS_LOG_FUNCTION.
Referenced by ns3::SpectrumWifiPhy::GetTxPowerSpectralDensity().
|
static |
Create a spectral density corresponding to the RF filter.
centerFrequency | center frequency (MHz) |
channelWidth | channel width (MHz) |
bandBandwidth | width of each band (Hz) |
guardBandwidth | width of the guard band (MHz) |
Definition at line 452 of file wifi-spectrum-value-helper.cc.
References ns3::SpectrumValue::ConstBandsBegin(), ns3::SpectrumModel::GetNumBands(), GetSpectrumModel(), ns3::SpectrumValue::GetSpectrumModel(), NS_ASSERT_MSG(), NS_LOG_FUNCTION, NS_LOG_INFO, NS_LOG_LOGIC(), and ns3::SpectrumValue::ValuesBegin().
Referenced by ns3::SpectrumWifiPhy::StartRx().
|
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.
[ 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) |
lowestPointDbr | maximum relative power of the outermost subcarriers of the guard band (in dBr) |
Definition at line 480 of file wifi-spectrum-value-helper.cc.
References ns3::SpectrumValue::ConstBandsBegin(), DbmToW(), ns3::SpectrumModel::GetNumBands(), ns3::SpectrumValue::GetSpectrumModel(), NS_ASSERT, NS_FATAL_ERROR, NS_LOG_DEBUG, NS_LOG_FUNCTION, NS_LOG_INFO, NS_LOG_LOGIC(), and ns3::SpectrumValue::ValuesBegin().
Referenced by 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 621 of file wifi-spectrum-value-helper.cc.
Referenced by CreateSpectrumMaskForOfdm().
|
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) |
bandBandwidth | width of each band (Hz) |
guardBandwidth | width of the guard band (MHz) |
Definition at line 86 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(), CreateHeOfdmTxPowerSpectralDensity(), CreateHtOfdmTxPowerSpectralDensity(), CreateNoisePowerSpectralDensity(), CreateOfdmTxPowerSpectralDensity(), CreateRfFilter(), ns3::SpectrumWifiPhy::GetRxSpectrumModel(), and ns3::SpectrumWifiPhy::ResetSpectrumModel().
|
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 605 of file wifi-spectrum-value-helper.cc.
References ns3::SpectrumModel::GetNumBands(), ns3::SpectrumValue::GetSpectrumModel(), ns3::Integral(), NS_LOG_FUNCTION, NS_LOG_LOGIC(), and ns3::SpectrumValue::ValuesBegin().
Referenced by CreateHeOfdmTxPowerSpectralDensity(), CreateHtOfdmTxPowerSpectralDensity(), and CreateOfdmTxPowerSpectralDensity().