44    double z = std::sqrt(snr);
 
   45    double ber = 0.5 * erfc(z);
 
 
   54    double z = std::sqrt(snr / 2.0);
 
   55    double ber = 0.5 * erfc(z);
 
 
   64    NS_ASSERT(std::bitset<16>(constellationSize).count() ==
 
   66    double z = std::sqrt(snr / ((2 * (constellationSize - 1)) / 3));
 
   67    uint8_t bitsPerSymbol = std::sqrt(constellationSize);
 
   68    double ber = ((bitsPerSymbol - 1) / (bitsPerSymbol * std::log2(bitsPerSymbol))) * erfc(z);
 
   69    NS_LOG_INFO(constellationSize << 
"-QAM: snr=" << snr << 
" ber=" << ber);
 
 
   83    pe = std::min(pe, 1.0);
 
   84    double pms = std::pow(1 - pe, nbits);
 
 
   98    pe = std::min(pe, 1.0);
 
   99    double pms = std::pow(1 - pe, nbits);
 
 
  107    double D = std::sqrt(4.0 * p * (1.0 - p));
 
  112        pe = 0.5 * (36.0 * std::pow(D, 10) + 211.0 * std::pow(D, 12) + 1404.0 * std::pow(D, 14) +
 
  113                    11633.0 * std::pow(D, 16) + 77433.0 * std::pow(D, 18) +
 
  114                    502690.0 * std::pow(D, 20) + 3322763.0 * std::pow(D, 22) +
 
  115                    21292910.0 * std::pow(D, 24) + 134365911.0 * std::pow(D, 26));
 
  117    else if (bValue == 2)
 
  120        pe = 1.0 / (2.0 * bValue) *
 
  121             (3.0 * std::pow(D, 6) + 70.0 * std::pow(D, 7) + 285.0 * std::pow(D, 8) +
 
  122              1276.0 * std::pow(D, 9) + 6160.0 * std::pow(D, 10) + 27128.0 * std::pow(D, 11) +
 
  123              117019.0 * std::pow(D, 12) + 498860.0 * std::pow(D, 13) +
 
  124              2103891.0 * std::pow(D, 14) + 8784123.0 * std::pow(D, 15));
 
  126    else if (bValue == 3)
 
  129        pe = 1.0 / (2.0 * bValue) *
 
  130             (42.0 * std::pow(D, 5) + 201.0 * std::pow(D, 6) + 1492.0 * std::pow(D, 7) +
 
  131              10469.0 * std::pow(D, 8) + 62935.0 * std::pow(D, 9) + 379644.0 * std::pow(D, 10) +
 
  132              2253373.0 * std::pow(D, 11) + 13073811.0 * std::pow(D, 12) +
 
  133              75152755.0 * std::pow(D, 13) + 428005675.0 * std::pow(D, 14));
 
  135    else if (bValue == 5)
 
  140        pe = 1.0 / (2.0 * bValue) *
 
  141             (92.0 * std::pow(D, 4.0) + 528.0 * std::pow(D, 5.0) + 8694.0 * std::pow(D, 6.0) +
 
  142              79453.0 * std::pow(D, 7.0) + 792114.0 * std::pow(D, 8.0) +
 
  143              7375573.0 * std::pow(D, 9.0) + 67884974.0 * std::pow(D, 10.0) +
 
  144              610875423.0 * std::pow(D, 11.0) + 5427275376.0 * std::pow(D, 12.0) +
 
  145              47664215639.0 * std::pow(D, 13.0));
 
 
  158                                 uint8_t bValue)
 const 
  161    double ber = 
GetQamBer(constellationSize, snr);
 
  167    pe = std::min(pe, 1.0);
 
  168    double pms = std::pow(1 - pe, nbits);
 
 
  198                                          uint8_t numRxAntennas,
 
  200                                          uint16_t staId)
 const 
  202    NS_LOG_FUNCTION(
this << mode << snr << nbits << +numRxAntennas << field << staId);
 
 
the interface for Wifi's error models
A model for the error rate for different modulations.
static TypeId GetTypeId()
Get the type ID.
double GetQamBer(uint16_t constellationSize, double snr) const
Return BER of QAM for a given constellation size at the given SNR.
double GetBpskBer(double snr) const
Return BER of BPSK at the given SNR.
double GetFecBpskBer(double snr, uint64_t nbits, uint8_t bValue) const
Return BER of BPSK at the given SNR after applying FEC.
double CalculatePe(double p, uint8_t bValue) const
Return the coded BER for the given p and b.
double GetFecQpskBer(double snr, uint64_t nbits, uint8_t bValue) const
Return BER of QPSK at the given SNR after applying FEC.
double GetFecQamBer(uint16_t constellationSize, double snr, uint64_t nbits, uint8_t bValue) const
Return BER of QAM for a given constellation size at the given SNR after applying FEC.
uint8_t GetBValue(WifiCodeRate codeRate) const
Return the bValue such that coding rate = bValue / (bValue + 1).
double DoGetChunkSuccessRate(WifiMode mode, const WifiTxVector &txVector, double snr, uint64_t nbits, uint8_t numRxAntennas, WifiPpduField field, uint16_t staId) const override
A pure virtual method that must be implemented in the subclass.
double GetQpskBer(double snr) const
Return BER of QPSK at the given SNR.
a unique identifier for an interface.
TypeId SetParent(TypeId tid)
Set the parent TypeId.
represent a single transmission mode
uint16_t GetConstellationSize() const
WifiModulationClass GetModulationClass() const
WifiCodeRate GetCodeRate() const
This class mimics the TXVECTOR which is to be passed to the PHY in order to define the parameters whi...
#define NS_ASSERT(condition)
At runtime, in debugging builds, if this condition is not true, the program prints the source file,...
#define NS_FATAL_ERROR(msg)
Report a fatal error with a message and terminate.
#define NS_LOG_COMPONENT_DEFINE(name)
Define a Log component with a specific name.
#define NS_LOG_FUNCTION(parameters)
If log level LOG_FUNCTION is enabled, this macro will output all input parameters separated by ",...
#define NS_LOG_INFO(msg)
Use NS_LOG to output a message of level LOG_INFO.
#define NS_OBJECT_ENSURE_REGISTERED(type)
Register an Object subclass with the TypeId system.
WifiPpduField
The type of PPDU field (grouped for convenience)
@ WIFI_MOD_CLASS_ERP_OFDM
ERP-OFDM (18.4)
Every class exported by the ns3 library is enclosed in the ns3 namespace.
WifiCodeRate
These constants define the various convolutional coding rates used for the OFDM transmission modes in...
@ WIFI_CODE_RATE_2_3
2/3 coding rate
@ WIFI_CODE_RATE_1_2
1/2 coding rate
@ WIFI_CODE_RATE_3_4
3/4 coding rate
@ WIFI_CODE_RATE_UNDEFINED
undefined coding rate
@ WIFI_CODE_RATE_5_6
5/6 coding rate