wifi: Add support for non-HT duplicate

This commit is contained in:
Sébastien Deronne
2022-11-13 18:04:14 +01:00
parent b74e4b7123
commit 40a6be3407
4 changed files with 39 additions and 11 deletions

View File

@@ -369,14 +369,29 @@ OfdmPhy::GetTxPowerSpectralDensity(double txPowerW, Ptr<const WifiPpdu> ppdu) co
uint16_t channelWidth = txVector.GetChannelWidth();
NS_LOG_FUNCTION(this << centerFrequency << channelWidth << txPowerW);
const auto& txMaskRejectionParams = GetTxMaskRejectionParams();
Ptr<SpectrumValue> v = WifiSpectrumValueHelper::CreateOfdmTxPowerSpectralDensity(
centerFrequency,
channelWidth,
txPowerW,
GetGuardBandwidth(channelWidth),
std::get<0>(txMaskRejectionParams),
std::get<1>(txMaskRejectionParams),
std::get<2>(txMaskRejectionParams));
Ptr<SpectrumValue> v;
if (txVector.IsNonHtDuplicate())
{
v = WifiSpectrumValueHelper::CreateDuplicated20MhzTxPowerSpectralDensity(
centerFrequency,
channelWidth,
txPowerW,
GetGuardBandwidth(channelWidth),
std::get<0>(txMaskRejectionParams),
std::get<1>(txMaskRejectionParams),
std::get<2>(txMaskRejectionParams));
}
else
{
v = WifiSpectrumValueHelper::CreateOfdmTxPowerSpectralDensity(
centerFrequency,
channelWidth,
txPowerW,
GetGuardBandwidth(channelWidth),
std::get<0>(txMaskRejectionParams),
std::get<1>(txMaskRejectionParams),
std::get<2>(txMaskRejectionParams));
}
return v;
}

View File

@@ -40,7 +40,7 @@ OfdmPpdu::OfdmPpdu(Ptr<const WifiPsdu> psdu,
bool instantiateLSig /* = true */)
: WifiPpdu(psdu, txVector, txCenterFreq, uid),
m_band(band),
m_channelWidth(txVector.GetChannelWidth())
m_channelWidth(txVector.IsNonHtDuplicate() ? 20 : txVector.GetChannelWidth())
{
NS_LOG_FUNCTION(this << psdu << txVector << txCenterFreq << band << uid);
if (instantiateLSig)

View File

@@ -253,6 +253,13 @@ WifiTxVector::IsLdpc() const
return m_ldpc;
}
bool
WifiTxVector::IsNonHtDuplicate() const
{
return ((m_channelWidth >= 40) && !IsMu() &&
(GetMode().GetModulationClass() < WIFI_MOD_CLASS_HT));
}
void
WifiTxVector::SetMode(WifiMode mode)
{

View File

@@ -269,13 +269,13 @@ class WifiTxVector
/**
* Checks whether the PSDU contains A-MPDU.
* \returns true if this PSDU has A-MPDU aggregation,
* false otherwise.
* false otherwise
*/
bool IsAggregation() const;
/**
* Sets if PSDU contains A-MPDU.
*
* \param aggregation whether the PSDU contains A-MPDU or not.
* \param aggregation whether the PSDU contains A-MPDU or not
*/
void SetAggregation(bool aggregation);
/**
@@ -304,6 +304,12 @@ class WifiTxVector
* \param ldpc enable or disable LDPC
*/
void SetLdpc(bool ldpc);
/**
* Checks whether this TXVECTOR corresponds to a non-HT duplicate.
* \returns true if this TXVECTOR corresponds to a non-HT duplicate,
* false otherwise.
*/
bool IsNonHtDuplicate() const;
/**
* Set the BSS color
* \param color the BSS color