A Discrete-Event Network Simulator
API
ns3::WifiSpectrumValueHelper Class Reference

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 ()
 Destructor. More...
 

Static Public Member Functions

static Ptr< SpectrumValueCreateDsssTxPowerSpectralDensity (uint32_t centerFrequency, double txPowerW, uint16_t guardBandwidth)
 Create a transmit power spectral density corresponding to DSSS. More...
 
static Ptr< SpectrumValueCreateHeMuOfdmTxPowerSpectralDensity (uint32_t centerFrequency, uint16_t channelWidth, double txPowerW, uint16_t guardBandwidth, WifiSpectrumBand ru)
 Create a transmit power spectral density corresponding to the OFDMA part of HE TB PPDUs for a given RU. More...
 
static Ptr< SpectrumValueCreateHeOfdmTxPowerSpectralDensity (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 Efficiency (HE) (802.11ax). More...
 
static Ptr< SpectrumValueCreateHtOfdmTxPowerSpectralDensity (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< SpectrumValueCreateNoisePowerSpectralDensity (double noiseFigure, Ptr< SpectrumModel > spectrumModel)
 Create a thermal noise power spectral density. More...
 
static Ptr< SpectrumValueCreateNoisePowerSpectralDensity (uint32_t centerFrequency, uint16_t channelWidth, uint32_t bandBandwidth, double noiseFigure, uint16_t guardBandwidth)
 Create a power spectral density corresponding to the noise. More...
 
static Ptr< SpectrumValueCreateOfdmTxPowerSpectralDensity (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 Ptr< SpectrumValueCreateRfFilter (uint32_t centerFrequency, uint16_t totalChannelWidth, uint32_t bandBandwidth, uint16_t guardBandwidth, WifiSpectrumBand band)
 Create a spectral density corresponding to the RF filter. More...
 
static void CreateSpectrumMaskForOfdm (Ptr< SpectrumValue > c, std::vector< WifiSpectrumBand > allocatedSubBands, WifiSpectrumBand maskBand, double txPowerPerBandW, uint32_t nGuardBands, uint32_t innerSlopeWidth, double minInnerBandDbr, double minOuterbandDbr, 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 double GetBandPowerW (Ptr< SpectrumValue > psd, const WifiSpectrumBand &band)
 Calculate the power of the specified band composed of uniformly-sized sub-bands. More...
 
static Ptr< SpectrumModelGetSpectrumModel (uint32_t centerFrequency, uint16_t channelWidth, uint32_t 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...
 

Detailed Description

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 43 of file wifi-spectrum-value-helper.h.

Constructor & Destructor Documentation

◆ ~WifiSpectrumValueHelper()

ns3::WifiSpectrumValueHelper::~WifiSpectrumValueHelper ( )
virtual

Destructor.

Definition at line 660 of file wifi-spectrum-value-helper.cc.

Member Function Documentation

◆ CreateDsssTxPowerSpectralDensity()

Ptr< SpectrumValue > ns3::WifiSpectrumValueHelper::CreateDsssTxPowerSpectralDensity ( uint32_t  centerFrequency,
double  txPowerW,
uint16_t  guardBandwidth 
)
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.

Note
There is no channel width parameter; this method assumes 22 MHz
Parameters
centerFrequencycenter frequency (MHz)
txPowerWtransmit power (W) to allocate
guardBandwidthwidth of the guard band (MHz)
Returns
a pointer to a newly allocated SpectrumValue representing the DSSS Transmit Power Spectral Density in W/Hz

Definition at line 136 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().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ CreateHeMuOfdmTxPowerSpectralDensity()

Ptr< SpectrumValue > ns3::WifiSpectrumValueHelper::CreateHeMuOfdmTxPowerSpectralDensity ( uint32_t  centerFrequency,
uint16_t  channelWidth,
double  txPowerW,
uint16_t  guardBandwidth,
WifiSpectrumBand  ru 
)
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.

Parameters
centerFrequencycenter frequency (MHz)
channelWidthchannel width (MHz)
txPowerWtransmit power (W) to allocate
guardBandwidthwidth of the guard band (MHz)
ruthe RU band used by the STA
Returns
a pointer to a newly allocated SpectrumValue representing the HE OFDM Transmit Power Spectral Density on the RU used by the STA in W/Hz for each Band

Definition at line 425 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().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ CreateHeOfdmTxPowerSpectralDensity()

Ptr< SpectrumValue > ns3::WifiSpectrumValueHelper::CreateHeOfdmTxPowerSpectralDensity ( uint32_t  centerFrequency,
uint16_t  channelWidth,
double  txPowerW,
uint16_t  guardBandwidth,
double  minInnerBandDbr = -20,
double  minOuterbandDbr = -28,
double  lowestPointDbr = -40 
)
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.

Parameters
centerFrequencycenter frequency (MHz)
channelWidthchannel width (MHz)
txPowerWtransmit power (W) to allocate
guardBandwidthwidth of the guard band (MHz)
minInnerBandDbrthe minimum relative power in the inner band (in dBr)
minOuterbandDbrthe minimum relative power in the outer band (in dBr)
lowestPointDbrmaximum relative power of the outermost subcarriers of the guard band (in dBr)
Returns
a pointer to a newly allocated SpectrumValue representing the HE OFDM Transmit Power Spectral Density in W/Hz for each Band

Definition at line 329 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, and NS_LOG_FUNCTION.

Referenced by ns3::HePhy::GetTxPowerSpectralDensity().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ CreateHtOfdmTxPowerSpectralDensity()

Ptr< SpectrumValue > ns3::WifiSpectrumValueHelper::CreateHtOfdmTxPowerSpectralDensity ( uint32_t  centerFrequency,
uint16_t  channelWidth,
double  txPowerW,
uint16_t  guardBandwidth,
double  minInnerBandDbr = -20,
double  minOuterbandDbr = -28,
double  lowestPointDbr = -40 
)
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.

Parameters
centerFrequencycenter frequency (MHz)
channelWidthchannel width (MHz)
txPowerWtransmit power (W) to allocate
guardBandwidthwidth of the guard band (MHz)
minInnerBandDbrthe minimum relative power in the inner band (in dBr)
minOuterbandDbrthe minimum relative power in the outer band (in dBr)
lowestPointDbrmaximum relative power of the outermost subcarriers of the guard band (in dBr)
Returns
a pointer to a newly allocated SpectrumValue representing the HT OFDM Transmit Power Spectral Density in W/Hz for each Band

Definition at line 215 of file wifi-spectrum-value-helper.cc.

References CreateSpectrumMaskForOfdm(), ns3::SpectrumModel::GetNumBands(), ns3::SpectrumValue::GetSpectrumModel(), GetSpectrumModel(), ns3::Integral(), NormalizeSpectrumMask(), NS_ASSERT_MSG, and NS_LOG_FUNCTION.

Referenced by ns3::HtPhy::GetTxPowerSpectralDensity().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ CreateNoisePowerSpectralDensity() [1/2]

Ptr< SpectrumValue > ns3::WifiSpectrumValueHelper::CreateNoisePowerSpectralDensity ( double  noiseFigure,
Ptr< SpectrumModel spectrumModel 
)
static

Create a thermal noise power spectral density.

Parameters
noiseFigurethe noise figure
spectrumModelthe spectrum model
Returns
a pointer to a newly allocated SpectrumValue representing the noise Power Spectral Density in W/Hz corresponding to thermal noise, for each Band

Definition at line 459 of file wifi-spectrum-value-helper.cc.

References DbmToW(), ns3::Integral(), NS_LOG_FUNCTION, and NS_LOG_INFO.

+ Here is the call graph for this function:

◆ CreateNoisePowerSpectralDensity() [2/2]

Ptr< SpectrumValue > ns3::WifiSpectrumValueHelper::CreateNoisePowerSpectralDensity ( uint32_t  centerFrequency,
uint16_t  channelWidth,
uint32_t  bandBandwidth,
double  noiseFigure,
uint16_t  guardBandwidth 
)
static

Create a power spectral density corresponding to the noise.

Parameters
centerFrequencycenter frequency (MHz)
channelWidthchannel width (MHz)
bandBandwidthwidth of each band (Hz)
noiseFigurethe noise figure in dB w.r.t. a reference temperature of 290K
guardBandwidthwidth of the guard band (MHz)
Returns
a pointer to a newly allocated SpectrumValue representing the noise Power Spectral Density in W/Hz for each Band

Definition at line 452 of file wifi-spectrum-value-helper.cc.

References GetSpectrumModel().

+ Here is the call graph for this function:

◆ CreateOfdmTxPowerSpectralDensity()

Ptr< SpectrumValue > ns3::WifiSpectrumValueHelper::CreateOfdmTxPowerSpectralDensity ( uint32_t  centerFrequency,
uint16_t  channelWidth,
double  txPowerW,
uint16_t  guardBandwidth,
double  minInnerBandDbr = -20,
double  minOuterbandDbr = -28,
double  lowestPointDbr = -40 
)
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.

Parameters
centerFrequencycenter frequency (MHz)
channelWidthchannel width (MHz)
txPowerWtransmit power (W) to allocate
guardBandwidthwidth of the guard band (MHz)
minInnerBandDbrthe minimum relative power in the inner band (in dBr)
minOuterbandDbrthe minimum relative power in the outer band (in dBr)
lowestPointDbrmaximum relative power of the outermost subcarriers of the guard band (in dBr)
Returns
a pointer to a newly allocated SpectrumValue representing the OFDM Transmit Power Spectral Density in W/Hz for each Band

Definition at line 160 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().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ CreateRfFilter()

Ptr< SpectrumValue > ns3::WifiSpectrumValueHelper::CreateRfFilter ( uint32_t  centerFrequency,
uint16_t  totalChannelWidth,
uint32_t  bandBandwidth,
uint16_t  guardBandwidth,
WifiSpectrumBand  band 
)
static

Create a spectral density corresponding to the RF filter.

Parameters
centerFrequencythe center frequency (MHz)
totalChannelWidththe total channel width (MHz)
bandBandwidththe width of each band (MHz)
guardBandwidththe width of the guard band (MHz)
bandthe pair of start and stop indexes that defines the band to be filtered
Returns
a pointer to a SpectrumValue representing the RF filter applied to an received power spectral density

Definition at line 477 of file wifi-spectrum-value-helper.cc.

References ns3::SpectrumValue::ConstBandsBegin(), GetSpectrumModel(), NS_LOG_FUNCTION, NS_LOG_LOGIC, and ns3::SpectrumValue::ValuesBegin().

+ Here is the call graph for this function:

◆ CreateSpectrumMaskForOfdm()

void ns3::WifiSpectrumValueHelper::CreateSpectrumMaskForOfdm ( Ptr< SpectrumValue c,
std::vector< WifiSpectrumBand allocatedSubBands,
WifiSpectrumBand  maskBand,
double  txPowerPerBandW,
uint32_t  nGuardBands,
uint32_t  innerSlopeWidth,
double  minInnerBandDbr,
double  minOuterbandDbr,
double  lowestPointDbr 
)
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.

Parameters
cspectrumValue to allocate according to transmit power spectral density mask (in W/Hz for each band)
allocatedSubBandsvector of start and stop subcarrier indexes of the allocated sub bands
maskBandstart and stop subcarrier indexes of transmit mask (in case signal doesn't cover whole SpectrumModel)
txPowerPerBandWpower allocated to each subcarrier in the allocated sub bands
nGuardBandssize (in number of subcarriers) of the guard band (left and right)
innerSlopeWidthsize (in number of subcarriers) of the inner band (i.e. slope going from 0 dBr to -20 dBr in the figure above)
minInnerBandDbrthe minimum relative power in the inner band (i.e. -20 dBr in the figure above)
minOuterbandDbrthe minimum relative power in the outer band (i.e. -28 dBr in the figure above)
lowestPointDbrmaximum relative power of the outermost subcarriers of the guard band (in dBr)

Definition at line 496 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().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ DbmToW()

double ns3::WifiSpectrumValueHelper::DbmToW ( double  dbm)
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.

Parameters
dbmthe power in dBm
Returns
the equivalent Watts for the given dBm

Definition at line 638 of file wifi-spectrum-value-helper.cc.

Referenced by CreateNoisePowerSpectralDensity(), and CreateSpectrumMaskForOfdm().

+ Here is the caller graph for this function:

◆ GetBandPowerW()

double ns3::WifiSpectrumValueHelper::GetBandPowerW ( Ptr< SpectrumValue psd,
const WifiSpectrumBand band 
)
static

Calculate the power of the specified band composed of uniformly-sized sub-bands.

Parameters
psdreceived Power Spectral Density in W/Hz
banda pair of start and stop indexes that defines the band
Returns
band power in W

Definition at line 644 of file wifi-spectrum-value-helper.cc.

References ns3::SpectrumValue::ConstBandsBegin(), and ns3::SpectrumValue::ConstValuesBegin().

Referenced by ns3::SpectrumWifiPhy::StartRx().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ GetSpectrumModel()

Ptr< SpectrumModel > ns3::WifiSpectrumValueHelper::GetSpectrumModel ( uint32_t  centerFrequency,
uint16_t  channelWidth,
uint32_t  bandBandwidth,
uint16_t  guardBandwidth 
)
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).

Parameters
centerFrequencycenter frequency (MHz)
channelWidthchannel width (MHz)
bandBandwidthwidth of each band (Hz)
guardBandwidthwidth of the guard band (MHz)
Returns
the static SpectrumModel instance corresponding to the given carrier frequency and channel width configuration.

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(), CreateHeMuOfdmTxPowerSpectralDensity(), CreateHeOfdmTxPowerSpectralDensity(), CreateHtOfdmTxPowerSpectralDensity(), CreateNoisePowerSpectralDensity(), CreateOfdmTxPowerSpectralDensity(), CreateRfFilter(), ns3::SpectrumWifiPhy::GetRxSpectrumModel(), and ns3::SpectrumWifiPhy::ResetSpectrumModel().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ NormalizeSpectrumMask()

void ns3::WifiSpectrumValueHelper::NormalizeSpectrumMask ( Ptr< SpectrumValue c,
double  txPowerW 
)
static

Normalize the transmit spectrum mask generated by CreateSpectrumMaskForOfdm so that the total transmitted power corresponds to the input value.

Parameters
cspectrumValue to normalize (in W/Hz for each band)
txPowerWtotal transmit power (W) to allocate

Definition at line 622 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 CreateHeOfdmTxPowerSpectralDensity(), CreateHtOfdmTxPowerSpectralDensity(), and CreateOfdmTxPowerSpectralDensity().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

The documentation for this class was generated from the following files: