23#include "ns3/boolean.h"
24#include "ns3/double.h"
25#include "ns3/he-phy.h"
28#include "ns3/simulator.h"
29#include "ns3/spectrum-channel.h"
34#undef NS_LOG_APPEND_CONTEXT
35#define NS_LOG_APPEND_CONTEXT WIFI_PHY_NS_LOG_APPEND_CONTEXT(Ptr(this, false))
48 TypeId(
"ns3::SpectrumWifiPhy")
52 .AddAttribute(
"DisableWifiReception",
53 "Prevent Wi-Fi frame sync from ever happening",
58 "TrackSignalsFromInactiveInterfaces",
59 "Enable or disable tracking signals coming from inactive spectrum PHY interfaces",
64 "TxMaskInnerBandMinimumRejection",
65 "Minimum rejection (dBr) for the inner band of the transmit spectrum mask",
70 "TxMaskOuterBandMinimumRejection",
71 "Minimum rejection (dBr) for the outer band of the transmit spectrum mask",
76 "TxMaskOuterBandMaximumRejection",
77 "Maximum rejection (dBr) for the outer band of the transmit spectrum mask",
83 "Trace start of all signal arrivals, including weak and foreign signals",
85 "ns3::SpectrumWifiPhy::SignalArrivalCallback");
90 : m_spectrumPhyInterfaces{},
91 m_currentSpectrumPhyInterface{nullptr},
92 m_frequenciesBeforeSwitch{},
93 m_widthsBeforeSwitch{}
126 const auto channelWidth = spectrumPhyInterface->GetChannelWidth();
127 if (channelWidth <
MHz_u{20})
133 for (
MHz_u bw = channelWidth; bw >=
MHz_u{20}; bw = bw / 2)
135 for (uint16_t i = 0; i < (channelWidth / bw); ++i)
146 MHz_u guardBandwidth)
149 const auto channelWidth = spectrumPhyInterface->GetChannelWidth();
150 for (
MHz_u bw = channelWidth; bw >=
MHz_u{20}; bw = bw / 2)
152 for (
uint32_t i = 0; i < (channelWidth / bw); ++i)
154 for (
uint32_t type = 0; type < 7; type++)
158 for (std::size_t phyIndex = 1; phyIndex <= nRus; phyIndex++)
162 std::make_pair(group.front().first, group.back().second);
163 const auto bandIndices =
166 spectrumPhyInterface->GetCenterFrequencies(),
167 spectrumPhyInterface->GetChannelWidth(),
173 for (
const auto& indicesPerSegment : bandIndices)
175 band.
indices.emplace_back(indicesPerSegment);
176 band.frequencies.emplace_back(
181 (bw ==
MHz_u{160} && phyIndex > nRus / 2 ? phyIndex - nRus / 2 : phyIndex);
183 bool primary80IsLower80 = (p20Index < bw /
MHz_u{40});
185 (primary80IsLower80 && phyIndex <= nRus / 2) ||
186 (!primary80IsLower80 && phyIndex > nRus / 2));
189 heRuBands.insert({band, ru});
205 const auto channelWidth = spectrumPhyInterface->GetChannelWidth();
207 for (
const auto& bandRuPair : heRuBands)
209 allBands.push_back(bandRuPair.first);
211 spectrumPhyInterface->SetHeRuBands(std::move(heRuBands));
214 spectrumPhyInterface->SetBands(std::move(bands));
218 m_interference->UpdateBands(allBands, spectrumPhyInterface->GetFrequencyRange());
222 for (
const auto& band : allBands)
241 const auto foundOverlappingChannel =
244 [freqRange, channel](
const auto& item) {
245 const auto spectrumRange = item.first;
246 const auto noOverlap =
247 ((freqRange.minFrequency >= spectrumRange.maxFrequency) ||
248 (freqRange.maxFrequency <= spectrumRange.minFrequency));
252 "Added a wifi spectrum channel that overlaps with another existing wifi "
256 wifiSpectrumPhyInterface->SetSpectrumWifiPhy(
this);
257 wifiSpectrumPhyInterface->SetChannel(channel);
260 wifiSpectrumPhyInterface->SetDevice(
GetDevice());
267 const std::vector<MHz_u>& centerFrequencies,
270 std::stringstream ss;
271 for (
const auto& centerFrequency : centerFrequencies)
273 ss << centerFrequency <<
" ";
275 NS_LOG_FUNCTION(
this << spectrumPhyInterface << ss.str() << channelWidth);
286 spectrumPhyInterface->SetRxSpectrumModel(centerFrequencies,
291 spectrumPhyInterface->GetChannel()->AddRx(spectrumPhyInterface);
302 : std::vector<MHz_u>{};
326 NS_ASSERT(numSegments == frequenciesAfter.size() && numSegments == widthsAfter.size());
327 for (std::size_t i = 0; i < numSegments; ++i)
329 auto interfaceCoveringBand =
332 "No spectrum channel covers frequency range ["
333 << frequenciesAfter.at(i) - (widthsAfter.at(i) / 2) <<
" MHz - "
334 << frequenciesAfter.at(i) + (widthsAfter.at(i) / 2) <<
" MHz]");
335 if (!newSpectrumPhyInterface)
337 newSpectrumPhyInterface = interfaceCoveringBand;
342 "All segments are not covered by the same spectrum channel");
347 if (interfaceChanged)
349 std::stringstream ss;
350 for (std::size_t i = 0; i < frequenciesAfter.size(); ++i)
352 ss <<
"(" << frequenciesAfter.at(i) <<
", " << widthsAfter.at(i) <<
") ";
354 NS_LOG_DEBUG(
"Switch to existing RF interface with frequency/width "
355 << (numSegments > 1 ?
"pair" :
"pairs") <<
" of " << ss.str());
408 std::stringstream ss;
409 for (
const auto& centerFrequency : frequencies)
411 ss << centerFrequency <<
" ";
417 NS_LOG_DEBUG(
"Tracking of signals on inactive interfaces is not enabled");
422 const auto numSegments = frequencies.size();
423 const auto segmentWidth = width / numSegments;
424 for (std::size_t i = 0; i < numSegments; ++i)
426 auto interfaceCoveringBand =
429 "No spectrum channel covers frequency range ["
430 << frequencies.at(i) - (segmentWidth / 2) <<
" MHz - "
431 << frequencies.at(i) + (segmentWidth / 2) <<
" MHz]");
432 if (!spectrumPhyInterface)
434 spectrumPhyInterface = interfaceCoveringBand;
439 "All segments are not covered by the same spectrum channel");
444 "This method should not be called for the current interface");
446 if ((frequencies == spectrumPhyInterface->GetCenterFrequencies()) &&
447 (width == spectrumPhyInterface->GetChannelWidth()))
449 NS_LOG_DEBUG(
"Same RF channel as before on that interface, do nothing");
467 Time rxDuration = rxParams->duration;
472 interface->GetRxSpectrumModel()->GetNumBands(),
473 "Incorrect spectrum conversion or multi model spectrum channel is not used!");
475 NS_LOG_DEBUG(
"Received signal with PSD " << *receivedSignalPsd <<
" and duration "
480 senderNodeId = rxParams->txPhy->GetDevice()->GetNode()->GetId();
482 NS_LOG_DEBUG(
"Received signal from " << senderNodeId <<
" with unfiltered power "
497 std::size_t index = 0;
499 for (
const auto& band : bands)
502 std::accumulate(band.frequencies.cbegin(),
503 band.frequencies.cend(),
505 [](
MHz_u sum,
const auto& startStopFreqs) {
506 return sum + HzToMHz(startStopFreqs.second - startStopFreqs.first);
509 index = ((bw != prevBw) ? 0 : (index + 1));
510 auto rxPowerPerBand =
512 NS_LOG_DEBUG(
"Signal power received (watts) before antenna gain for "
513 << bw <<
" MHz channel band " << index <<
": " << band);
514 rxPowerPerBand *= rxGainRatio;
515 rxPowers.insert({band, rxPowerPerBand});
516 NS_LOG_DEBUG(
"Signal power received after antenna gain for "
517 << bw <<
" MHz channel band " << index <<
": " << rxPowerPerBand <<
" W"
518 << (rxPowerPerBand >
Watt_u{0.0}
519 ?
" (" + std::to_string(
WToDbm(rxPowerPerBand)) +
" dBm)"
523 totalRxPower += rxPowerPerBand;
530 const auto& heRuBands =
533 for (const auto& [band, ru] : heRuBands)
535 auto rxPowerPerBand =
536 WifiSpectrumValueHelper::GetBandPowerW(receivedSignalPsd, band.indices);
537 rxPowerPerBand *= rxGainRatio;
538 rxPowers.insert({band, rxPowerPerBand});
543 NS_LOG_DEBUG(
"Total signal power received after antenna gain: "
544 << totalRxPower <<
" W"
545 << (totalRxPower >
Watt_u{0.0}
546 ?
" (" + std::to_string(
WToDbm(totalRxPower)) +
" dBm)"
553 if (totalRxPower >
Watt_u{0.0})
561 NS_LOG_INFO(
"Received Wi-Fi signal from a non-active PHY interface "
562 << interface->GetFrequencyRange());
563 m_interference->AddForeignSignal(rxDuration, rxPowers, interface->GetFrequencyRange());
572 interface ? interface->GetFrequencyRange()
580 NS_LOG_INFO(
"Received Wi-Fi signal but blocked from syncing");
582 m_interference->AddForeignSignal(rxDuration, rxPowers, interface->GetFrequencyRange());
593 NS_LOG_INFO(
"Received signal too weak to process: "
594 << totalRxPower <<
" W"
595 << (totalRxPower >
Watt_u{0.0}
596 ?
" (" + std::to_string(
WToDbm(totalRxPower)) +
" dBm)"
603 if (wifiRxParams->txPhy)
607 NS_LOG_INFO(
"Cannot start reception of the PPDU, consider it as interference");
644 spectrumPhyInterface.second->SetDevice(device);
667 MHz_u guardBandwidth{0};
668 if (currentChannelWidth ==
MHz_u{22})
671 guardBandwidth =
MHz_u{10};
681 guardBandwidth = currentChannelWidth;
683 return guardBandwidth;
689 Hz_u subcarrierSpacing)
691 const auto numSegments = centerFrequencies.size();
692 NS_ABORT_MSG_IF(numSegments > 2,
"Only 2 non-contiguous frequency segments are supported");
697 const auto lowFrequency = *centerFrequencies.cbegin();
698 const auto highFrequency = *centerFrequencies.crbegin();
699 NS_ASSERT(lowFrequency != highFrequency);
701 const auto segmentsWidth = totalWidth / numSegments;
702 const auto widthBetweenSegments = highFrequency - lowFrequency - segmentsWidth;
703 return MHzToHz(widthBetweenSegments) / subcarrierSpacing;
711 const auto channelWidth = spectrumPhyInterface->GetChannelWidth();
713 "Bandwidth (" << bandWidth <<
") cannot exceed total operating channel width ("
714 << channelWidth <<
")");
717 std::size_t numSegments = 1;
718 if (
const auto segmentWidth =
719 (channelWidth / spectrumPhyInterface->GetCenterFrequencies().size());
720 bandWidth > segmentWidth)
723 numSegments = spectrumPhyInterface->GetCenterFrequencies().size();
724 bandWidth /= spectrumPhyInterface->GetCenterFrequencies().size();
726 const auto numBandsInBand =
static_cast<size_t>(
MHzToHz(bandWidth) / subcarrierSpacing);
727 auto numBandsInChannel =
static_cast<size_t>(
MHzToHz(channelWidth) / subcarrierSpacing);
728 const auto numBands = channelWidth / bandWidth;
729 if (numBandsInBand % 2 == 0)
731 numBandsInChannel += 1;
733 auto rxSpectrumModel = spectrumPhyInterface->GetRxSpectrumModel();
734 size_t totalNumBands = rxSpectrumModel->GetNumBands();
735 NS_ASSERT_MSG((numBandsInChannel % 2 == 1) && (totalNumBands % 2 == 1),
736 "Should have odd number of bands");
737 for (std::size_t segmentIndex = 0; segmentIndex < numSegments; ++segmentIndex)
739 NS_ASSERT_MSG(bandIndex < numBands,
"Band index is out of bound");
740 NS_ASSERT(totalNumBands >= numBandsInChannel);
741 const auto numBandsBetweenSegments =
745 auto startIndex = ((totalNumBands - numBandsInChannel - numBandsBetweenSegments) / 2) +
746 (bandIndex * numBandsInBand);
747 if (bandIndex >= (numBands / 2))
749 startIndex += numBandsBetweenSegments;
751 auto stopIndex = startIndex + numBandsInBand - 1;
754 auto freqRange = spectrumPhyInterface->GetFrequencyRange();
758 if (startIndex >= totalNumBands / 2)
763 bandInfo.
indices.emplace_back(startIndex, stopIndex);
790 auto rxSpectrumModel = spectrumPhyInterface->GetRxSpectrumModel();
791 auto startGuardBand = rxSpectrumModel->Begin();
792 auto startChannel = std::next(startGuardBand, indices.first);
793 auto endChannel = std::next(startGuardBand, indices.second + 1);
794 return {
Hz_u{startChannel->fc},
Hz_u{endChannel->fc}};
797std::tuple<dBr_u, dBr_u, dBr_u>
812const std::map<FrequencyRange, Ptr<WifiSpectrumPhyInterface>>&
821 const auto lowFreq = frequency - (width / 2);
822 const auto highFreq = frequency + (width / 2);
825 [lowFreq, highFreq](
const auto& item) {
826 return ((lowFreq >= item.first.minFrequency) &&
827 (highFreq <= item.first.maxFrequency));
AttributeValue implementation for Boolean.
void Nullify()
Discard the implementation, set it to null.
bool IsNull() const
Check for null implementation.
This class can be used to hold variables of floating point type such as 'double' or 'float'.
static std::vector< WifiSpectrumBandIndices > ConvertHeRuSubcarriers(MHz_u bandWidth, MHz_u guardBandwidth, const std::vector< MHz_u > ¢erFrequencies, MHz_u totalWidth, Hz_u subcarrierSpacing, HeRu::SubcarrierRange subcarrierRange, uint8_t bandIndex=0)
std::size_t GetPhyIndex(MHz_u bw, uint8_t p20Index) const
Get the RU PHY index.
static SubcarrierGroup GetSubcarrierGroup(MHz_u bw, RuType ruType, std::size_t phyIndex)
Get the subcarrier group of the RU having the given PHY index among all the RUs of the given type (nu...
std::vector< SubcarrierRange > SubcarrierGroup
a vector of subcarrier ranges defining a subcarrier group
std::pair< int16_t, int16_t > SubcarrierRange
(lowest index, highest index) pair defining a subcarrier range
static std::size_t GetNRus(MHz_u bw, RuType ruType)
Get the number of distinct RUs of the given type (number of tones) available in a HE PPDU of the give...
RuType
The different HE Resource Unit (RU) types.
bool IsInitialized() const
Check if the object has been initialized.
Smart pointer class similar to boost::intrusive_ptr.
static EventId ScheduleNow(FUNC f, Ts &&... args)
Schedule an event to expire Now.
~SpectrumWifiPhy() override
std::vector< MHz_u > m_frequenciesBeforeSwitch
center frequency before channel switch
WifiSpectrumBandInfo GetBand(MHz_u bandWidth, uint8_t bandIndex=0) override
Get the info of a given band.
void SetDevice(const Ptr< WifiNetDevice > device) override
Sets the device this PHY is associated with.
void Transmit(Ptr< WifiSpectrumSignalParameters > txParams)
This function is sending the signal to the Spectrum channel after finishing the configuration of the ...
dBr_u m_txMaskInnerBandMinimumRejection
The minimum rejection for the inner band of the transmit spectrum mask.
std::vector< MHz_u > m_widthsBeforeSwitch
channel width before channel switch
WifiSpectrumBands ComputeBands(Ptr< WifiSpectrumPhyInterface > spectrumPhyInterface)
This function computes the bands that belong to a given spectrum PHY interface.
void StartRx(Ptr< SpectrumSignalParameters > rxParams, Ptr< const WifiSpectrumPhyInterface > interface)
Input method for delivering a signal from the spectrum channel and low-level PHY interface to this Sp...
void DoInitialize() override
Initialize() implementation.
void FinalizeChannelSwitch() override
Method that can be overridden by subclasses to perform operations after the channel is actually switc...
dBr_u m_txMaskOuterBandMinimumRejection
The minimum rejection for the outer band of the transmit spectrum mask.
std::map< FrequencyRange, Ptr< WifiSpectrumPhyInterface > > m_spectrumPhyInterfaces
Spectrum PHY interfaces.
WifiSpectrumBandFrequencies ConvertIndicesToFrequenciesForInterface(Ptr< WifiSpectrumPhyInterface > spectrumPhyInterface, const WifiSpectrumBandIndices &indices) const
This is a helper function to convert start and stop indices to start and stop frequencies.
HeRuBands GetHeRuBands(Ptr< WifiSpectrumPhyInterface > spectrumPhyInterface, MHz_u guardBandwidth)
This function computes the RU bands that belong to a given spectrum PHY interface.
Ptr< AntennaModel > m_antenna
antenna model
FrequencyRange GetCurrentFrequencyRange() const override
Get the frequency range of the current RF interface.
Ptr< const WifiPpdu > GetRxPpduFromTxPpdu(Ptr< const WifiPpdu > ppdu)
Determine the WifiPpdu to be used by the RX PHY based on the WifiPpdu sent by the TX PHY.
MHz_u GetGuardBandwidth(MHz_u currentChannelWidth) const override
Ptr< WifiSpectrumPhyInterface > GetInterfaceCoveringChannelBand(MHz_u frequency, MHz_u width) const
Get the spectrum PHY interface that covers a band portion of the RF channel.
Ptr< AntennaModel > GetAntenna() const
Get the antenna model used for reception.
std::tuple< dBr_u, dBr_u, dBr_u > GetTxMaskRejectionParams() const override
Ptr< Channel > GetChannel() const override
Return the Channel this WifiPhy is connected to.
void AddChannel(const Ptr< SpectrumChannel > channel, const FrequencyRange &freqRange=WHOLE_WIFI_SPECTRUM)
Attach a SpectrumChannel to use for a given frequency range.
void SetChannelSwitchedCallback(Callback< void > callback)
Ptr< WifiSpectrumPhyInterface > m_currentSpectrumPhyInterface
The current Spectrum PHY interface (held for performance reasons)
Ptr< WifiSpectrumPhyInterface > GetCurrentInterface() const
Get the currently active spectrum PHY interface.
bool m_trackSignalsInactiveInterfaces
flag whether signals coming from inactive spectrum PHY interfaces are tracked
void DoDispose() override
Destructor implementation.
const std::map< FrequencyRange, Ptr< WifiSpectrumPhyInterface > > & GetSpectrumPhyInterfaces() const
Get the map of interfaces attached to this spectrum PHY.
static TypeId GetTypeId()
Get the type ID.
TracedCallback< Ptr< const SpectrumSignalParameters >, uint32_t, double, Time > m_signalCb
Signal callback.
Callback< void > m_channelSwitchedCallback
Callback when channel switched.
void SetAntenna(const Ptr< AntennaModel > antenna)
void ResetSpectrumModel(Ptr< WifiSpectrumPhyInterface > spectrumPhyInterface, const std::vector< MHz_u > ¢erFrequencies, MHz_u channelWidth)
Perform run-time spectrum model change.
void ConfigureInterface(const std::vector< MHz_u > &frequencies, MHz_u width)
Configure a non-active spectrum PHY interface to operate on a given frequency (or several frequencies...
bool m_disableWifiReception
forces this PHY to fail to sync on any signal
bool CanStartRx(Ptr< const WifiPpdu > ppdu) const
Determine whether the PHY shall issue a PHY-RXSTART.indication primitive in response to a given PPDU.
void UpdateInterferenceHelperBands(Ptr< WifiSpectrumPhyInterface > spectrumPhyInterface)
This function is called to update the bands handled by the InterferenceHelper.
void StartTx(Ptr< const WifiPpdu > ppdu) override
dBr_u m_txMaskOuterBandMaximumRejection
The maximum rejection for the outer band of the transmit spectrum mask.
void NotifyChannelSwitched()
Notify the spectrum channel has switched.
void DoChannelSwitch() override
Actually switch channel based on the stored channel settings.
static uint32_t GetNumBandsBetweenSegments(const std::vector< MHz_u > ¢erFrequencies, MHz_u totalWidth, Hz_u subcarrierSpacing)
Determine the number of bands between the two segments if the operating channel is made of non-contig...
WifiSpectrumBandFrequencies ConvertIndicesToFrequencies(const WifiSpectrumBandIndices &indices) const override
This is a helper function to convert start and stop indices to start and stop frequencies.
WifiSpectrumBandInfo GetBandForInterface(Ptr< WifiSpectrumPhyInterface > spectrumPhyInterface, MHz_u bandWidth, uint8_t bandIndex=0)
Get the info of a given band that belongs to a given spectrum PHY interface.
Simulation virtual time values and global simulation resolution.
TimeWithUnit As(const Unit unit=Time::AUTO) const
Attach a unit to a Time, to facilitate output in a specific unit.
a unique identifier for an interface.
TypeId SetParent(TypeId tid)
Set the parent TypeId.
dBm_u GetRxSensitivity() const
Return the receive sensitivity threshold.
Hz_u GetSubcarrierSpacing() const
TracedCallback< Ptr< const WifiPpdu >, const WifiTxVector & > m_signalTransmissionCb
Signal Transmission callback.
Ptr< PhyEntity > GetPhyEntity(WifiModulationClass modulation) const
Get the supported PHY entity corresponding to the modulation class.
virtual void SetDevice(const Ptr< WifiNetDevice > device)
Sets the device this PHY is associated with.
void StartReceivePreamble(Ptr< const WifiPpdu > ppdu, RxPowerWattPerChannelBand &rxPowersW, Time rxDuration)
Start receiving the PHY preamble of a PPDU (i.e.
MHz_u GetChannelWidth() const
Ptr< WifiNetDevice > GetDevice() const
Return the device this PHY is associated with.
void DoDispose() override
Destructor implementation.
dB_u GetRxGain() const
Return the reception gain.
virtual void DoChannelSwitch()
Actually switch channel based on the stored channel settings.
void SwitchMaybeToCcaBusy(const Ptr< const WifiPpdu > ppdu=nullptr)
Check if PHY state should move to CCA busy state based on current state of interference tracker.
Ptr< InterferenceHelper > m_interference
Pointer to a helper responsible for interference computations.
void DoInitialize() override
Initialize() implementation.
WifiStandard GetStandard() const
Get the configured Wi-Fi standard.
Ptr< PhyEntity > GetPhyEntityForPpdu(const Ptr< const WifiPpdu > ppdu) const
Get the supported PHY entity to use for a received PPDU.
const WifiPhyOperatingChannel & GetOperatingChannel() const
Get a const reference to the operating channel.
Ptr< PhyEntity > GetLatestPhyEntity() const
Get the latest PHY entity supported by this PHY instance.
bool IsSet() const
Return true if a valid channel has been set, false otherwise.
std::size_t GetNSegments() const
Get the number of frequency segments in the operating channel.
uint8_t GetPrimaryChannelIndex(MHz_u primaryChannelWidth) const
If the operating channel width is a multiple of 20 MHz, return the index of the primary channel of th...
std::vector< MHz_u > GetFrequencies() const
Return the center frequency per segment.
std::vector< MHz_u > GetWidths() const
Return the channel width per segment.
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.
#define NS_ASSERT(condition)
At runtime, in debugging builds, if this condition is not true, the program prints the source file,...
#define NS_ASSERT_MSG(condition, message)
At runtime, in debugging builds, if this condition is not true, the program prints the message to out...
Ptr< const AttributeChecker > MakeBooleanChecker()
Ptr< const AttributeAccessor > MakeBooleanAccessor(T1 a1)
Create an AttributeAccessor for a class data member, or a lone class get functor or set method.
Ptr< const AttributeChecker > MakeDoubleChecker()
Ptr< const AttributeAccessor > MakeDoubleAccessor(T1 a1)
Create an AttributeAccessor for a class data member, or a lone class get functor or set method.
#define NS_ABORT_MSG_IF(cond, msg)
Abnormal program termination if a condition is true, with a message.
#define NS_ABORT_IF(cond)
Abnormal program termination if a condition is true.
#define NS_LOG_COMPONENT_DEFINE(name)
Define a Log component with a specific name.
#define NS_LOG_DEBUG(msg)
Use NS_LOG to output a message of level LOG_DEBUG.
#define NS_LOG_FUNCTION(parameters)
If log level LOG_FUNCTION is enabled, this macro will output all input parameters separated by ",...
#define NS_LOG_INFO(msg)
Use NS_LOG to output a message of level LOG_INFO.
Ptr< T > CreateObject(Args &&... args)
Create an object by type, with varying number of constructor parameters.
#define NS_OBJECT_ENSURE_REGISTERED(type)
Register an Object subclass with the TypeId system.
Ptr< const TraceSourceAccessor > MakeTraceSourceAccessor(T a)
Create a TraceSourceAccessor which will control access to the underlying trace source.
Every class exported by the ns3 library is enclosed in the ns3 namespace.
std::map< WifiSpectrumBandInfo, HeRu::RuSpec > HeRuBands
Map a spectrum band associated with an RU to the RU specification.
double Integral(const SpectrumValue &arg)
dBm_u WToDbm(Watt_u val)
Convert from Watts to dBm.
std::vector< WifiSpectrumBandInfo > WifiSpectrumBands
vector of spectrum bands
double MHz_u
MHz weak type.
Ptr< T1 > DynamicCast(const Ptr< T2 > &p)
Cast a Ptr.
std::pair< Hz_u, Hz_u > WifiSpectrumBandFrequencies
typedef for a pair of start and stop frequencies to represent a band
std::map< WifiSpectrumBandInfo, Watt_u > RxPowerWattPerChannelBand
A map of the received power for each band.
double DbToRatio(dB_u val)
Convert from dB to ratio.
Watt_u DbmToW(dBm_u val)
Convert from dBm to Watts.
Hz_u MHzToHz(MHz_u val)
Convert from MHz to Hz.
std::pair< uint32_t, uint32_t > WifiSpectrumBandIndices
typedef for a pair of start and stop sub-band indices
Struct defining a frequency range between minFrequency and maxFrequency.
WifiSpectrumBandInfo structure containing info about a spectrum band.
std::vector< WifiSpectrumBandFrequencies > frequencies
the start and stop frequencies for each segment of the band
std::vector< WifiSpectrumBandIndices > indices
the start and stop indices for each segment of the band