38 .SetGroupName (
"Wifi")
51 double z = std::sqrt (snr);
52 double ber = 0.5 * erfc (z);
60 double z = std::sqrt (snr / 2.0);
61 double ber = 0.5 * erfc (z);
69 double z = std::sqrt (snr / (5.0 * 2.0));
70 double ber = 0.75 * 0.5 * erfc (z);
71 NS_LOG_INFO (
"16-Qam" <<
" snr=" << snr <<
" ber=" << ber);
78 double z = std::sqrt (snr / (21.0 * 2.0));
79 double ber = 7.0 / 12.0 * 0.5 * erfc (z);
80 NS_LOG_INFO (
"64-Qam" <<
" snr=" << snr <<
" ber=" << ber);
86 double z = std::sqrt (snr / (85.0 * 2.0));
87 double ber = 15.0 / 32.0 * 0.5 * erfc (z);
88 NS_LOG_INFO (
"256-Qam" <<
" snr=" << snr <<
" ber=" << ber);
94 uint32_t bValue)
const
102 pe = std::min (pe, 1.0);
103 double pms = std::pow (1 - pe, (
double)nbits);
109 uint32_t bValue)
const
117 pe = std::min (pe, 1.0);
118 double pms = std::pow (1 - pe, (
double)nbits);
125 double D = std::sqrt (4.0 * p * (1.0 - p));
130 pe = 0.5 * (36.0 * std::pow (D, 10)
131 + 211.0 * std::pow (D, 12)
132 + 1404.0 * std::pow (D, 14)
133 + 11633.0 * std::pow (D, 16)
134 + 77433.0 * std::pow (D, 18)
135 + 502690.0 * std::pow (D, 20)
136 + 3322763.0 * std::pow (D, 22)
137 + 21292910.0 * std::pow (D, 24)
138 + 134365911.0 * std::pow (D, 26));
140 else if (bValue == 2)
143 pe = 1.0 / (2.0 * bValue) *
144 (3.0 * std::pow (D, 6)
145 + 70.0 * std::pow (D, 7)
146 + 285.0 * std::pow (D, 8)
147 + 1276.0 * std::pow (D, 9)
148 + 6160.0 * std::pow (D, 10)
149 + 27128.0 * std::pow (D, 11)
150 + 117019.0 * std::pow (D, 12)
151 + 498860.0 * std::pow (D, 13)
152 + 2103891.0 * std::pow (D, 14)
153 + 8784123.0 * std::pow (D, 15));
155 else if (bValue == 3)
158 pe = 1.0 / (2.0 * bValue) *
159 (42.0 * std::pow (D, 5)
160 + 201.0 * std::pow (D, 6)
161 + 1492.0 * std::pow (D, 7)
162 + 10469.0 * std::pow (D, 8)
163 + 62935.0 * std::pow (D, 9)
164 + 379644.0 * std::pow (D, 10)
165 + 2253373.0 * std::pow (D, 11)
166 + 13073811.0 * std::pow (D, 12)
167 + 75152755.0 * std::pow (D, 13)
168 + 428005675.0 * std::pow (D, 14));
170 else if (bValue == 5)
174 pe = 1.0 / (2.0 * bValue) *
175 (92.0 * std::pow (D, 4.0)
176 + 528.0 * std::pow (D, 5.0)
177 + 8694.0 * std::pow (D, 6.0)
178 + 79453.0 * std::pow (D, 7.0)
179 + 792114.0 * std::pow (D, 8.0)
180 + 7375573.0 * std::pow (D, 9.0)
181 + 67884974.0 * std::pow (D, 10.0)
182 + 610875423.0 * std::pow (D, 11.0)
183 + 5427275376.0 * std::pow (D, 12.0)
184 + 47664215639.0 * std::pow (D, 13.0));
195 uint32_t bValue)
const
203 pe = std::min (pe, 1.0);
204 double pms = std::pow (1 - pe, static_cast<double> (nbits));
210 uint32_t bValue)
const
218 pe = std::min (pe, 1.0);
219 double pms = std::pow (1 - pe, static_cast<double> (nbits));
225 uint32_t bValue)
const
233 pe = std::min (pe, 1.0);
234 double pms = std::pow (1 - pe, static_cast<double> (nbits));
343 NS_ASSERT (
"undefined DSSS/HR-DSSS datarate");
double GetQpskBer(double snr) const
Return BER of QPSK at the given SNR.
static double GetDsssDqpskCck11SuccessRate(double sinr, uint32_t nbits)
Return the chunk success rate of the differential encoded QPSK for 11Mbps data rate.
static TypeId GetTypeId(void)
enum WifiCodeRate GetCodeRate(uint8_t nss) const
This class mimics the TXVECTOR which is to be passed to the PHY in order to define the parameters whi...
#define NS_OBJECT_ENSURE_REGISTERED(type)
Register an Object subclass with the TypeId system.
uint16_t GetConstellationSize(uint8_t nss) const
enum WifiModulationClass GetModulationClass() const
#define NS_ASSERT(condition)
At runtime, in debugging builds, if this condition is not true, the program prints the source file...
#define NS_LOG_COMPONENT_DEFINE(name)
Define a Log component with a specific name.
static double GetDsssDqpskSuccessRate(double sinr, uint32_t nbits)
Return the chunk success rate of the differential encoded QPSK.
#define NS_LOG_INFO(msg)
Use NS_LOG to output a message of level LOG_INFO.
double GetFec64QamBer(double snr, uint32_t nbits, uint32_t bValue) const
Return BER of QAM64 at the given SNR after applying FEC.
double GetFec16QamBer(double snr, uint32_t nbits, uint32_t bValue) const
Return BER of QAM16 at the given SNR after applying FEC.
represent a single transmission modeA WifiMode is implemented by a single integer which is used to lo...
double GetFec256QamBer(double snr, uint32_t nbits, uint32_t bValue) const
Return BER of QAM256 at the given SNR after applying FEC.
the interface for Wifi's error models
double CalculatePe(double p, uint32_t bValue) const
Return the coded BER for the given p and b.
virtual double GetChunkSuccessRate(WifiMode mode, WifiTxVector txVector, double snr, uint32_t nbits) const
A pure virtual method that must be implemented in the subclass.
double Get16QamBer(double snr) const
Return BER of QAM16 at the given SNR.
A model for the error rate for different modulations.
Every class exported by the ns3 library is enclosed in the ns3 namespace.
uint64_t GetDataRate(uint32_t channelWidth, bool isShortGuardInterval, uint8_t nss) const
double GetFecQpskBer(double snr, uint32_t nbits, uint32_t bValue) const
Return BER of QPSK at the given SNR after applying FEC.
double Get64QamBer(double snr) const
Return BER of QAM64 at the given SNR.
double Get256QamBer(double snr) const
Return BER of QAM256 at the given SNR.
static double GetDsssDqpskCck5_5SuccessRate(double sinr, uint32_t nbits)
Return the chunk success rate of the differential encoded QPSK for 5.5Mbps data rate.
double GetFecBpskBer(double snr, uint32_t nbits, uint32_t bValue) const
Return BER of BPSK at the given SNR after applying FEC.
static double GetDsssDbpskSuccessRate(double sinr, uint32_t nbits)
Return the chunk success rate of the differential BPSK.
a unique identifier for an interface.
TypeId SetParent(TypeId tid)
Set the parent TypeId.
double GetBpskBer(double snr) const
Return BER of BPSK at the given SNR.