22 #ifndef WIFI_SPECTRUM_VALUE_HELPER_H
23 #define WIFI_SPECTRUM_VALUE_HELPER_H
65 uint16_t channelWidth,
66 uint32_t carrierSpacing,
67 uint16_t guardBandwidth);
85 uint16_t guardBandwidth);
104 uint16_t channelWidth,
106 uint16_t guardBandwidth,
107 double minInnerBandDbr = -20,
108 double minOuterbandDbr = -28,
109 double lowestPointDbr = -40);
128 uint32_t centerFrequency,
129 uint16_t channelWidth,
131 uint16_t guardBandwidth,
132 double minInnerBandDbr = -20,
133 double minOuterbandDbr = -28,
134 double lowestPointDbr = -40,
135 const std::vector<bool>& puncturedSubchannels = std::vector<bool>{});
154 uint16_t channelWidth,
156 uint16_t guardBandwidth,
157 double minInnerBandDbr = -20,
158 double minOuterbandDbr = -28,
159 double lowestPointDbr = -40);
179 uint32_t centerFrequency,
180 uint16_t channelWidth,
182 uint16_t guardBandwidth,
183 double minInnerBandDbr = -20,
184 double minOuterbandDbr = -28,
185 double lowestPointDbr = -40,
186 const std::vector<bool>& puncturedSubchannels = std::vector<bool>{});
202 uint32_t centerFrequency,
203 uint16_t channelWidth,
205 uint16_t guardBandwidth,
220 uint16_t channelWidth,
221 uint32_t carrierSpacing,
223 uint16_t guardBandwidth);
234 Ptr<SpectrumModel> spectrumModel);
284 Ptr<SpectrumValue> c,
285 const std::vector<WifiSpectrumBandIndices>& allocatedSubBands,
287 double txPowerPerBandW,
288 uint32_t nGuardBands,
289 uint32_t innerSlopeWidth,
290 double minInnerBandDbr,
291 double minOuterbandDbr,
292 double lowestPointDbr,
293 const std::vector<WifiSpectrumBandIndices>& puncturedSubBands =
294 std::vector<WifiSpectrumBandIndices>{},
295 uint32_t puncturedSlopeWidth = 0);
315 static double DbmToW(
double dbm);
346 bool operator<(
const FrequencyRange& lhs,
const FrequencyRange& rhs);
357 bool operator==(
const FrequencyRange& lhs,
const FrequencyRange& rhs);
368 bool operator!=(
const FrequencyRange& lhs,
const FrequencyRange& rhs);
378 std::ostream&
operator<<(std::ostream& os,
const FrequencyRange& freqRange);
This class defines all functions to create a spectrum model for Wi-Fi based on a a spectral model ali...
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 > 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 subcha...
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 fo...
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....
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).
virtual ~WifiSpectrumValueHelper()=default
Destructor.
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 Ptr< SpectrumValue > CreateDsssTxPowerSpectralDensity(uint32_t centerFrequency, double txPowerW, uint16_t guardBandwidth)
Create a transmit power spectral density corresponding to DSSS.
static double GetBandPowerW(Ptr< SpectrumValue > psd, const WifiSpectrumBandIndices &band)
Calculate the power of the specified band composed of uniformly-sized sub-bands.
static double DbmToW(double dbm)
Convert from dBm to Watts.
static void NormalizeSpectrumMask(Ptr< SpectrumValue > c, double txPowerW)
Normalize the transmit spectrum mask generated by CreateSpectrumMaskForOfdm so that the total transmi...
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 R...
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....
Every class exported by the ns3 library is enclosed in the ns3 namespace.
constexpr FrequencyRange WIFI_SPECTRUM_6_GHZ
Identifier for the frequency range covering the wifi spectrum in the 6 GHz band.
bool operator!=(Callback< R, Args... > a, Callback< R, Args... > b)
Inequality test.
bool operator==(const EventId &a, const EventId &b)
constexpr FrequencyRange WHOLE_WIFI_SPECTRUM
Identifier for the frequency range covering the whole wifi spectrum.
std::pair< uint32_t, uint32_t > WifiSpectrumBandIndices
typedef for a pair of start and stop sub-band indices
bool operator<(const EventId &a, const EventId &b)
constexpr FrequencyRange WIFI_SPECTRUM_5_GHZ
Identifier for the frequency range covering the wifi spectrum in the 5 GHz band.
std::ostream & operator<<(std::ostream &os, const Angles &a)
constexpr FrequencyRange WIFI_SPECTRUM_2_4_GHZ
Identifier for the frequency range covering the wifi spectrum in the 2.4 GHz band.
Struct defining a frequency range between minFrequency (MHz) and maxFrequency (MHz).
uint16_t maxFrequency
the maximum frequency in MHz
uint16_t minFrequency
the minimum frequency in MHz