A Discrete-Event Network Simulator
API
wifi-spectrum-value-helper.h
Go to the documentation of this file.
1 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
2 /*
3  * Copyright (c) 2009 CTTC
4  * Copyright (c) 2017 Orange Labs
5  *
6  * This program is free software; you can redistribute it and/or modify
7  * it under the terms of the GNU General Public License version 2 as
8  * published by the Free Software Foundation;
9  *
10  * This program is distributed in the hope that it will be useful,
11  * but WITHOUT ANY WARRANTY; without even the implied warranty of
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13  * GNU General Public License for more details.
14  *
15  * You should have received a copy of the GNU General Public License
16  * along with this program; if not, write to the Free Software
17  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
18  *
19  * Authors: Nicola Baldo <nbaldo@cttc.es>
20  * Rediet <getachew.redieteab@orange.com>
21  */
22 
23 #ifndef WIFI_SPECTRUM_VALUE_HELPER_H
24 #define WIFI_SPECTRUM_VALUE_HELPER_H
25 
26 
27 #include <ns3/spectrum-value.h>
28 
29 namespace ns3 {
30 
34 typedef std::pair<uint32_t, uint32_t> WifiSpectrumBand;
35 
44 {
45 public:
49  virtual ~WifiSpectrumValueHelper ();
50 
65  static Ptr<SpectrumModel> GetSpectrumModel (uint32_t centerFrequency, uint16_t channelWidth, uint32_t bandBandwidth, uint16_t guardBandwidth);
66 
80  static Ptr<SpectrumValue> CreateDsssTxPowerSpectralDensity (uint32_t centerFrequency, double txPowerW, uint16_t guardBandwidth);
81 
96  static Ptr<SpectrumValue> CreateOfdmTxPowerSpectralDensity (uint32_t centerFrequency, uint16_t channelWidth, double txPowerW, uint16_t guardBandwidth,
97  double minInnerBandDbr = -20, double minOuterbandDbr = -28, double lowestPointDbr = -40);
98 
113  static Ptr<SpectrumValue> CreateHtOfdmTxPowerSpectralDensity (uint32_t centerFrequency, uint16_t channelWidth, double txPowerW, uint16_t guardBandwidth,
114  double minInnerBandDbr = -20, double minOuterbandDbr = -28, double lowestPointDbr = -40);
115 
130  static Ptr<SpectrumValue> CreateHeOfdmTxPowerSpectralDensity (uint32_t centerFrequency, uint16_t channelWidth, double txPowerW, uint16_t guardBandwidth,
131  double minInnerBandDbr = -20, double minOuterbandDbr = -28, double lowestPointDbr = -40);
132 
145  static Ptr<SpectrumValue> CreateHeMuOfdmTxPowerSpectralDensity (uint32_t centerFrequency, uint16_t channelWidth, double txPowerW, uint16_t guardBandwidth, WifiSpectrumBand ru);
146 
157  static Ptr<SpectrumValue> CreateNoisePowerSpectralDensity (uint32_t centerFrequency, uint16_t channelWidth, uint32_t bandBandwidth, double noiseFigure, uint16_t guardBandwidth);
158 
166  static Ptr<SpectrumValue> CreateNoisePowerSpectralDensity (double noiseFigure, Ptr<SpectrumModel> spectrumModel);
167 
180  static Ptr<SpectrumValue> CreateRfFilter (uint32_t centerFrequency, uint16_t totalChannelWidth, uint32_t bandBandwidth, uint16_t guardBandwidth, WifiSpectrumBand band);
181 
219  static void CreateSpectrumMaskForOfdm (Ptr<SpectrumValue> c, std::vector <WifiSpectrumBand> allocatedSubBands, WifiSpectrumBand maskBand,
220  double txPowerPerBandW, uint32_t nGuardBands, uint32_t innerSlopeWidth,
221  double minInnerBandDbr, double minOuterbandDbr, double lowestPointDbr);
222 
230  static void NormalizeSpectrumMask (Ptr<SpectrumValue> c, double txPowerW);
231 
241  static double DbmToW (double dbm);
242 
251  static double GetBandPowerW (Ptr<SpectrumValue> psd, const WifiSpectrumBand &band);
252 };
253 
262 {
263 public:
275  virtual Ptr<SpectrumValue> CreateConstant (double psd);
295  virtual Ptr<SpectrumValue> CreateTxPowerSpectralDensity (double txPower, uint8_t channel);
305  virtual Ptr<SpectrumValue> CreateRfFilter (uint8_t channel);
306 };
307 
308 } // namespace ns3
309 
310 #endif /* WIFI_SPECTRUM_VALUE_HELPER_H */
ns3::WifiSpectrumBand
std::pair< uint32_t, uint32_t > WifiSpectrumBand
typedef for a pair of start and stop sub-band indexes
Definition: wifi-spectrum-value-helper.h:34
ns3::WifiSpectrumValue5MhzFactory::~WifiSpectrumValue5MhzFactory
virtual ~WifiSpectrumValue5MhzFactory()
Destructor.
Definition: wifi-spectrum-value-helper.cc:664
ns3
Every class exported by the ns3 library is enclosed in the ns3 namespace.
ns3::WifiSpectrumValueHelper::NormalizeSpectrumMask
static void NormalizeSpectrumMask(Ptr< SpectrumValue > c, double txPowerW)
Normalize the transmit spectrum mask generated by CreateSpectrumMaskForOfdm so that the total transmi...
Definition: wifi-spectrum-value-helper.cc:622
ns3::WifiSpectrumValueHelper::CreateRfFilter
static Ptr< SpectrumValue > CreateRfFilter(uint32_t centerFrequency, uint16_t totalChannelWidth, uint32_t bandBandwidth, uint16_t guardBandwidth, WifiSpectrumBand band)
Create a spectral density corresponding to the RF filter.
Definition: wifi-spectrum-value-helper.cc:477
ns3::WifiSpectrumValueHelper::GetSpectrumModel
static Ptr< SpectrumModel > GetSpectrumModel(uint32_t centerFrequency, uint16_t channelWidth, uint32_t bandBandwidth, uint16_t guardBandwidth)
Return a SpectrumModel instance corresponding to the center frequency and channel width.
Definition: wifi-spectrum-value-helper.cc:86
ns3::WifiSpectrumValue5MhzFactory::CreateTxPowerSpectralDensity
virtual Ptr< SpectrumValue > CreateTxPowerSpectralDensity(double txPower, uint8_t channel)
Creates a SpectrumValue instance that represents the TX Power Spectral Density of a wifi device corre...
Definition: wifi-spectrum-value-helper.cc:701
ns3::WifiSpectrumValue5MhzFactory::CreateConstant
virtual Ptr< SpectrumValue > CreateConstant(double psd)
Creates a SpectrumValue instance with a constant value for all frequencies.
Definition: wifi-spectrum-value-helper.cc:692
third.channel
channel
Definition: third.py:92
ns3::WifiSpectrumValueHelper
This class defines all functions to create a spectrum model for Wi-Fi based on a a spectral model ali...
Definition: wifi-spectrum-value-helper.h:44
ns3::WifiSpectrumValue5MhzFactory
Implements Wifi SpectrumValue for the 2.4 GHz ISM band only, with a 5 MHz spectrum resolution.
Definition: wifi-spectrum-value-helper.h:262
ns3::WifiSpectrumValueHelper::CreateHeMuOfdmTxPowerSpectralDensity
static Ptr< SpectrumValue > CreateHeMuOfdmTxPowerSpectralDensity(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 R...
Definition: wifi-spectrum-value-helper.cc:425
ns3::WifiSpectrumValueHelper::CreateOfdmTxPowerSpectralDensity
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).
Definition: wifi-spectrum-value-helper.cc:160
ns3::WifiSpectrumValue5MhzFactory::CreateRfFilter
virtual Ptr< SpectrumValue > CreateRfFilter(uint8_t channel)
Creates a SpectrumValue instance which represents the frequency response of the RF filter which is us...
Definition: wifi-spectrum-value-helper.cc:734
ns3::WifiSpectrumValueHelper::CreateSpectrumMaskForOfdm
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 fo...
Definition: wifi-spectrum-value-helper.cc:496
ns3::Ptr< SpectrumModel >
ns3::WifiSpectrumValueHelper::DbmToW
static double DbmToW(double dbm)
Convert from dBm to Watts.
Definition: wifi-spectrum-value-helper.cc:638
ns3::WifiSpectrumValueHelper::CreateNoisePowerSpectralDensity
static Ptr< SpectrumValue > CreateNoisePowerSpectralDensity(uint32_t centerFrequency, uint16_t channelWidth, uint32_t bandBandwidth, double noiseFigure, uint16_t guardBandwidth)
Create a power spectral density corresponding to the noise.
Definition: wifi-spectrum-value-helper.cc:452
uint32_t
ns3::WifiSpectrumValueHelper::CreateHeOfdmTxPowerSpectralDensity
static Ptr< SpectrumValue > CreateHeOfdmTxPowerSpectralDensity(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....
Definition: wifi-spectrum-value-helper.cc:329
ns3::WifiSpectrumValueHelper::CreateHtOfdmTxPowerSpectralDensity
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....
Definition: wifi-spectrum-value-helper.cc:215
ns3::WifiSpectrumValueHelper::GetBandPowerW
static double GetBandPowerW(Ptr< SpectrumValue > psd, const WifiSpectrumBand &band)
Calculate the power of the specified band composed of uniformly-sized sub-bands.
Definition: wifi-spectrum-value-helper.cc:644
ns3::WifiSpectrumValueHelper::~WifiSpectrumValueHelper
virtual ~WifiSpectrumValueHelper()
Destructor.
Definition: wifi-spectrum-value-helper.cc:660
ns3::WifiSpectrumValueHelper::CreateDsssTxPowerSpectralDensity
static Ptr< SpectrumValue > CreateDsssTxPowerSpectralDensity(uint32_t centerFrequency, double txPowerW, uint16_t guardBandwidth)
Create a transmit power spectral density corresponding to DSSS.
Definition: wifi-spectrum-value-helper.cc:136