A Discrete-Event Network Simulator
API
Loading...
Searching...
No Matches
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 ()=default
 Destructor.
 

Static Public Member Functions

static Ptr< SpectrumValueCreateDsssTxPowerSpectralDensity (MHz_u centerFrequency, Watt_u txPower, MHz_u guardBandwidth)
 Create a transmit power spectral density corresponding to DSSS.
 
static Ptr< SpectrumValueCreateDuplicated20MhzTxPowerSpectralDensity (const std::vector< MHz_u > &centerFrequencies, 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< SpectrumValueCreateHeMuOfdmTxPowerSpectralDensity (const std::vector< MHz_u > &centerFrequencies, 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< SpectrumValueCreateHeOfdmTxPowerSpectralDensity (const std::vector< MHz_u > &centerFrequencies, 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< SpectrumValueCreateHeOfdmTxPowerSpectralDensity (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< SpectrumValueCreateHtOfdmTxPowerSpectralDensity (const std::vector< MHz_u > &centerFrequencies, 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< SpectrumValueCreateOfdmTxPowerSpectralDensity (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< SpectrumModelGetSpectrumModel (const std::vector< MHz_u > &centerFrequencies, 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.
 

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

Constructor & Destructor Documentation

◆ ~WifiSpectrumValueHelper()

virtual ns3::WifiSpectrumValueHelper::~WifiSpectrumValueHelper ( )
virtualdefault

Destructor.

Member Function Documentation

◆ CreateDsssTxPowerSpectralDensity()

Ptr< SpectrumValue > ns3::WifiSpectrumValueHelper::CreateDsssTxPowerSpectralDensity ( MHz_u centerFrequency,
Watt_u txPower,
MHz_u 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
txPowertransmit power to allocate
guardBandwidthwidth of the guard band
Returns
a pointer to a newly allocated SpectrumValue representing the DSSS Transmit Power Spectral Density in W/Hz

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

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

◆ CreateDuplicated20MhzTxPowerSpectralDensity()

Ptr< SpectrumValue > ns3::WifiSpectrumValueHelper::CreateDuplicated20MhzTxPowerSpectralDensity ( const std::vector< MHz_u > & centerFrequencies,
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 = {} )
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.

Parameters
centerFrequenciescenter frequency per segment
channelWidthtotal allocated channel width over all segments
txPowertransmit power to allocate
guardBandwidthwidth of the guard band
minInnerBandthe minimum relative power in the inner band
minOuterbandthe minimum relative power in the outer band
lowestPointmaximum relative power of the outermost subcarriers of the guard band
puncturedSubchannelsbitmap indicating whether a 20 MHz subchannel is punctured or not
Returns
a pointer to a newly allocated SpectrumValue representing the duplicated 20 MHz OFDM Transmit Power Spectral Density in W/Hz for each Band

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

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

◆ CreateHeMuOfdmTxPowerSpectralDensity()

Ptr< SpectrumValue > ns3::WifiSpectrumValueHelper::CreateHeMuOfdmTxPowerSpectralDensity ( const std::vector< MHz_u > & centerFrequencies,
MHz_u channelWidth,
Watt_u txPower,
MHz_u guardBandwidth,
const std::vector< WifiSpectrumBandIndices > & 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
centerFrequenciescenter frequency per segment
channelWidthtotal allocated channel width over all segments
txPowertransmit power to allocate
guardBandwidthwidth of the guard band
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 643 of file wifi-spectrum-value-helper.cc.

References ns3::Create(), GetSpectrumModel(), and NS_LOG_FUNCTION.

Referenced by ns3::HePhy::GetTxPowerSpectralDensity(), and TestMultipleHeTbPreambles::RxHeTbPpdu().

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

◆ CreateHeOfdmTxPowerSpectralDensity() [1/2]

Ptr< SpectrumValue > ns3::WifiSpectrumValueHelper::CreateHeOfdmTxPowerSpectralDensity ( const std::vector< MHz_u > & centerFrequencies,
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 = {} )
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.

Parameters
centerFrequenciescenter frequency per segment
channelWidthtotal allocated channel width over all segments
txPowertransmit power to allocate
guardBandwidthwidth of the guard band
minInnerBandthe minimum relative power in the inner band
minOuterbandthe minimum relative power in the outer band
lowestPointmaximum relative power of the outermost subcarriers of the guard band
puncturedSubchannelsbitmap indicating whether a 20 MHz subchannel is punctured or not
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 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.

+ Here is the call graph for this function:

◆ CreateHeOfdmTxPowerSpectralDensity() [2/2]

Ptr< SpectrumValue > ns3::WifiSpectrumValueHelper::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 = {} )
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.

Parameters
centerFrequencycenter frequency
channelWidthchannel width
txPowertransmit power to allocate
guardBandwidthwidth of the guard band
minInnerBandthe minimum relative power in the inner band
minOuterbandthe minimum relative power in the outer band
lowestPointmaximum relative power of the outermost subcarriers of the guard band
puncturedSubchannelsbitmap indicating whether a 20 MHz subchannel is punctured or not
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 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().

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

◆ CreateHtOfdmTxPowerSpectralDensity()

Ptr< SpectrumValue > ns3::WifiSpectrumValueHelper::CreateHtOfdmTxPowerSpectralDensity ( const std::vector< MHz_u > & centerFrequencies,
MHz_u channelWidth,
Watt_u txPower,
MHz_u guardBandwidth,
dBr_u minInnerBand = -20,
dBr_u minOuterband = -28,
dBr_u lowestPoint = -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
centerFrequenciescenter frequency per segment
channelWidthtotal allocated channel width over all segments
txPowertransmit power to allocate
guardBandwidthwidth of the guard band
minInnerBandthe minimum relative power in the inner band
minOuterbandthe minimum relative power in the outer band
lowestPointmaximum relative power of the outermost subcarriers of the guard band
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 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().

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

◆ CreateOfdmTxPowerSpectralDensity()

Ptr< SpectrumValue > ns3::WifiSpectrumValueHelper::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 )
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
channelWidthchannel width
txPowertransmit power to allocate
guardBandwidthwidth of the guard band
minInnerBandthe minimum relative power in the inner band
minOuterbandthe minimum relative power in the outer band
lowestPointmaximum relative power of the outermost subcarriers of the guard band
Returns
a pointer to a newly allocated SpectrumValue representing the OFDM Transmit Power Spectral Density in W/Hz for each 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().

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

◆ CreateSpectrumMaskForOfdm()

void ns3::WifiSpectrumValueHelper::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 )
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)
allocatedSubBandsPerSegmentvector of start and stop subcarrier indexes of the allocated sub bands, for each segment
maskBandstart and stop subcarrier indexes of transmit mask (in case signal doesn't cover whole SpectrumModel)
txPowerPerBandpower 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)
minInnerBandthe minimum relative power in the inner band (i.e., -20 dBr in the figure above)
minOuterbandthe minimum relative power in the outer band (i.e., -28 dBr in the figure above)
lowestPointmaximum relative power of the outermost subcarriers of the guard band
puncturedSubBandsvector of start and stop subcarrier indexes of the punctured sub bands, for each segment
puncturedSlopeWidthsize (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().

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

◆ GetBandPowerW()

Watt_u ns3::WifiSpectrumValueHelper::GetBandPowerW ( Ptr< SpectrumValue > psd,
const std::vector< WifiSpectrumBandIndices > & segments )
static

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

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

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

References NS_ASSERT_MSG.

◆ GetSpectrumModel()

Ptr< SpectrumModel > ns3::WifiSpectrumValueHelper::GetSpectrumModel ( const std::vector< MHz_u > & centerFrequencies,
MHz_u channelWidth,
Hz_u carrierSpacing,
MHz_u 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
centerFrequenciescenter frequency per segment
channelWidthtotal allocated channel width over all segments
carrierSpacingcarrier spacing
guardBandwidthtotal width of the guard band, which will be split over the segments
Returns
the static SpectrumModel instance corresponding to the given carrier frequency and channel width configuration.

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

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

◆ NormalizeSpectrumMask()

void ns3::WifiSpectrumValueHelper::NormalizeSpectrumMask ( Ptr< SpectrumValue > c,
Watt_u txPower )
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)
txPowertotal 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().

+ 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: