21 #ifndef INTERFERENCE_HELPER_H
22 #define INTERFERENCE_HELPER_H
24 #include "ns3/nstime.h"
25 #include "ns3/packet.h"
231 Time GetTime (
void)
const;
237 double GetDelta (
void)
const;
288 double CalculateSnr (
double signal,
double noiseInterference, uint8_t channelWidth)
const;
Simulation virtual time values and global simulation resolution.
void AddForeignSignal(Time duration, double rxPower)
Add a non-Wifi signal to interference helper.
A struct for both SNR and PER.
Ptr< InterferenceHelper::Event > Add(Ptr< const Packet > packet, WifiTxVector txVector, Time duration, double rxPower)
Add the packet-related signal to interference helper.
void SetNumberOfReceiveAntennas(uint8_t rx)
Set the number of RX antennas in the receiver corresponding to this interference helper.
Ptr< ErrorRateModel > GetErrorRateModel(void) const
Return the error rate model.
This class mimics the TXVECTOR which is to be passed to the PHY in order to define the parameters whi...
Signal event for a packet.
std::vector< NiChange > NiChanges
typedef for a vector of NiChanges
handles interference calculations
Ptr< const Packet > m_packet
packet
void SetErrorRateModel(const Ptr< ErrorRateModel > rate)
Set the error rate model for this interference helper.
double CalculateChunkSuccessRate(double snir, Time duration, WifiMode mode, WifiTxVector txVector) const
Calculate the success rate of the chunk given the SINR, duration, and Wi-Fi mode. ...
double GetRxPowerW(void) const
Return the receive power (w).
Ptr< ErrorRateModel > m_errorRateModel
error rate model
represent a single transmission modeA WifiMode is implemented by a single integer which is used to lo...
bool operator<(const EventId &a, const EventId &b)
Ptr< const Packet > GetPacket(void) const
Return the packet.
double CalculateNoiseInterferenceW(Ptr< Event > event, NiChanges *ni) const
Calculate noise and interference power in W.
Time GetStartTime(void) const
Return the start time of the signal.
Event(Ptr< const Packet > packet, WifiTxVector txVector, Time duration, double rxPower)
Create an Event with the given parameters.
WifiTxVector GetTxVector(void) const
Return the TXVECTOR of the packet.
Ptr< InterferenceHelper::Event > m_event
event
NiChanges m_niChanges
Experimental: needed for energy duration calculation.
void AddNiChangeEvent(NiChange change)
Add NiChange to the list at the appropriate position.
struct InterferenceHelper::SnrPer CalculatePlcpHeaderSnrPer(Ptr< InterferenceHelper::Event > event)
Calculate the SNIR at the start of the plcp header and accumulate all SNIR changes in the snir vector...
double CalculatePlcpPayloadPer(Ptr< const Event > event, NiChanges *ni) const
Calculate the error rate of the given plcp payload.
Time GetEnergyDuration(double energyW) const
double m_noiseFigure
noise figure (linear)
struct InterferenceHelper::SnrPer CalculatePlcpPayloadSnrPer(Ptr< InterferenceHelper::Event > event)
Calculate the SNIR at the start of the plcp payload and accumulate all SNIR changes in the snir vecto...
Every class exported by the ns3 library is enclosed in the ns3 namespace.
void NotifyRxStart()
Notify that RX has started.
Noise and Interference (thus Ni) event.
void EraseEvents(void)
Erase all events.
double CalculatePlcpHeaderPer(Ptr< const Event > event, NiChanges *ni) const
Calculate the error rate of the plcp header.
uint8_t m_numRxAntennas
the number of RX antennas in the corresponding receiver
Time GetEndTime(void) const
Return the end time of the signal.
double m_rxPowerW
receive power in watts
WifiTxVector m_txVector
TXVECTOR.
void NotifyRxEnd()
Notify that RX has ended.
Time GetDuration(void) const
Return the duration of the signal.
void SetNoiseFigure(double value)
Set the noise figure.
double m_firstPower
first power
WifiMode GetPayloadMode(void) const
Return the Wi-Fi mode used for the payload.
NiChanges::const_iterator GetPosition(Time moment)
Returns a const iterator to the first nichange, which is later than moment.
void AppendEvent(Ptr< Event > event)
Append the given Event.
double GetNoiseFigure(void) const
Return the noise figure.
Time m_startTime
start time
A template-based reference counting class.
double CalculateSnr(double signal, double noiseInterference, uint8_t channelWidth) const
Calculate SNR (linear ratio) from the given signal power and noise+interference power.
bool m_rxing
flag whether it is in receiving state