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 < 20)
133 for (
MHz_u bw = channelWidth; bw >= 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 >= 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 == 160 && phyIndex > nRus / 2 ? phyIndex - nRus / 2 : phyIndex);
183 bool primary80IsLower80 = (p20Index < bw / 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 "Use multi model spectrum channel if PHYs have different spectrum models!");
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 "
492 Watt_u totalRxPower = 0.0;
495 const auto rxGainRatio =
DbToRatio(GetRxGain());
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 + ((startStopFreqs.second - startStopFreqs.first) / 1e6);
509 index = ((bw != prevBw) ? 0 : (index + 1));
510 auto rxPowerPerBand =
511 WifiSpectrumValueHelper::GetBandPowerW(receivedSignalPsd, band.indices);
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 > 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});
544 "Total signal power received after antenna gain: "
545 << totalRxPower <<
" W"
546 << (totalRxPower > 0.0 ?
" (" + std::to_string(
WToDbm(totalRxPower)) +
" dBm)" :
""));
552 if (totalRxPower > 0.0)
560 NS_LOG_INFO(
"Received Wi-Fi signal from a non-active PHY interface "
561 << interface->GetFrequencyRange());
562 m_interference->AddForeignSignal(rxDuration, rxPowers, interface->GetFrequencyRange());
571 interface ? interface->GetFrequencyRange()
579 NS_LOG_INFO(
"Received Wi-Fi signal but blocked from syncing");
581 m_interference->AddForeignSignal(rxDuration, rxPowers, interface->GetFrequencyRange());
593 "Received signal too weak to process: "
594 << totalRxPower <<
" W"
595 << (totalRxPower > 0.0 ?
" (" + std::to_string(
WToDbm(totalRxPower)) +
" dBm)" :
""));
601 if (wifiRxParams->txPhy)
605 NS_LOG_INFO(
"Cannot start reception of the PPDU, consider it as interference");
642 spectrumPhyInterface.second->SetDevice(device);
665 MHz_u guardBandwidth = 0;
666 if (currentChannelWidth == 22)
679 guardBandwidth = currentChannelWidth;
681 return guardBandwidth;
689 const auto numSegments = centerFrequencies.size();
690 NS_ABORT_MSG_IF(numSegments > 2,
"Only 2 non-contiguous frequency segments are supported");
695 const auto lowFrequency = *centerFrequencies.cbegin();
696 const auto highFrequency = *centerFrequencies.crbegin();
697 NS_ASSERT(lowFrequency != highFrequency);
699 const auto segmentsWidth = totalWidth / numSegments;
700 const auto widthBetweenSegments = highFrequency - lowFrequency - segmentsWidth;
701 return (widthBetweenSegments * 1e6) / subcarrierSpacing;
709 const auto channelWidth = spectrumPhyInterface->GetChannelWidth();
711 "Bandwidth (" << bandWidth <<
") cannot exceed total operating channel width ("
712 << channelWidth <<
")");
715 std::size_t numSegments = 1;
716 if (
const auto segmentWidth =
717 (channelWidth / spectrumPhyInterface->GetCenterFrequencies().size());
718 bandWidth > segmentWidth)
721 numSegments = spectrumPhyInterface->GetCenterFrequencies().size();
722 bandWidth /= spectrumPhyInterface->GetCenterFrequencies().size();
724 const auto numBandsInBand =
static_cast<size_t>(bandWidth * 1e6 / subcarrierSpacing);
725 auto numBandsInChannel =
static_cast<size_t>(channelWidth * 1e6 / subcarrierSpacing);
726 const auto numBands = channelWidth / bandWidth;
727 if (numBandsInBand % 2 == 0)
729 numBandsInChannel += 1;
731 auto rxSpectrumModel = spectrumPhyInterface->GetRxSpectrumModel();
732 size_t totalNumBands = rxSpectrumModel->GetNumBands();
733 NS_ASSERT_MSG((numBandsInChannel % 2 == 1) && (totalNumBands % 2 == 1),
734 "Should have odd number of bands");
735 for (std::size_t segmentIndex = 0; segmentIndex < numSegments; ++segmentIndex)
737 NS_ASSERT_MSG(bandIndex < numBands,
"Band index is out of bound");
738 NS_ASSERT(totalNumBands >= numBandsInChannel);
739 const auto numBandsBetweenSegments =
743 auto startIndex = ((totalNumBands - numBandsInChannel - numBandsBetweenSegments) / 2) +
744 (bandIndex * numBandsInBand);
745 if (bandIndex >= (numBands / 2))
747 startIndex += numBandsBetweenSegments;
749 auto stopIndex = startIndex + numBandsInBand - 1;
752 auto freqRange = spectrumPhyInterface->GetFrequencyRange();
753 NS_ASSERT(frequencies.first >= (freqRange.minFrequency * 1e6));
754 NS_ASSERT(frequencies.second <= (freqRange.maxFrequency * 1e6));
755 NS_ASSERT((frequencies.second - frequencies.first) == (bandWidth * 1e6));
756 if (startIndex >= totalNumBands / 2)
761 bandInfo.
indices.emplace_back(startIndex, stopIndex);
788 auto rxSpectrumModel = spectrumPhyInterface->GetRxSpectrumModel();
789 auto startGuardBand = rxSpectrumModel->Begin();
790 auto startChannel = std::next(startGuardBand, indices.first);
791 auto endChannel = std::next(startGuardBand, indices.second + 1);
792 return {startChannel->fc, endChannel->fc};
795std::tuple<dBr_u, dBr_u, dBr_u>
810const std::map<FrequencyRange, Ptr<WifiSpectrumPhyInterface>>&
819 const auto lowFreq = frequency - (width / 2);
820 const auto highFreq = frequency + (width / 2);
823 [lowFreq, highFreq](
const auto& item) {
824 return ((lowFreq >= item.first.minFrequency) &&
825 (highFreq <= item.first.maxFrequency));
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)
static uint32_t GetNumBandsBetweenSegments(const std::vector< MHz_u > ¢erFrequencies, MHz_u totalWidth, uint32_t subcarrierSpacing)
Determine the number of bands between the two segments if the operating channel is made of non-contig...
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.
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.
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.
#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...
#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.
Ptr< const AttributeChecker > MakeBooleanChecker()
Ptr< const AttributeChecker > MakeDoubleChecker()
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.
Ptr< const AttributeAccessor > MakeBooleanAccessor(T1 a1)
Ptr< const AttributeAccessor > MakeDoubleAccessor(T1 a1)
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