wifi: Use double for frequencies
This commit is contained in:
committed by
Sébastien Deronne
parent
e287da982b
commit
9cc2cb08ee
@@ -1230,9 +1230,9 @@ HePhy::GetPer20MHzDurations(const Ptr<const WifiPpdu> ppdu)
|
||||
|
||||
if (ppdu)
|
||||
{
|
||||
const uint16_t subchannelMinFreq =
|
||||
const double subchannelMinFreq =
|
||||
m_wifiPhy->GetFrequency() - (m_wifiPhy->GetChannelWidth() / 2) + (index * 20);
|
||||
const uint16_t subchannelMaxFreq = subchannelMinFreq + 20;
|
||||
const double subchannelMaxFreq = subchannelMinFreq + 20;
|
||||
const auto ppduBw = ppdu->GetTxVector().GetChannelWidth();
|
||||
|
||||
if (ppduBw <= m_wifiPhy->GetChannelWidth() &&
|
||||
@@ -1351,7 +1351,7 @@ HePhy::GetTxPowerSpectralDensity(double txPowerW,
|
||||
const auto& txVector = ppdu->GetTxVector();
|
||||
const auto& centerFrequencies = ppdu->GetTxCenterFreqs();
|
||||
auto channelWidth = txVector.GetChannelWidth();
|
||||
auto printFrequencies = [](const std::vector<uint16_t>& v) {
|
||||
auto printFrequencies = [](const std::vector<double>& v) {
|
||||
std::stringstream ss;
|
||||
for (const auto& centerFrequency : v)
|
||||
{
|
||||
@@ -1443,7 +1443,7 @@ HePhy::GetTxPowerSpectralDensity(double txPowerW,
|
||||
}
|
||||
}
|
||||
|
||||
std::vector<uint16_t>
|
||||
std::vector<double>
|
||||
HePhy::GetCenterFrequenciesForNonHePart(Ptr<const WifiPpdu> ppdu, uint16_t staId) const
|
||||
{
|
||||
NS_LOG_FUNCTION(this << ppdu << staId);
|
||||
@@ -1460,7 +1460,7 @@ HePhy::GetCenterFrequenciesForNonHePart(Ptr<const WifiPpdu> ppdu, uint16_t staId
|
||||
HeRu::RuSpec nonOfdmaRu =
|
||||
HeRu::FindOverlappingRu(currentWidth, ru, HeRu::GetRuType(nonOfdmaWidth));
|
||||
|
||||
uint16_t startingFrequency = centerFrequencies.front() - (currentWidth / 2);
|
||||
double startingFrequency = centerFrequencies.front() - (currentWidth / 2);
|
||||
centerFrequencies.front() =
|
||||
startingFrequency +
|
||||
nonOfdmaWidth * (nonOfdmaRu.GetPhyIndex(
|
||||
@@ -1859,9 +1859,9 @@ HePhy::GetRxPpduFromTxPpdu(Ptr<const WifiPpdu> ppdu)
|
||||
std::vector<WifiSpectrumBandIndices>
|
||||
HePhy::ConvertHeRuSubcarriers(ChannelWidthMhz bandWidth,
|
||||
ChannelWidthMhz guardBandwidth,
|
||||
const std::vector<uint16_t>& centerFrequencies,
|
||||
const std::vector<double>& centerFrequencies,
|
||||
ChannelWidthMhz totalWidth,
|
||||
uint32_t subcarrierSpacing,
|
||||
double subcarrierSpacing,
|
||||
HeRu::SubcarrierRange subcarrierRange,
|
||||
uint8_t bandIndex)
|
||||
{
|
||||
|
||||
@@ -223,8 +223,8 @@ class HePhy : public VhtPhy
|
||||
* \param staId the STA-ID of the station taking part of the UL MU
|
||||
* \return the center frequency in MHz corresponding to the non-HE portion of the HE TB PPDU
|
||||
*/
|
||||
std::vector<uint16_t> GetCenterFrequenciesForNonHePart(const Ptr<const WifiPpdu> ppdu,
|
||||
uint16_t staId) const;
|
||||
std::vector<double> GetCenterFrequenciesForNonHePart(const Ptr<const WifiPpdu> ppdu,
|
||||
uint16_t staId) const;
|
||||
|
||||
/**
|
||||
* Sets the OBSS-PD algorithm.
|
||||
@@ -459,9 +459,9 @@ class HePhy : public VhtPhy
|
||||
static std::vector<WifiSpectrumBandIndices> ConvertHeRuSubcarriers(
|
||||
ChannelWidthMhz bandWidth,
|
||||
ChannelWidthMhz guardBandwidth,
|
||||
const std::vector<uint16_t>& centerFrequencies,
|
||||
const std::vector<double>& centerFrequencies,
|
||||
ChannelWidthMhz totalWidth,
|
||||
uint32_t subcarrierSpacing,
|
||||
double subcarrierSpacing,
|
||||
HeRu::SubcarrierRange subcarrierRange,
|
||||
uint8_t bandIndex = 0);
|
||||
|
||||
|
||||
@@ -846,10 +846,10 @@ HtPhy::GetCcaIndication(const Ptr<const WifiPpdu> ppdu)
|
||||
if (ppdu)
|
||||
{
|
||||
const ChannelWidthMhz primaryWidth = 20;
|
||||
uint16_t p20MinFreq =
|
||||
double p20MinFreq =
|
||||
m_wifiPhy->GetOperatingChannel().GetPrimaryChannelCenterFrequency(primaryWidth) -
|
||||
(primaryWidth / 2);
|
||||
uint16_t p20MaxFreq =
|
||||
double p20MaxFreq =
|
||||
m_wifiPhy->GetOperatingChannel().GetPrimaryChannelCenterFrequency(primaryWidth) +
|
||||
(primaryWidth / 2);
|
||||
if (ppdu->DoesOverlapChannel(p20MinFreq, p20MaxFreq))
|
||||
@@ -863,10 +863,10 @@ HtPhy::GetCcaIndication(const Ptr<const WifiPpdu> ppdu)
|
||||
}
|
||||
|
||||
const ChannelWidthMhz secondaryWidth = 20;
|
||||
uint16_t s20MinFreq =
|
||||
double s20MinFreq =
|
||||
m_wifiPhy->GetOperatingChannel().GetSecondaryChannelCenterFrequency(secondaryWidth) -
|
||||
(secondaryWidth / 2);
|
||||
uint16_t s20MaxFreq =
|
||||
double s20MaxFreq =
|
||||
m_wifiPhy->GetOperatingChannel().GetSecondaryChannelCenterFrequency(secondaryWidth) +
|
||||
(secondaryWidth / 2);
|
||||
if (!ppdu || ppdu->DoesOverlapChannel(s20MinFreq, s20MaxFreq))
|
||||
|
||||
@@ -168,7 +168,7 @@ ReducedNeighborReport::SetOperatingChannel(std::size_t nbrApInfoId,
|
||||
<< "band " << channel.GetPhyBand());
|
||||
|
||||
// find the primary channel number
|
||||
uint16_t startingFreq = 0;
|
||||
double startingFreq = 0;
|
||||
|
||||
switch (channel.GetPhyBand())
|
||||
{
|
||||
@@ -256,7 +256,7 @@ ReducedNeighborReport::GetOperatingChannel(std::size_t nbrApInfoId) const
|
||||
|
||||
NS_ABORT_IF(band == WIFI_PHY_BAND_UNSPECIFIED || width == 0);
|
||||
|
||||
uint16_t startingFreq = 0;
|
||||
double startingFreq = 0;
|
||||
|
||||
switch (band)
|
||||
{
|
||||
@@ -276,10 +276,10 @@ ReducedNeighborReport::GetOperatingChannel(std::size_t nbrApInfoId) const
|
||||
}
|
||||
|
||||
uint8_t primaryChannelNumber = m_nbrApInfoFields.at(nbrApInfoId).channelNumber;
|
||||
uint16_t primaryChannelCenterFrequency = startingFreq + primaryChannelNumber * 5;
|
||||
double primaryChannelCenterFrequency = startingFreq + primaryChannelNumber * 5;
|
||||
|
||||
uint8_t channelNumber = 0;
|
||||
uint16_t frequency = 0;
|
||||
double frequency = 0;
|
||||
|
||||
for (const auto& channel : WifiPhyOperatingChannel::m_frequencyChannels)
|
||||
{
|
||||
@@ -335,8 +335,8 @@ ReducedNeighborReport::GetOperatingChannel(std::size_t nbrApInfoId) const
|
||||
WifiPhyOperatingChannel channel;
|
||||
channel.Set({{channelNumber, frequency, width, band}}, WIFI_STANDARD_UNSPECIFIED);
|
||||
|
||||
uint16_t channelLowestFreq = frequency - width / 2;
|
||||
uint16_t primaryChannelLowestFreq = primaryChannelCenterFrequency - 10;
|
||||
double channelLowestFreq = frequency - width / 2;
|
||||
double primaryChannelLowestFreq = primaryChannelCenterFrequency - 10;
|
||||
channel.SetPrimary20Index((primaryChannelLowestFreq - channelLowestFreq) / 20);
|
||||
|
||||
return channel;
|
||||
|
||||
@@ -275,7 +275,7 @@ SpectrumWifiPhy::AddChannel(const Ptr<SpectrumChannel> channel, const FrequencyR
|
||||
|
||||
void
|
||||
SpectrumWifiPhy::ResetSpectrumModel(Ptr<WifiSpectrumPhyInterface> spectrumPhyInterface,
|
||||
const std::vector<uint16_t>& centerFrequencies,
|
||||
const std::vector<double>& centerFrequencies,
|
||||
ChannelWidthMhz channelWidth)
|
||||
{
|
||||
std::stringstream ss;
|
||||
@@ -310,7 +310,7 @@ SpectrumWifiPhy::DoChannelSwitch()
|
||||
NS_LOG_FUNCTION(this);
|
||||
m_frequenciesBeforeSwitch = GetOperatingChannel().IsSet()
|
||||
? GetOperatingChannel().GetFrequencies()
|
||||
: std::vector<uint16_t>{};
|
||||
: std::vector<double>{};
|
||||
m_widthsBeforeSwitch = GetOperatingChannel().IsSet() ? GetOperatingChannel().GetWidths()
|
||||
: std::vector<ChannelWidthMhz>{};
|
||||
WifiPhy::DoChannelSwitch();
|
||||
@@ -414,7 +414,7 @@ SpectrumWifiPhy::NotifyChannelSwitched()
|
||||
}
|
||||
|
||||
void
|
||||
SpectrumWifiPhy::ConfigureInterface(const std::vector<uint16_t>& frequencies, ChannelWidthMhz width)
|
||||
SpectrumWifiPhy::ConfigureInterface(const std::vector<double>& frequencies, ChannelWidthMhz width)
|
||||
{
|
||||
std::stringstream ss;
|
||||
for (const auto& centerFrequency : frequencies)
|
||||
@@ -693,7 +693,7 @@ SpectrumWifiPhy::GetGuardBandwidth(ChannelWidthMhz currentChannelWidth) const
|
||||
}
|
||||
|
||||
uint32_t
|
||||
SpectrumWifiPhy::GetNumBandsBetweenSegments(const std::vector<uint16_t>& centerFrequencies,
|
||||
SpectrumWifiPhy::GetNumBandsBetweenSegments(const std::vector<double>& centerFrequencies,
|
||||
ChannelWidthMhz totalWidth,
|
||||
uint32_t subcarrierSpacing)
|
||||
{
|
||||
@@ -800,9 +800,7 @@ SpectrumWifiPhy::ConvertIndicesToFrequenciesForInterface(
|
||||
auto startGuardBand = rxSpectrumModel->Begin();
|
||||
auto startChannel = std::next(startGuardBand, indices.first);
|
||||
auto endChannel = std::next(startGuardBand, indices.second + 1);
|
||||
auto lowFreq = static_cast<uint64_t>(startChannel->fc);
|
||||
auto highFreq = static_cast<uint64_t>(endChannel->fc);
|
||||
return {lowFreq, highFreq};
|
||||
return {startChannel->fc, endChannel->fc};
|
||||
}
|
||||
|
||||
std::tuple<double, double, double>
|
||||
@@ -827,7 +825,7 @@ SpectrumWifiPhy::GetSpectrumPhyInterfaces() const
|
||||
}
|
||||
|
||||
Ptr<WifiSpectrumPhyInterface>
|
||||
SpectrumWifiPhy::GetInterfaceCoveringChannelBand(uint16_t frequency, ChannelWidthMhz width) const
|
||||
SpectrumWifiPhy::GetInterfaceCoveringChannelBand(double frequency, ChannelWidthMhz width) const
|
||||
{
|
||||
const auto lowFreq = frequency - (width / 2);
|
||||
const auto highFreq = frequency + (width / 2);
|
||||
|
||||
@@ -144,7 +144,7 @@ class SpectrumWifiPhy : public WifiPhy
|
||||
* \param frequencies the center frequency of each segment in MHz the PHY interface should use
|
||||
* \param width the total channel width in MHz the PHY interface should use
|
||||
*/
|
||||
void ConfigureInterface(const std::vector<uint16_t>& frequencies, ChannelWidthMhz width);
|
||||
void ConfigureInterface(const std::vector<double>& frequencies, ChannelWidthMhz width);
|
||||
|
||||
/**
|
||||
* This function is sending the signal to the Spectrum channel
|
||||
@@ -186,7 +186,7 @@ class SpectrumWifiPhy : public WifiPhy
|
||||
* \return the number of bands between the two segments if the operating channel is made of
|
||||
* non-contiguous segments, zero otherwise
|
||||
*/
|
||||
static uint32_t GetNumBandsBetweenSegments(const std::vector<uint16_t>& centerFrequencies,
|
||||
static uint32_t GetNumBandsBetweenSegments(const std::vector<double>& centerFrequencies,
|
||||
ChannelWidthMhz totalWidth,
|
||||
uint32_t subcarrierSpacing);
|
||||
|
||||
@@ -222,7 +222,7 @@ class SpectrumWifiPhy : public WifiPhy
|
||||
* \param channelWidth the total channel width in MHz the PHY interface should use
|
||||
*/
|
||||
void ResetSpectrumModel(Ptr<WifiSpectrumPhyInterface> spectrumPhyInterface,
|
||||
const std::vector<uint16_t>& centerFrequencies,
|
||||
const std::vector<double>& centerFrequencies,
|
||||
ChannelWidthMhz channelWidth);
|
||||
|
||||
/**
|
||||
@@ -290,7 +290,7 @@ class SpectrumWifiPhy : public WifiPhy
|
||||
* \param width the width in MHz of the RF channel band
|
||||
* \return the spectrum PHY interface that covers the indicated band of the RF channel
|
||||
*/
|
||||
Ptr<WifiSpectrumPhyInterface> GetInterfaceCoveringChannelBand(uint16_t frequency,
|
||||
Ptr<WifiSpectrumPhyInterface> GetInterfaceCoveringChannelBand(double frequency,
|
||||
ChannelWidthMhz width) const;
|
||||
|
||||
/**
|
||||
@@ -303,7 +303,7 @@ class SpectrumWifiPhy : public WifiPhy
|
||||
bool m_disableWifiReception; //!< forces this PHY to fail to sync on any signal
|
||||
bool m_trackSignalsInactiveInterfaces; //!< flag whether signals coming from inactive spectrum
|
||||
//!< PHY interfaces are tracked
|
||||
std::vector<uint16_t> m_frequenciesBeforeSwitch; //!< center frequency before channel switch
|
||||
std::vector<double> m_frequenciesBeforeSwitch; //!< center frequency before channel switch
|
||||
std::vector<ChannelWidthMhz> m_widthsBeforeSwitch; //!< channel width before channel switch
|
||||
|
||||
TracedCallback<Ptr<const SpectrumSignalParameters>, uint32_t, double, Time>
|
||||
|
||||
@@ -609,10 +609,10 @@ VhtPhy::GetCcaIndication(const Ptr<const WifiPpdu> ppdu)
|
||||
if (ppdu)
|
||||
{
|
||||
const ChannelWidthMhz primaryWidth = 20;
|
||||
uint16_t p20MinFreq =
|
||||
double p20MinFreq =
|
||||
m_wifiPhy->GetOperatingChannel().GetPrimaryChannelCenterFrequency(primaryWidth) -
|
||||
(primaryWidth / 2);
|
||||
uint16_t p20MaxFreq =
|
||||
double p20MaxFreq =
|
||||
m_wifiPhy->GetOperatingChannel().GetPrimaryChannelCenterFrequency(primaryWidth) +
|
||||
(primaryWidth / 2);
|
||||
if (ppdu->DoesOverlapChannel(p20MinFreq, p20MaxFreq))
|
||||
@@ -631,11 +631,11 @@ VhtPhy::GetCcaIndication(const Ptr<const WifiPpdu> ppdu)
|
||||
for (const auto& secondaryChannel : secondaryChannels)
|
||||
{
|
||||
const auto secondaryWidth = secondaryChannel.first;
|
||||
uint16_t secondaryMinFreq =
|
||||
const auto secondaryMinFreq =
|
||||
m_wifiPhy->GetOperatingChannel().GetSecondaryChannelCenterFrequency(
|
||||
secondaryWidth) -
|
||||
(secondaryWidth / 2);
|
||||
uint16_t secondaryMaxFreq =
|
||||
const auto secondaryMaxFreq =
|
||||
m_wifiPhy->GetOperatingChannel().GetSecondaryChannelCenterFrequency(
|
||||
secondaryWidth) +
|
||||
(secondaryWidth / 2);
|
||||
|
||||
@@ -56,7 +56,7 @@ static constexpr uint8_t MAX_PROPAGATION_DELAY_USEC = 1;
|
||||
/**
|
||||
* typedef for a pair of start and stop frequencies in Hz to represent a band
|
||||
*/
|
||||
using WifiSpectrumBandFrequencies = std::pair<uint64_t, uint64_t>;
|
||||
using WifiSpectrumBandFrequencies = std::pair<double, double>;
|
||||
|
||||
/// WifiSpectrumBandInfo structure containing info about a spectrum band
|
||||
struct WifiSpectrumBandInfo
|
||||
|
||||
@@ -444,7 +444,7 @@ WifiPhyOperatingChannel::GetDefaultChannelNumber(
|
||||
|
||||
WifiPhyOperatingChannel::ConstIterator
|
||||
WifiPhyOperatingChannel::FindFirst(uint8_t number,
|
||||
uint16_t frequency,
|
||||
double frequency,
|
||||
ChannelWidthMhz width,
|
||||
WifiStandard standard,
|
||||
WifiPhyBand band,
|
||||
@@ -498,7 +498,7 @@ WifiPhyOperatingChannel::GetNumber(std::size_t segment /* = 0 */) const
|
||||
return (*std::next(m_channelIts.begin(), segment))->number;
|
||||
}
|
||||
|
||||
uint16_t
|
||||
double
|
||||
WifiPhyOperatingChannel::GetFrequency(std::size_t segment /* = 0 */) const
|
||||
{
|
||||
NS_ASSERT(IsSet());
|
||||
@@ -554,11 +554,11 @@ WifiPhyOperatingChannel::GetNumbers() const
|
||||
return channelNumbers;
|
||||
}
|
||||
|
||||
std::vector<uint16_t>
|
||||
std::vector<double>
|
||||
WifiPhyOperatingChannel::GetFrequencies() const
|
||||
{
|
||||
NS_ASSERT(IsSet());
|
||||
std::vector<uint16_t> centerFrequencies{};
|
||||
std::vector<double> centerFrequencies{};
|
||||
std::transform(m_channelIts.cbegin(),
|
||||
m_channelIts.cend(),
|
||||
std::back_inserter(centerFrequencies),
|
||||
@@ -688,7 +688,7 @@ WifiPhyOperatingChannel::GetSecondarySegmentIndex(ChannelWidthMhz primaryChannel
|
||||
return (secondaryIndex >= (numIndices / 2)) ? 1 : 0;
|
||||
}
|
||||
|
||||
uint16_t
|
||||
double
|
||||
WifiPhyOperatingChannel::GetPrimaryChannelCenterFrequency(ChannelWidthMhz primaryChannelWidth) const
|
||||
{
|
||||
const auto segmentIndex = GetPrimarySegmentIndex(primaryChannelWidth);
|
||||
@@ -701,7 +701,7 @@ WifiPhyOperatingChannel::GetPrimaryChannelCenterFrequency(ChannelWidthMhz primar
|
||||
primaryChannelWidth;
|
||||
}
|
||||
|
||||
uint16_t
|
||||
double
|
||||
WifiPhyOperatingChannel::GetSecondaryChannelCenterFrequency(
|
||||
ChannelWidthMhz secondaryChannelWidth) const
|
||||
{
|
||||
|
||||
@@ -49,7 +49,7 @@ struct FrequencyChannelInfo
|
||||
*/
|
||||
auto operator<=>(const FrequencyChannelInfo& info) const = default;
|
||||
uint8_t number{0}; ///< the channel number
|
||||
uint16_t frequency{0}; ///< the center frequency
|
||||
double frequency{0}; ///< the center frequency
|
||||
ChannelWidthMhz width{0}; ///< the channel width in MHz
|
||||
WifiPhyBand band{WifiPhyBand::WIFI_PHY_BAND_UNSPECIFIED}; ///< the PHY band
|
||||
FrequencyChannelType type{FrequencyChannelType::OFDM}; ///< the frequency channel type
|
||||
@@ -204,7 +204,7 @@ class WifiPhyOperatingChannel
|
||||
* \param segment the index of the frequency segment (if operating channel is non-contiguous)
|
||||
* \return the center frequency for a given frequency segment (in MHz)
|
||||
*/
|
||||
uint16_t GetFrequency(std::size_t segment = 0) const;
|
||||
double GetFrequency(std::size_t segment = 0) const;
|
||||
/**
|
||||
* Return the channel width for a given frequency segment (in MHz).
|
||||
* Segments are ordered by increasing frequencies, hence by default
|
||||
@@ -234,7 +234,7 @@ class WifiPhyOperatingChannel
|
||||
*
|
||||
* \return the center frequency per segment (in MHz)
|
||||
*/
|
||||
std::vector<uint16_t> GetFrequencies() const;
|
||||
std::vector<double> GetFrequencies() const;
|
||||
/**
|
||||
* Return the channel width per segment (in MHz).
|
||||
* Segments are ordered by increasing frequencies.
|
||||
@@ -307,7 +307,7 @@ class WifiPhyOperatingChannel
|
||||
* \param primaryChannelWidth the width of the primary channel in MHz
|
||||
* \return the center frequency of the primary channel of the given width
|
||||
*/
|
||||
uint16_t GetPrimaryChannelCenterFrequency(ChannelWidthMhz primaryChannelWidth) const;
|
||||
double GetPrimaryChannelCenterFrequency(ChannelWidthMhz primaryChannelWidth) const;
|
||||
|
||||
/**
|
||||
* Get the center frequency of the secondary channel of the given width.
|
||||
@@ -315,7 +315,7 @@ class WifiPhyOperatingChannel
|
||||
* \param secondaryChannelWidth the width of the secondary channel in MHz
|
||||
* \return the center frequency of the secondary channel of the given width
|
||||
*/
|
||||
uint16_t GetSecondaryChannelCenterFrequency(ChannelWidthMhz secondaryChannelWidth) const;
|
||||
double GetSecondaryChannelCenterFrequency(ChannelWidthMhz secondaryChannelWidth) const;
|
||||
|
||||
/**
|
||||
* Get the channel indices of all the 20 MHz channels included in the primary
|
||||
@@ -367,7 +367,7 @@ class WifiPhyOperatingChannel
|
||||
* of the set of available channels
|
||||
*/
|
||||
static ConstIterator FindFirst(uint8_t number,
|
||||
uint16_t frequency,
|
||||
double frequency,
|
||||
ChannelWidthMhz width,
|
||||
WifiStandard standard,
|
||||
WifiPhyBand band,
|
||||
|
||||
@@ -124,7 +124,7 @@ WifiPhy::GetTypeId()
|
||||
TypeId::ATTR_GET,
|
||||
UintegerValue(0),
|
||||
MakeUintegerAccessor(&WifiPhy::GetFrequency),
|
||||
MakeUintegerChecker<uint16_t>())
|
||||
MakeUintegerChecker<int64_t>())
|
||||
.AddAttribute("ChannelNumber",
|
||||
"The channel number of the current operating channel.",
|
||||
TypeId::ATTR_GET,
|
||||
@@ -1083,7 +1083,7 @@ WifiPhy::GetOperatingChannel() const
|
||||
return m_operatingChannel;
|
||||
}
|
||||
|
||||
uint16_t
|
||||
double
|
||||
WifiPhy::GetFrequency() const
|
||||
{
|
||||
return m_operatingChannel.GetFrequency();
|
||||
@@ -1700,7 +1700,7 @@ WifiPhy::NotifyRxPpduDrop(Ptr<const WifiPpdu> ppdu, WifiPhyRxfailureReason reaso
|
||||
|
||||
void
|
||||
WifiPhy::NotifyMonitorSniffRx(Ptr<const WifiPsdu> psdu,
|
||||
uint16_t channelFreqMhz,
|
||||
double channelFreqMhz,
|
||||
WifiTxVector txVector,
|
||||
SignalNoiseDbm signalNoise,
|
||||
std::vector<bool> statusPerMpdu,
|
||||
@@ -1723,7 +1723,7 @@ WifiPhy::NotifyMonitorSniffRx(Ptr<const WifiPsdu> psdu,
|
||||
if (statusPerMpdu.at(i)) // packet received without error, hand over to sniffer
|
||||
{
|
||||
m_phyMonitorSniffRxTrace(psdu->GetAmpduSubframe(i),
|
||||
channelFreqMhz,
|
||||
static_cast<uint16_t>(channelFreqMhz),
|
||||
txVector,
|
||||
aMpdu,
|
||||
signalNoise,
|
||||
@@ -1743,7 +1743,7 @@ WifiPhy::NotifyMonitorSniffRx(Ptr<const WifiPsdu> psdu,
|
||||
{
|
||||
aMpdu.type = NORMAL_MPDU;
|
||||
m_phyMonitorSniffRxTrace(psdu->GetPacket(),
|
||||
channelFreqMhz,
|
||||
static_cast<uint16_t>(channelFreqMhz),
|
||||
txVector,
|
||||
aMpdu,
|
||||
signalNoise,
|
||||
@@ -1754,7 +1754,7 @@ WifiPhy::NotifyMonitorSniffRx(Ptr<const WifiPsdu> psdu,
|
||||
|
||||
void
|
||||
WifiPhy::NotifyMonitorSniffTx(Ptr<const WifiPsdu> psdu,
|
||||
uint16_t channelFreqMhz,
|
||||
double channelFreqMhz,
|
||||
WifiTxVector txVector,
|
||||
uint16_t staId)
|
||||
{
|
||||
@@ -2361,10 +2361,10 @@ WifiPhy::GetPrimaryChannelNumber(ChannelWidthMhz primaryChannelWidth) const
|
||||
return m_operatingChannel.GetPrimaryChannelNumber(primaryChannelWidth, m_standard);
|
||||
}
|
||||
|
||||
uint32_t
|
||||
double
|
||||
WifiPhy::GetSubcarrierSpacing() const
|
||||
{
|
||||
uint32_t subcarrierSpacing = 0;
|
||||
double subcarrierSpacing = 0;
|
||||
switch (GetStandard())
|
||||
{
|
||||
case WIFI_STANDARD_80211a:
|
||||
|
||||
@@ -650,7 +650,7 @@ class WifiPhy : public Object
|
||||
* \param staId the STA-ID
|
||||
*/
|
||||
void NotifyMonitorSniffRx(Ptr<const WifiPsdu> psdu,
|
||||
uint16_t channelFreqMhz,
|
||||
double channelFreqMhz,
|
||||
WifiTxVector txVector,
|
||||
SignalNoiseDbm signalNoise,
|
||||
std::vector<bool> statusPerMpdu,
|
||||
@@ -698,7 +698,7 @@ class WifiPhy : public Object
|
||||
* \param staId the STA-ID
|
||||
*/
|
||||
void NotifyMonitorSniffTx(Ptr<const WifiPsdu> psdu,
|
||||
uint16_t channelFreqMhz,
|
||||
double channelFreqMhz,
|
||||
WifiTxVector txVector,
|
||||
uint16_t staId = SU_STA_ID);
|
||||
|
||||
@@ -985,7 +985,7 @@ class WifiPhy : public Object
|
||||
/**
|
||||
* \return the operating center frequency (MHz)
|
||||
*/
|
||||
uint16_t GetFrequency() const;
|
||||
double GetFrequency() const;
|
||||
/**
|
||||
* \return the index of the primary 20 MHz channel
|
||||
*/
|
||||
@@ -1272,7 +1272,7 @@ class WifiPhy : public Object
|
||||
/**
|
||||
* \return the subcarrier spacing corresponding to the configure standard (Hz)
|
||||
*/
|
||||
uint32_t GetSubcarrierSpacing() const;
|
||||
double GetSubcarrierSpacing() const;
|
||||
|
||||
/**
|
||||
* Callback invoked when the PHY model starts to transmit a signal
|
||||
|
||||
@@ -37,7 +37,7 @@ namespace
|
||||
* \param channelWidth the channel width in MHz
|
||||
* \return the center frequency (in MHz) of each segment covered by the given width
|
||||
*/
|
||||
std::vector<uint16_t>
|
||||
std::vector<double>
|
||||
GetChannelCenterFrequenciesPerSegment(const ns3::WifiPhyOperatingChannel& channel,
|
||||
ns3::ChannelWidthMhz channelWidth)
|
||||
{
|
||||
@@ -45,7 +45,7 @@ GetChannelCenterFrequenciesPerSegment(const ns3::WifiPhyOperatingChannel& channe
|
||||
{
|
||||
return {};
|
||||
}
|
||||
std::vector<uint16_t> freqs{};
|
||||
std::vector<double> freqs{};
|
||||
const auto width = std::min(channelWidth, channel.GetWidth(0));
|
||||
const auto primarySegmentIndex = channel.GetPrimarySegmentIndex(width);
|
||||
const auto secondarySegmentIndex = channel.GetSecondarySegmentIndex(width);
|
||||
@@ -188,14 +188,14 @@ WifiPpdu::GetTxChannelWidth() const
|
||||
return m_txChannelWidth;
|
||||
}
|
||||
|
||||
std::vector<uint16_t>
|
||||
std::vector<double>
|
||||
WifiPpdu::GetTxCenterFreqs() const
|
||||
{
|
||||
return m_txCenterFreqs;
|
||||
}
|
||||
|
||||
bool
|
||||
WifiPpdu::DoesOverlapChannel(uint16_t minFreq, uint16_t maxFreq) const
|
||||
WifiPpdu::DoesOverlapChannel(double minFreq, double maxFreq) const
|
||||
{
|
||||
NS_LOG_FUNCTION(this << minFreq << maxFreq);
|
||||
// all segments have the same width
|
||||
|
||||
@@ -140,7 +140,7 @@ class WifiPpdu : public SimpleRefCount<WifiPpdu>
|
||||
/**
|
||||
* \return the center frequency per segment (MHz) used for the transmission of this PPDU
|
||||
*/
|
||||
std::vector<uint16_t> GetTxCenterFreqs() const;
|
||||
std::vector<double> GetTxCenterFreqs() const;
|
||||
|
||||
/**
|
||||
* Check whether the given PPDU overlaps a given channel.
|
||||
@@ -149,7 +149,7 @@ class WifiPpdu : public SimpleRefCount<WifiPpdu>
|
||||
* \param maxFreq the maximum frequency (MHz) of the channel
|
||||
* \return true if this PPDU overlaps the channel, false otherwise
|
||||
*/
|
||||
bool DoesOverlapChannel(uint16_t minFreq, uint16_t maxFreq) const;
|
||||
bool DoesOverlapChannel(double minFreq, double maxFreq) const;
|
||||
|
||||
/**
|
||||
* Get the modulation used for the PPDU.
|
||||
@@ -200,12 +200,12 @@ class WifiPpdu : public SimpleRefCount<WifiPpdu>
|
||||
*/
|
||||
virtual std::string PrintPayload() const;
|
||||
|
||||
WifiPreamble m_preamble; //!< the PHY preamble
|
||||
WifiModulationClass m_modulation; //!< the modulation used for the transmission of this PPDU
|
||||
WifiConstPsduMap m_psdus; //!< the PSDUs contained in this PPDU
|
||||
std::vector<uint16_t> m_txCenterFreqs; //!< the center frequency (MHz) per segment used for the
|
||||
//!< transmission of this PPDU
|
||||
uint64_t m_uid; //!< the unique ID of this PPDU
|
||||
WifiPreamble m_preamble; //!< the PHY preamble
|
||||
WifiModulationClass m_modulation; //!< the modulation used for the transmission of this PPDU
|
||||
WifiConstPsduMap m_psdus; //!< the PSDUs contained in this PPDU
|
||||
std::vector<double> m_txCenterFreqs; //!< the center frequency (MHz) per segment used for the
|
||||
//!< transmission of this PPDU
|
||||
uint64_t m_uid; //!< the unique ID of this PPDU
|
||||
mutable std::optional<WifiTxVector>
|
||||
m_txVector; //!< the TXVECTOR at TX PHY or the reconstructed TXVECTOR at RX PHY (or
|
||||
//!< std::nullopt if TXVECTOR has not been reconstructed yet)
|
||||
|
||||
@@ -109,7 +109,7 @@ WifiSpectrumPhyInterface::SetChannel(const Ptr<SpectrumChannel> c)
|
||||
}
|
||||
|
||||
void
|
||||
WifiSpectrumPhyInterface::SetRxSpectrumModel(const std::vector<uint16_t>& centerFrequencies,
|
||||
WifiSpectrumPhyInterface::SetRxSpectrumModel(const std::vector<double>& centerFrequencies,
|
||||
ChannelWidthMhz channelWidth,
|
||||
uint32_t bandBandwidth,
|
||||
ChannelWidthMhz guardBandwidth)
|
||||
@@ -152,7 +152,7 @@ WifiSpectrumPhyInterface::GetFrequencyRange() const
|
||||
return m_frequencyRange;
|
||||
}
|
||||
|
||||
const std::vector<uint16_t>&
|
||||
const std::vector<double>&
|
||||
WifiSpectrumPhyInterface::GetCenterFrequencies() const
|
||||
{
|
||||
return m_centerFrequencies;
|
||||
|
||||
@@ -99,7 +99,7 @@ class WifiSpectrumPhyInterface : public SpectrumPhy
|
||||
* \return the center frequency in MHz for each segment of the the spectrum channel this
|
||||
* interface is attached to to
|
||||
*/
|
||||
const std::vector<uint16_t>& GetCenterFrequencies() const;
|
||||
const std::vector<double>& GetCenterFrequencies() const;
|
||||
|
||||
/**
|
||||
* Get the channel width in MHz covered by the spectrum channel this interface is attached to
|
||||
@@ -124,7 +124,7 @@ class WifiSpectrumPhyInterface : public SpectrumPhy
|
||||
* \param bandBandwidth the width of each band in Hz
|
||||
* \param guardBandwidth the total width of the guard band in MHz
|
||||
*/
|
||||
void SetRxSpectrumModel(const std::vector<uint16_t>& centerFrequencies,
|
||||
void SetRxSpectrumModel(const std::vector<double>& centerFrequencies,
|
||||
ChannelWidthMhz channelWidth,
|
||||
uint32_t bandBandwidth,
|
||||
ChannelWidthMhz guardBandwidth);
|
||||
@@ -162,7 +162,7 @@ class WifiSpectrumPhyInterface : public SpectrumPhy
|
||||
Ptr<SpectrumWifiPhy> m_spectrumWifiPhy; ///< spectrum PHY
|
||||
Ptr<NetDevice> m_netDevice; ///< the device
|
||||
Ptr<SpectrumChannel> m_channel; ///< spectrum channel
|
||||
std::vector<uint16_t> m_centerFrequencies; ///< center frequency per segment in MHz
|
||||
std::vector<double> m_centerFrequencies; ///< center frequency per segment in MHz
|
||||
ChannelWidthMhz m_channelWidth; ///< channel width in MHz
|
||||
Ptr<const SpectrumModel> m_rxSpectrumModel; ///< receive spectrum model
|
||||
|
||||
|
||||
@@ -43,7 +43,7 @@ namespace
|
||||
/**
|
||||
* Lambda to print a vector of frequencies.
|
||||
*/
|
||||
auto printFrequencies = [](const std::vector<uint16_t>& v) {
|
||||
auto printFrequencies = [](const std::vector<double>& v) {
|
||||
std::stringstream ss;
|
||||
for (const auto& centerFrequency : v)
|
||||
{
|
||||
@@ -61,10 +61,10 @@ NS_LOG_COMPONENT_DEFINE("WifiSpectrumValueHelper");
|
||||
///< Wifi Spectrum Model structure
|
||||
struct WifiSpectrumModelId
|
||||
{
|
||||
std::vector<uint16_t> centerFrequencies; ///< center frequency per segment (in MHz)
|
||||
ChannelWidthMhz channelWidth; ///< channel width
|
||||
uint32_t carrierSpacing; ///< carrier spacing (in Hz)
|
||||
ChannelWidthMhz guardBandwidth; ///< guard band width
|
||||
std::vector<double> centerFrequencies; ///< center frequency per segment (in MHz)
|
||||
ChannelWidthMhz channelWidth; ///< channel width
|
||||
double carrierSpacing; ///< carrier spacing (in Hz)
|
||||
ChannelWidthMhz guardBandwidth; ///< guard band width
|
||||
};
|
||||
|
||||
/**
|
||||
@@ -91,9 +91,9 @@ static std::map<WifiSpectrumModelId, Ptr<SpectrumModel>>
|
||||
g_wifiSpectrumModelMap; ///< static initializer for the class
|
||||
|
||||
Ptr<SpectrumModel>
|
||||
WifiSpectrumValueHelper::GetSpectrumModel(const std::vector<uint16_t>& centerFrequencies,
|
||||
WifiSpectrumValueHelper::GetSpectrumModel(const std::vector<double>& centerFrequencies,
|
||||
ChannelWidthMhz channelWidth,
|
||||
uint32_t carrierSpacing,
|
||||
double carrierSpacing,
|
||||
ChannelWidthMhz guardBandwidth)
|
||||
{
|
||||
NS_LOG_FUNCTION(printFrequencies(centerFrequencies)
|
||||
@@ -168,13 +168,13 @@ WifiSpectrumValueHelper::GetSpectrumModel(const std::vector<uint16_t>& centerFre
|
||||
|
||||
// Power allocated to 71 center subbands out of 135 total subbands in the band
|
||||
Ptr<SpectrumValue>
|
||||
WifiSpectrumValueHelper::CreateDsssTxPowerSpectralDensity(uint16_t centerFrequency,
|
||||
WifiSpectrumValueHelper::CreateDsssTxPowerSpectralDensity(double centerFrequency,
|
||||
double txPowerW,
|
||||
ChannelWidthMhz guardBandwidth)
|
||||
{
|
||||
NS_LOG_FUNCTION(centerFrequency << txPowerW << +guardBandwidth);
|
||||
ChannelWidthMhz channelWidth = 22; // DSSS channels are 22 MHz wide
|
||||
uint32_t carrierSpacing = 312500;
|
||||
double carrierSpacing = 312500; // Hz
|
||||
Ptr<SpectrumValue> c = Create<SpectrumValue>(
|
||||
GetSpectrumModel({centerFrequency}, channelWidth, carrierSpacing, guardBandwidth));
|
||||
auto vit = c->ValuesBegin();
|
||||
@@ -195,7 +195,7 @@ WifiSpectrumValueHelper::CreateDsssTxPowerSpectralDensity(uint16_t centerFrequen
|
||||
}
|
||||
|
||||
Ptr<SpectrumValue>
|
||||
WifiSpectrumValueHelper::CreateOfdmTxPowerSpectralDensity(uint16_t centerFrequency,
|
||||
WifiSpectrumValueHelper::CreateOfdmTxPowerSpectralDensity(double centerFrequency,
|
||||
ChannelWidthMhz channelWidth,
|
||||
double txPowerW,
|
||||
ChannelWidthMhz guardBandwidth,
|
||||
@@ -205,21 +205,21 @@ WifiSpectrumValueHelper::CreateOfdmTxPowerSpectralDensity(uint16_t centerFrequen
|
||||
{
|
||||
NS_LOG_FUNCTION(centerFrequency << channelWidth << txPowerW << guardBandwidth << minInnerBandDbr
|
||||
<< minOuterBandDbr << lowestPointDbr);
|
||||
uint32_t carrierSpacing = 0;
|
||||
double carrierSpacing = 0;
|
||||
uint32_t innerSlopeWidth = 0;
|
||||
switch (static_cast<uint16_t>(channelWidth))
|
||||
{
|
||||
case 20:
|
||||
carrierSpacing = 312500;
|
||||
carrierSpacing = 312500; // Hz
|
||||
innerSlopeWidth = static_cast<uint32_t>((2e6 / carrierSpacing) + 0.5); // [-11;-9] & [9;11]
|
||||
break;
|
||||
case 10:
|
||||
carrierSpacing = 156250;
|
||||
carrierSpacing = 156250; // Hz
|
||||
innerSlopeWidth =
|
||||
static_cast<uint32_t>((1e6 / carrierSpacing) + 0.5); // [-5.5;-4.5] & [4.5;5.5]
|
||||
break;
|
||||
case 5:
|
||||
carrierSpacing = 78125;
|
||||
carrierSpacing = 78125; // Hz
|
||||
innerSlopeWidth =
|
||||
static_cast<uint32_t>((5e5 / carrierSpacing) + 0.5); // [-2.75;-2.5] & [2.5;2.75]
|
||||
break;
|
||||
@@ -267,7 +267,7 @@ WifiSpectrumValueHelper::CreateOfdmTxPowerSpectralDensity(uint16_t centerFrequen
|
||||
|
||||
Ptr<SpectrumValue>
|
||||
WifiSpectrumValueHelper::CreateDuplicated20MhzTxPowerSpectralDensity(
|
||||
const std::vector<uint16_t>& centerFrequencies,
|
||||
const std::vector<double>& centerFrequencies,
|
||||
ChannelWidthMhz channelWidth,
|
||||
double txPowerW,
|
||||
ChannelWidthMhz guardBandwidth,
|
||||
@@ -283,7 +283,7 @@ WifiSpectrumValueHelper::CreateDuplicated20MhzTxPowerSpectralDensity(
|
||||
NS_LOG_FUNCTION(printFrequencies(centerFrequencies)
|
||||
<< channelWidth << txPowerW << guardBandwidth << minInnerBandDbr
|
||||
<< minOuterBandDbr << lowestPointDbr);
|
||||
uint32_t carrierSpacing = 312500;
|
||||
double carrierSpacing = 312500; // Hz
|
||||
Ptr<SpectrumValue> c = Create<SpectrumValue>(
|
||||
GetSpectrumModel(centerFrequencies, channelWidth, carrierSpacing, guardBandwidth));
|
||||
// assume all frequency segments have the same width, hence split the guard bandwidth
|
||||
@@ -372,7 +372,7 @@ WifiSpectrumValueHelper::CreateDuplicated20MhzTxPowerSpectralDensity(
|
||||
|
||||
Ptr<SpectrumValue>
|
||||
WifiSpectrumValueHelper::CreateHtOfdmTxPowerSpectralDensity(
|
||||
const std::vector<uint16_t>& centerFrequencies,
|
||||
const std::vector<double>& centerFrequencies,
|
||||
ChannelWidthMhz channelWidth,
|
||||
double txPowerW,
|
||||
ChannelWidthMhz guardBandwidth,
|
||||
@@ -387,7 +387,7 @@ WifiSpectrumValueHelper::CreateHtOfdmTxPowerSpectralDensity(
|
||||
NS_LOG_FUNCTION(printFrequencies(centerFrequencies)
|
||||
<< channelWidth << txPowerW << guardBandwidth << minInnerBandDbr
|
||||
<< minOuterBandDbr << lowestPointDbr);
|
||||
uint32_t carrierSpacing = 312500;
|
||||
double carrierSpacing = 312500; // Hz
|
||||
Ptr<SpectrumValue> c = Create<SpectrumValue>(
|
||||
GetSpectrumModel(centerFrequencies, channelWidth, carrierSpacing, guardBandwidth));
|
||||
// assume all frequency segments have the same width, hence split the guard bandwidth
|
||||
@@ -461,7 +461,7 @@ WifiSpectrumValueHelper::CreateHtOfdmTxPowerSpectralDensity(
|
||||
|
||||
Ptr<SpectrumValue>
|
||||
WifiSpectrumValueHelper::CreateHeOfdmTxPowerSpectralDensity(
|
||||
uint16_t centerFrequency,
|
||||
double centerFrequency,
|
||||
ChannelWidthMhz channelWidth,
|
||||
double txPowerW,
|
||||
ChannelWidthMhz guardBandwidth,
|
||||
@@ -470,7 +470,7 @@ WifiSpectrumValueHelper::CreateHeOfdmTxPowerSpectralDensity(
|
||||
double lowestPointDbr,
|
||||
const std::vector<bool>& puncturedSubchannels)
|
||||
{
|
||||
return CreateHeOfdmTxPowerSpectralDensity(std::vector<uint16_t>{centerFrequency},
|
||||
return CreateHeOfdmTxPowerSpectralDensity(std::vector<double>{centerFrequency},
|
||||
channelWidth,
|
||||
txPowerW,
|
||||
guardBandwidth,
|
||||
@@ -482,7 +482,7 @@ WifiSpectrumValueHelper::CreateHeOfdmTxPowerSpectralDensity(
|
||||
|
||||
Ptr<SpectrumValue>
|
||||
WifiSpectrumValueHelper::CreateHeOfdmTxPowerSpectralDensity(
|
||||
const std::vector<uint16_t>& centerFrequencies,
|
||||
const std::vector<double>& centerFrequencies,
|
||||
ChannelWidthMhz channelWidth,
|
||||
double txPowerW,
|
||||
ChannelWidthMhz guardBandwidth,
|
||||
@@ -497,7 +497,7 @@ WifiSpectrumValueHelper::CreateHeOfdmTxPowerSpectralDensity(
|
||||
NS_LOG_FUNCTION(printFrequencies(centerFrequencies)
|
||||
<< channelWidth << txPowerW << guardBandwidth << minInnerBandDbr
|
||||
<< minOuterBandDbr << lowestPointDbr);
|
||||
uint32_t carrierSpacing = 78125;
|
||||
double carrierSpacing = 78125; // Hz
|
||||
Ptr<SpectrumValue> c = Create<SpectrumValue>(
|
||||
GetSpectrumModel(centerFrequencies, channelWidth, carrierSpacing, guardBandwidth));
|
||||
// assume all frequency segments have the same width, hence split the guard bandwidth
|
||||
@@ -651,7 +651,7 @@ WifiSpectrumValueHelper::CreateHeOfdmTxPowerSpectralDensity(
|
||||
|
||||
Ptr<SpectrumValue>
|
||||
WifiSpectrumValueHelper::CreateHeMuOfdmTxPowerSpectralDensity(
|
||||
const std::vector<uint16_t>& centerFrequencies,
|
||||
const std::vector<double>& centerFrequencies,
|
||||
ChannelWidthMhz channelWidth,
|
||||
double txPowerW,
|
||||
ChannelWidthMhz guardBandwidth,
|
||||
@@ -667,7 +667,7 @@ WifiSpectrumValueHelper::CreateHeMuOfdmTxPowerSpectralDensity(
|
||||
};
|
||||
NS_LOG_FUNCTION(printFrequencies(centerFrequencies)
|
||||
<< channelWidth << txPowerW << guardBandwidth << printRuIndices(ru));
|
||||
uint32_t carrierSpacing = 78125;
|
||||
double carrierSpacing = 78125; // Hz
|
||||
Ptr<SpectrumValue> c = Create<SpectrumValue>(
|
||||
GetSpectrumModel(centerFrequencies, channelWidth, carrierSpacing, guardBandwidth));
|
||||
|
||||
|
||||
@@ -64,9 +64,9 @@ class WifiSpectrumValueHelper
|
||||
* \return the static SpectrumModel instance corresponding to the
|
||||
* given carrier frequency and channel width configuration.
|
||||
*/
|
||||
static Ptr<SpectrumModel> GetSpectrumModel(const std::vector<uint16_t>& centerFrequencies,
|
||||
static Ptr<SpectrumModel> GetSpectrumModel(const std::vector<double>& centerFrequencies,
|
||||
ChannelWidthMhz channelWidth,
|
||||
uint32_t carrierSpacing,
|
||||
double carrierSpacing,
|
||||
ChannelWidthMhz guardBandwidth);
|
||||
|
||||
/**
|
||||
@@ -83,7 +83,7 @@ class WifiSpectrumValueHelper
|
||||
* \returns a pointer to a newly allocated SpectrumValue representing the DSSS Transmit Power
|
||||
* Spectral Density in W/Hz
|
||||
*/
|
||||
static Ptr<SpectrumValue> CreateDsssTxPowerSpectralDensity(uint16_t centerFrequency,
|
||||
static Ptr<SpectrumValue> CreateDsssTxPowerSpectralDensity(double centerFrequency,
|
||||
double txPowerW,
|
||||
ChannelWidthMhz guardBandwidth);
|
||||
|
||||
@@ -103,7 +103,7 @@ class WifiSpectrumValueHelper
|
||||
* \return a pointer to a newly allocated SpectrumValue representing the OFDM Transmit Power
|
||||
* Spectral Density in W/Hz for each Band
|
||||
*/
|
||||
static Ptr<SpectrumValue> CreateOfdmTxPowerSpectralDensity(uint16_t centerFrequency,
|
||||
static Ptr<SpectrumValue> CreateOfdmTxPowerSpectralDensity(double centerFrequency,
|
||||
ChannelWidthMhz channelWidth,
|
||||
double txPowerW,
|
||||
ChannelWidthMhz guardBandwidth,
|
||||
@@ -128,7 +128,7 @@ class WifiSpectrumValueHelper
|
||||
* Transmit Power Spectral Density in W/Hz for each Band
|
||||
*/
|
||||
static Ptr<SpectrumValue> CreateDuplicated20MhzTxPowerSpectralDensity(
|
||||
const std::vector<uint16_t>& centerFrequencies,
|
||||
const std::vector<double>& centerFrequencies,
|
||||
ChannelWidthMhz channelWidth,
|
||||
double txPowerW,
|
||||
ChannelWidthMhz guardBandwidth,
|
||||
@@ -154,7 +154,7 @@ class WifiSpectrumValueHelper
|
||||
* Spectral Density in W/Hz for each Band
|
||||
*/
|
||||
static Ptr<SpectrumValue> CreateHtOfdmTxPowerSpectralDensity(
|
||||
const std::vector<uint16_t>& centerFrequencies,
|
||||
const std::vector<double>& centerFrequencies,
|
||||
ChannelWidthMhz channelWidth,
|
||||
double txPowerW,
|
||||
ChannelWidthMhz guardBandwidth,
|
||||
@@ -180,7 +180,7 @@ class WifiSpectrumValueHelper
|
||||
* Spectral Density in W/Hz for each Band
|
||||
*/
|
||||
static Ptr<SpectrumValue> CreateHeOfdmTxPowerSpectralDensity(
|
||||
uint16_t centerFrequency,
|
||||
double centerFrequency,
|
||||
ChannelWidthMhz channelWidth,
|
||||
double txPowerW,
|
||||
ChannelWidthMhz guardBandwidth,
|
||||
@@ -207,7 +207,7 @@ class WifiSpectrumValueHelper
|
||||
* Spectral Density in W/Hz for each Band
|
||||
*/
|
||||
static Ptr<SpectrumValue> CreateHeOfdmTxPowerSpectralDensity(
|
||||
const std::vector<uint16_t>& centerFrequencies,
|
||||
const std::vector<double>& centerFrequencies,
|
||||
ChannelWidthMhz channelWidth,
|
||||
double txPowerW,
|
||||
ChannelWidthMhz guardBandwidth,
|
||||
@@ -230,7 +230,7 @@ class WifiSpectrumValueHelper
|
||||
* Spectral Density on the RU used by the STA in W/Hz for each Band
|
||||
*/
|
||||
static Ptr<SpectrumValue> CreateHeMuOfdmTxPowerSpectralDensity(
|
||||
const std::vector<uint16_t>& centerFrequencies,
|
||||
const std::vector<double>& centerFrequencies,
|
||||
ChannelWidthMhz channelWidth,
|
||||
double txPowerW,
|
||||
ChannelWidthMhz guardBandwidth,
|
||||
@@ -322,8 +322,8 @@ class WifiSpectrumValueHelper
|
||||
*/
|
||||
struct FrequencyRange
|
||||
{
|
||||
uint16_t minFrequency{0}; ///< the minimum frequency in MHz
|
||||
uint16_t maxFrequency{0}; ///< the maximum frequency in MHz
|
||||
double minFrequency{0}; ///< the minimum frequency in MHz
|
||||
double maxFrequency{0}; ///< the maximum frequency in MHz
|
||||
};
|
||||
|
||||
/**
|
||||
|
||||
@@ -672,7 +672,7 @@ SpectrumWifiPhyFilterTest::DoTeardown()
|
||||
void
|
||||
SpectrumWifiPhyFilterTest::RunOne()
|
||||
{
|
||||
uint16_t txFrequency;
|
||||
double txFrequency;
|
||||
switch (static_cast<uint16_t>(m_txChannelWidth))
|
||||
{
|
||||
case 20:
|
||||
@@ -698,7 +698,7 @@ SpectrumWifiPhyFilterTest::RunOne()
|
||||
m_txPhy->SetOperatingChannel(
|
||||
WifiPhy::ChannelTuple{txChannelNum, m_txChannelWidth, WIFI_PHY_BAND_5GHZ, 0});
|
||||
|
||||
uint16_t rxFrequency;
|
||||
double rxFrequency;
|
||||
switch (static_cast<uint16_t>(m_rxChannelWidth))
|
||||
{
|
||||
case 20:
|
||||
@@ -941,8 +941,8 @@ SpectrumWifiPhyGetBandTest::DoRun()
|
||||
expectedStartIndice + (indicesPer20MhzBand * (bandWidth / 20)) - 1;
|
||||
std::vector<WifiSpectrumBandIndices> expectedIndices{
|
||||
{expectedStartIndice, expectedStopIndice}};
|
||||
const uint64_t expectedStartFrequency = 5170 * 1e6;
|
||||
const uint64_t expectedStopFrequency = (5170 + bandWidth) * 1e6;
|
||||
const double expectedStartFrequency = 5170 * 1e6;
|
||||
const double expectedStopFrequency = (5170 + bandWidth) * 1e6;
|
||||
std::vector<WifiSpectrumBandFrequencies> expectedFrequencies{
|
||||
{expectedStartFrequency, expectedStopFrequency}};
|
||||
const std::size_t numBands = (channelWidth / bandWidth);
|
||||
@@ -1262,7 +1262,7 @@ class SpectrumWifiPhy80Plus80Test : public TestCase
|
||||
* \param expectSuccess flag to indicate whether reception is expected to be successful
|
||||
*/
|
||||
void RunOne(const std::vector<uint8_t>& channelNumbers,
|
||||
uint16_t interferenceCenterFrequency,
|
||||
double interferenceCenterFrequency,
|
||||
ChannelWidthMhz interferenceBandWidth,
|
||||
bool expectSuccess);
|
||||
|
||||
@@ -1485,7 +1485,7 @@ SpectrumWifiPhy80Plus80Test::DoTeardown()
|
||||
|
||||
void
|
||||
SpectrumWifiPhy80Plus80Test::RunOne(const std::vector<uint8_t>& channelNumbers,
|
||||
uint16_t interferenceCenterFrequency,
|
||||
double interferenceCenterFrequency,
|
||||
ChannelWidthMhz interferenceBandWidth,
|
||||
bool expectSuccess)
|
||||
{
|
||||
|
||||
@@ -52,7 +52,7 @@ using namespace ns3;
|
||||
|
||||
NS_LOG_COMPONENT_DEFINE("WifiNonHtDuplicateTest");
|
||||
|
||||
constexpr uint32_t DEFAULT_FREQUENCY = 5180; // MHz
|
||||
constexpr double DEFAULT_FREQUENCY = 5180; // MHz
|
||||
|
||||
/**
|
||||
* HE PHY used for testing MU-RTS/CTS.
|
||||
@@ -205,7 +205,7 @@ class TestNonHtDuplicatePhyReception : public TestCase
|
||||
{
|
||||
public:
|
||||
/// A vector containing parameters per STA: the standard, the center frequency and the P20 index
|
||||
using StasParams = std::vector<std::tuple<WifiStandard, uint16_t, uint8_t>>;
|
||||
using StasParams = std::vector<std::tuple<WifiStandard, double, uint8_t>>;
|
||||
|
||||
/**
|
||||
* Constructor
|
||||
@@ -218,7 +218,7 @@ class TestNonHtDuplicatePhyReception : public TestCase
|
||||
* interference.
|
||||
*/
|
||||
TestNonHtDuplicatePhyReception(WifiStandard apStandard,
|
||||
uint16_t apFrequency,
|
||||
double apFrequency,
|
||||
uint8_t apP20Index,
|
||||
StasParams stasParams,
|
||||
std::vector<bool> per20MhzInterference = {});
|
||||
@@ -284,7 +284,7 @@ class TestNonHtDuplicatePhyReception : public TestCase
|
||||
void StopInterference(Ptr<WaveformGenerator> interferer);
|
||||
|
||||
WifiStandard m_apStandard; ///< the standard to use for the AP
|
||||
uint16_t m_apFrequency; ///< the center frequency of the AP (in MHz)
|
||||
double m_apFrequency; ///< the center frequency of the AP (in MHz)
|
||||
uint8_t m_apP20Index; ///< the index of the primary 20 MHz channel of the AP
|
||||
StasParams m_stasParams; ///< the parameters of the STAs
|
||||
std::vector<bool>
|
||||
@@ -303,7 +303,7 @@ class TestNonHtDuplicatePhyReception : public TestCase
|
||||
|
||||
TestNonHtDuplicatePhyReception::TestNonHtDuplicatePhyReception(
|
||||
WifiStandard apStandard,
|
||||
uint16_t apFrequency,
|
||||
double apFrequency,
|
||||
uint8_t apP20Index,
|
||||
StasParams stasParams,
|
||||
std::vector<bool> per20MhzInterference)
|
||||
|
||||
@@ -50,13 +50,13 @@ using namespace ns3;
|
||||
|
||||
NS_LOG_COMPONENT_DEFINE("WifiPhyCcaTest");
|
||||
|
||||
constexpr uint32_t P20_CENTER_FREQUENCY = 5180; // MHz
|
||||
constexpr uint32_t S20_CENTER_FREQUENCY = P20_CENTER_FREQUENCY + 20;
|
||||
constexpr uint32_t P40_CENTER_FREQUENCY = P20_CENTER_FREQUENCY + 10;
|
||||
constexpr uint32_t S40_CENTER_FREQUENCY = P40_CENTER_FREQUENCY + 40;
|
||||
constexpr uint32_t P80_CENTER_FREQUENCY = P40_CENTER_FREQUENCY + 20;
|
||||
constexpr uint32_t S80_CENTER_FREQUENCY = P80_CENTER_FREQUENCY + 80;
|
||||
constexpr uint32_t P160_CENTER_FREQUENCY = P80_CENTER_FREQUENCY + 40;
|
||||
constexpr double P20_CENTER_FREQUENCY = 5180; // MHz
|
||||
constexpr double S20_CENTER_FREQUENCY = P20_CENTER_FREQUENCY + 20;
|
||||
constexpr double P40_CENTER_FREQUENCY = P20_CENTER_FREQUENCY + 10;
|
||||
constexpr double S40_CENTER_FREQUENCY = P40_CENTER_FREQUENCY + 40;
|
||||
constexpr double P80_CENTER_FREQUENCY = P40_CENTER_FREQUENCY + 20;
|
||||
constexpr double S80_CENTER_FREQUENCY = P80_CENTER_FREQUENCY + 80;
|
||||
constexpr double P160_CENTER_FREQUENCY = P80_CENTER_FREQUENCY + 40;
|
||||
const Time smallDelta = NanoSeconds(1);
|
||||
// add small delta to be right after aCCATime, since test checks are scheduled before wifi events
|
||||
const Time aCcaTime = MicroSeconds(4) + smallDelta;
|
||||
@@ -695,7 +695,7 @@ class WifiPhyCcaIndicationTest : public TestCase
|
||||
* \param frequency the center frequency the transmitter is operating on
|
||||
* \param bandwidth the bandwidth to use for the transmission in MHz
|
||||
*/
|
||||
void SendHeSuPpdu(double txPowerDbm, uint16_t frequency, ChannelWidthMhz bandwidth);
|
||||
void SendHeSuPpdu(double txPowerDbm, double frequency, ChannelWidthMhz bandwidth);
|
||||
|
||||
/**
|
||||
* Start to generate a signal
|
||||
@@ -707,7 +707,7 @@ class WifiPhyCcaIndicationTest : public TestCase
|
||||
*/
|
||||
void StartSignal(Ptr<WaveformGenerator> signalGenerator,
|
||||
double txPowerDbm,
|
||||
uint16_t frequency,
|
||||
double frequency,
|
||||
ChannelWidthMhz bandwidth,
|
||||
Time duration);
|
||||
/**
|
||||
@@ -749,7 +749,7 @@ class WifiPhyCcaIndicationTest : public TestCase
|
||||
double power{0.0}; //!< transmit power to use in dBm
|
||||
Time startTime{Seconds(0)}; //!< time at which transmission will be started
|
||||
Time duration{Seconds(0)}; //!< the duration of the transmission
|
||||
uint16_t centerFreq{0}; //!< center frequency to use in MHz
|
||||
double centerFreq{0}; //!< center frequency to use in MHz
|
||||
ChannelWidthMhz bandwidth{0}; //!< bandwidth to use
|
||||
};
|
||||
|
||||
@@ -760,7 +760,7 @@ class WifiPhyCcaIndicationTest : public TestCase
|
||||
{
|
||||
double power{0.0}; //!< transmit power to use in dBm
|
||||
Time startTime{Seconds(0)}; //!< time at which transmission will be started
|
||||
uint16_t centerFreq{0}; //!< center frequency to use in MHz
|
||||
double centerFreq{0}; //!< center frequency to use in MHz
|
||||
ChannelWidthMhz bandwidth{0}; //!< bandwidth to use
|
||||
};
|
||||
|
||||
@@ -819,7 +819,7 @@ class WifiPhyCcaIndicationTest : public TestCase
|
||||
std::shared_ptr<CcaTestPhyListener>
|
||||
m_rxPhyStateListener; ///< Listener for PHY state transitions
|
||||
|
||||
uint16_t m_frequency; ///< Operating frequency in MHz
|
||||
double m_frequency; ///< Operating frequency in MHz
|
||||
ChannelWidthMhz m_channelWidth; ///< Operating channel width
|
||||
};
|
||||
|
||||
@@ -834,7 +834,7 @@ WifiPhyCcaIndicationTest::WifiPhyCcaIndicationTest()
|
||||
void
|
||||
WifiPhyCcaIndicationTest::StartSignal(Ptr<WaveformGenerator> signalGenerator,
|
||||
double txPowerDbm,
|
||||
uint16_t frequency,
|
||||
double frequency,
|
||||
ChannelWidthMhz bandwidth,
|
||||
Time duration)
|
||||
{
|
||||
@@ -866,7 +866,7 @@ WifiPhyCcaIndicationTest::StopSignal(Ptr<WaveformGenerator> signalGenerator)
|
||||
|
||||
void
|
||||
WifiPhyCcaIndicationTest::SendHeSuPpdu(double txPowerDbm,
|
||||
uint16_t frequency,
|
||||
double frequency,
|
||||
ChannelWidthMhz bandwidth)
|
||||
{
|
||||
NS_LOG_FUNCTION(this << txPowerDbm);
|
||||
|
||||
@@ -49,7 +49,7 @@ using namespace ns3;
|
||||
|
||||
NS_LOG_COMPONENT_DEFINE("WifiPhyMuMimoTest");
|
||||
|
||||
constexpr uint32_t DEFAULT_FREQUENCY = 5180; // MHz
|
||||
constexpr double DEFAULT_FREQUENCY = 5180; // MHz
|
||||
constexpr ChannelWidthMhz DEFAULT_CHANNEL_WIDTH = 20;
|
||||
|
||||
/**
|
||||
@@ -495,7 +495,7 @@ class TestDlMuMimoPhyTransmission : public TestCase
|
||||
Ptr<MuMimoSpectrumWifiPhy> m_phySta3; ///< PHY of STA 3
|
||||
|
||||
uint8_t m_nss; ///< number of spatial streams per STA
|
||||
uint16_t m_frequency; ///< frequency in MHz
|
||||
double m_frequency; ///< frequency in MHz
|
||||
ChannelWidthMhz m_channelWidth; ///< channel width
|
||||
Time m_expectedPpduDuration; ///< expected duration to send MU PPDU
|
||||
};
|
||||
@@ -1266,7 +1266,7 @@ class TestUlMuMimoPhyTransmission : public TestCase
|
||||
std::vector<uint32_t> m_countRxBytesFromStas; ///< count RX bytes from STAs
|
||||
|
||||
Time m_delayStart; ///< delay between the start of each HE TB PPDUs
|
||||
uint16_t m_frequency; ///< frequency in MHz
|
||||
double m_frequency; ///< frequency in MHz
|
||||
ChannelWidthMhz m_channelWidth; ///< channel width
|
||||
Time m_expectedPpduDuration; ///< expected duration to send MU PPDU
|
||||
};
|
||||
|
||||
@@ -61,7 +61,7 @@ using namespace ns3;
|
||||
NS_LOG_COMPONENT_DEFINE("WifiPhyOfdmaTest");
|
||||
|
||||
static const uint8_t DEFAULT_CHANNEL_NUMBER = 36;
|
||||
static const uint32_t DEFAULT_FREQUENCY = 5180; // MHz
|
||||
static const double DEFAULT_FREQUENCY = 5180; // MHz
|
||||
static const WifiPhyBand DEFAULT_WIFI_BAND = WIFI_PHY_BAND_5GHZ;
|
||||
static const ChannelWidthMhz DEFAULT_CHANNEL_WIDTH = 20;
|
||||
static const ChannelWidthMhz DEFAULT_GUARD_WIDTH =
|
||||
@@ -3200,7 +3200,7 @@ class TestUlOfdmaPhyTransmission : public TestCase
|
||||
uint32_t m_countRxBytesFromSta1; ///< count RX bytes from STA 1
|
||||
uint32_t m_countRxBytesFromSta2; ///< count RX bytes from STA 2
|
||||
|
||||
uint16_t m_frequency; ///< frequency in MHz
|
||||
double m_frequency; ///< frequency in MHz
|
||||
ChannelWidthMhz m_channelWidth; ///< channel width in MHz
|
||||
Time m_expectedPpduDuration; ///< expected duration to send MU PPDU
|
||||
};
|
||||
|
||||
@@ -59,7 +59,7 @@ using namespace ns3;
|
||||
NS_LOG_COMPONENT_DEFINE("WifiPhyReceptionTest");
|
||||
|
||||
static const uint8_t CHANNEL_NUMBER = 36;
|
||||
static const uint32_t FREQUENCY = 5180; // MHz
|
||||
static const double FREQUENCY = 5180; // MHz
|
||||
static const ChannelWidthMhz CHANNEL_WIDTH = 20;
|
||||
static const ChannelWidthMhz GUARD_WIDTH =
|
||||
CHANNEL_WIDTH; // expanded to channel width to model spectrum mask
|
||||
@@ -4228,7 +4228,7 @@ class TestUnsupportedBandwidthReception : public TestCase
|
||||
* \param centerFreqMhz the center frequency used for the transmission of the PPDU (in MHz)
|
||||
* \param bandwidthMhz the bandwidth used for the transmission of the PPDU (in MHz)
|
||||
*/
|
||||
void SendPpdu(uint16_t centerFreqMhz, ChannelWidthMhz bandwidthMhz);
|
||||
void SendPpdu(double centerFreqMhz, ChannelWidthMhz bandwidthMhz);
|
||||
|
||||
/**
|
||||
* Function called upon a PSDU received successfully
|
||||
@@ -4298,7 +4298,7 @@ TestUnsupportedBandwidthReception::TestUnsupportedBandwidthReception()
|
||||
}
|
||||
|
||||
void
|
||||
TestUnsupportedBandwidthReception::SendPpdu(uint16_t centerFreqMhz, ChannelWidthMhz bandwidthMhz)
|
||||
TestUnsupportedBandwidthReception::SendPpdu(double centerFreqMhz, ChannelWidthMhz bandwidthMhz)
|
||||
{
|
||||
auto txVector =
|
||||
WifiTxVector(HePhy::GetHeMcs0(), 0, WIFI_PREAMBLE_HE_SU, 800, 1, 1, 0, bandwidthMhz, false);
|
||||
@@ -4509,7 +4509,7 @@ class TestPrimary20CoveredByPpdu : public TestCase
|
||||
* \param ppduCenterFreqMhz the center frequency used for the transmission of the PPDU (in MHz)
|
||||
* \return the created PPDU
|
||||
*/
|
||||
Ptr<HePpdu> CreatePpdu(uint16_t ppduCenterFreqMhz);
|
||||
Ptr<HePpdu> CreatePpdu(double ppduCenterFreqMhz);
|
||||
|
||||
/**
|
||||
* Run one function
|
||||
@@ -4524,9 +4524,9 @@ class TestPrimary20CoveredByPpdu : public TestCase
|
||||
* primary 20 MHz channel is expected to overlap with the bandwidth of the incoming PPDU
|
||||
*/
|
||||
void RunOne(WifiPhyBand band,
|
||||
uint16_t phyCenterFreqMhz,
|
||||
double phyCenterFreqMhz,
|
||||
uint8_t p20Index,
|
||||
uint16_t ppduCenterFreqMhz,
|
||||
double ppduCenterFreqMhz,
|
||||
bool expectedP20Overlap,
|
||||
bool expectedP20Covered);
|
||||
|
||||
@@ -4541,7 +4541,7 @@ TestPrimary20CoveredByPpdu::TestPrimary20CoveredByPpdu()
|
||||
}
|
||||
|
||||
Ptr<HePpdu>
|
||||
TestPrimary20CoveredByPpdu::CreatePpdu(uint16_t ppduCenterFreqMhz)
|
||||
TestPrimary20CoveredByPpdu::CreatePpdu(double ppduCenterFreqMhz)
|
||||
{
|
||||
const auto& channelInfo = (*WifiPhyOperatingChannel::FindFirst(0,
|
||||
ppduCenterFreqMhz,
|
||||
@@ -4600,9 +4600,9 @@ TestPrimary20CoveredByPpdu::DoTeardown()
|
||||
|
||||
void
|
||||
TestPrimary20CoveredByPpdu::RunOne(WifiPhyBand band,
|
||||
uint16_t phyCenterFreqMhz,
|
||||
double phyCenterFreqMhz,
|
||||
uint8_t p20Index,
|
||||
uint16_t ppduCenterFreqMhz,
|
||||
double ppduCenterFreqMhz,
|
||||
bool expectedP20Overlap,
|
||||
bool expectedP20Covered)
|
||||
{
|
||||
|
||||
@@ -40,7 +40,7 @@ using namespace ns3;
|
||||
NS_LOG_COMPONENT_DEFINE("WifiPhyThresholdsTest");
|
||||
|
||||
static const uint8_t CHANNEL_NUMBER = 36;
|
||||
static const uint32_t FREQUENCY = 5180; // MHz
|
||||
static const double FREQUENCY = 5180; // MHz
|
||||
static const ChannelWidthMhz CHANNEL_WIDTH = 20;
|
||||
|
||||
/**
|
||||
|
||||
@@ -71,7 +71,7 @@ class WifiOfdmMaskSlopesTestCase : public TestCase
|
||||
WifiStandard standard,
|
||||
WifiPhyBand band,
|
||||
ChannelWidthMhz channelWidth,
|
||||
const std::vector<uint16_t>& centerFrequencies,
|
||||
const std::vector<double>& centerFrequencies,
|
||||
const IndexPowerVect& maskRefs,
|
||||
double tolerance,
|
||||
std::size_t precision,
|
||||
@@ -98,7 +98,7 @@ class WifiOfdmMaskSlopesTestCase : public TestCase
|
||||
WifiStandard m_standard; ///< the wifi standard to test
|
||||
WifiPhyBand m_band; ///< the wifi PHY band to test
|
||||
ChannelWidthMhz m_channelWidth; ///< the total channel width (MHz) to test
|
||||
std::vector<uint16_t>
|
||||
std::vector<double>
|
||||
m_centerFreqs; ///< the center frequency (MHz) per contiguous segment to test
|
||||
std::vector<bool>
|
||||
m_puncturedSubchannels; ///< bitmap indicating whether a 20 MHz subchannel is punctured or
|
||||
@@ -114,7 +114,7 @@ WifiOfdmMaskSlopesTestCase::WifiOfdmMaskSlopesTestCase(
|
||||
WifiStandard standard,
|
||||
WifiPhyBand band,
|
||||
ChannelWidthMhz channelWidth,
|
||||
const std::vector<uint16_t>& centerFrequencies,
|
||||
const std::vector<double>& centerFrequencies,
|
||||
const IndexPowerVect& maskRefs,
|
||||
double tolerance,
|
||||
std::size_t precision,
|
||||
|
||||
Reference in New Issue
Block a user