|
A Discrete-Event Network Simulator
|
API
|
Go to the documentation of this file.
21 #ifndef INTERFERENCE_HELPER_H
22 #define INTERFERENCE_HELPER_H
222 uint16_t staId, std::pair<Time, Time> relativeMpduStartStop) const;
233 double
CalculateSnr (Ptr<Event> event, uint16_t channelWidth, uint8_t nss, WifiSpectrumBand band) const;
246 WifiPpduField header) const;
269 void
UpdateEvent (Ptr<Event> event, const RxPowerWattPerChannelBand& rxPower);
283 double
CalculateSnr (double signal, double noiseInterference, uint16_t channelWidth, uint8_t nss) const;
296 double
CalculateChunkSuccessRate (double snir, Time duration, WifiMode mode, const WifiTxVector& txVector, WifiPpduField field) const;
330 double GetPower (
void)
const;
336 void AddPower (
double power);
393 uint16_t staId, std::pair<Time, Time>
window)
const;
void NotifyRxStart()
Notify that RX has started.
std::map< WifiSpectrumBand, double > m_firstPowerPerBand
first power of each band in watts
double m_noiseFigure
noise figure (linear)
double CalculateNoiseInterferenceW(Ptr< Event > event, NiChangesPerBand *nis, WifiSpectrumBand band) const
Calculate noise and interference power in W.
Noise and Interference (thus Ni) event.
std::pair< uint32_t, uint32_t > WifiSpectrumBand
typedef for a pair of start and stop sub-band indexes
Every class exported by the ns3 library is enclosed in the ns3 namespace.
double GetRxPowerW(void) const
Return the total received power (W).
WifiTxVector m_txVector
TXVECTOR.
Time GetEnergyDuration(double energyW, WifiSpectrumBand band)
double CalculatePhyHeaderPer(Ptr< const Event > event, NiChangesPerBand *nis, uint16_t channelWidth, WifiSpectrumBand band, WifiPpduField header) const
Calculate the error rate of the PHY header.
Ptr< ErrorRateModel > GetErrorRateModel(void) const
Return the error rate model.
void SetErrorRateModel(const Ptr< ErrorRateModel > rate)
Set the error rate model for this interference helper.
double CalculatePhyHeaderSectionPsr(Ptr< const Event > event, NiChangesPerBand *nis, uint16_t channelWidth, WifiSpectrumBand band, PhyEntity::PhyHeaderSections phyHeaderSections) const
Calculate the success rate of the PHY header sections for the provided event.
NiChangesPerBand m_niChangesPerBand
NI Changes for each band.
void SetNumberOfReceiveAntennas(uint8_t rx)
Set the number of RX antennas in the receiver corresponding to this interference helper.
A template-based reference counting class.
Ptr< const WifiPpdu > m_ppdu
PPDU.
Ptr< ErrorRateModel > m_errorRateModel
error rate model
NiChanges::iterator AddNiChangeEvent(Time moment, NiChange change, NiChangesPerBand::iterator niIt)
Add NiChange to the list at the appropriate position and return the iterator of the new event.
handles interference calculations
void AddForeignSignal(Time duration, RxPowerWattPerChannelBand &rxPower)
Add a non-Wifi signal to interference helper.
This class mimics the TXVECTOR which is to be passed to the PHY in order to define the parameters whi...
Time GetStartTime(void) const
Return the start time of the signal.
std::map< WifiSpectrumBand, NiChanges > NiChangesPerBand
Map of NiChanges per band.
Event(Ptr< const WifiPpdu > ppdu, const WifiTxVector &txVector, Time duration, RxPowerWattPerChannelBand &&rxPower)
Create an Event with the given parameters.
void EraseEvents(void)
Erase all events.
std::map< WifiPpduField, PhyHeaderChunkInfo > PhyHeaderSections
A map of PhyHeaderChunkInfo elements per PPDU field.
double CalculatePayloadPer(Ptr< const Event > event, uint16_t channelWidth, NiChangesPerBand *nis, WifiSpectrumBand band, uint16_t staId, std::pair< Time, Time > window) const
Calculate the error rate of the given PHY payload only in the provided time window (thus enabling per...
double CalculateChunkSuccessRate(double snir, Time duration, WifiMode mode, const WifiTxVector &txVector, WifiPpduField field) const
Calculate the success rate of the chunk given the SINR, duration, and TXVECTOR.
Ptr< const WifiPpdu > GetPpdu(void) const
Return the PPDU.
Smart pointer class similar to boost::intrusive_ptr.
NiChanges::iterator GetPreviousPosition(Time moment, NiChangesPerBand::iterator niIt)
Returns an iterator to the last NiChange that is before than moment.
void AppendEvent(Ptr< Event > event, bool isStartOfdmaRxing)
Append the given Event.
RxPowerWattPerChannelBand m_rxPowerW
received power in watts per band
Time GetEndTime(void) const
Return the end time of the signal.
double m_power
power in watts
Simulation virtual time values and global simulation resolution.
WifiPpduField
The type of PPDU field (grouped for convenience)
void UpdateRxPowerW(const RxPowerWattPerChannelBand &rxPower)
Update the received power (W) for all bands, i.e.
bool m_rxing
flag whether it is in receiving state
const RxPowerWattPerChannelBand & GetRxPowerWPerBand(void) const
Return the received power (W) for all bands.
uint8_t m_numRxAntennas
the number of RX antennas in the corresponding receiver
void UpdateEvent(Ptr< Event > event, const RxPowerWattPerChannelBand &rxPower)
Update event to scale its received power (W) per band.
Time m_startTime
start time
std::multimap< Time, NiChange > NiChanges
typedef for a multimap of NiChange
double CalculateSnr(Ptr< Event > event, uint16_t channelWidth, uint8_t nss, WifiSpectrumBand band) const
Calculate the SNIR for the event (starting from now until the event end).
void AddBand(WifiSpectrumBand band)
Add a frequency band.
struct PhyEntity::SnrPer CalculatePhyHeaderSnrPer(Ptr< Event > event, uint16_t channelWidth, WifiSpectrumBand band, WifiPpduField header) const
Calculate the SNIR at the start of the PHY header and accumulate all SNIR changes in the SNIR vector.
Ptr< Event > m_event
event
Ptr< Event > Add(Ptr< const WifiPpdu > ppdu, const WifiTxVector &txVector, Time duration, RxPowerWattPerChannelBand &rxPower, bool isStartOfdmaRxing=false)
Add the PPDU-related signal to interference helper.
void RemoveBands(void)
Remove the frequency bands.
double CalculatePayloadChunkSuccessRate(double snir, Time duration, const WifiTxVector &txVector, uint16_t staId=SU_STA_ID) const
Calculate the success rate of the payload chunk given the SINR, duration, and TXVECTOR.
void SetNoiseFigure(double value)
Set the noise figure.
A struct for both SNR and PER.
std::map< WifiSpectrumBand, double > RxPowerWattPerChannelBand
A map of the received power (Watts) for each band.
std::ostream & operator<<(std::ostream &os, const Angles &a)
Time GetDuration(void) const
Return the duration of the signal.
NiChanges::iterator GetNextPosition(Time moment, NiChangesPerBand::iterator niIt)
Returns an iterator to the first NiChange that is later than moment.
const WifiTxVector & GetTxVector(void) const
Return the TXVECTOR of the PPDU.
struct PhyEntity::SnrPer CalculatePayloadSnrPer(Ptr< Event > event, uint16_t channelWidth, WifiSpectrumBand band, uint16_t staId, std::pair< Time, Time > relativeMpduStartStop) const
Calculate the SNIR at the start of the payload and accumulate all SNIR changes in the SNIR vector for...
handles interference calculations
void NotifyRxEnd(Time endTime)
Notify that RX has ended.