39 .AddConstructor<YansErrorRateModel> ()
51 return std::log (val) / std::log (2.0);
56 double EbNo = snr * signalSpread / phyRate;
57 double z = std::sqrt (EbNo);
58 double ber = 0.5 * erfc (z);
65 double EbNo = snr * signalSpread / phyRate;
66 double z = std::sqrt ((1.5 *
Log2 (m) * EbNo) / (m - 1.0));
67 double z1 = ((1.0 - 1.0 / std::sqrt (m)) * erfc (z));
68 double z2 = 1 - std::pow ((1 - z1), 2.0);
69 double ber = z2 /
Log2 (m);
70 NS_LOG_INFO (
"Qam m=" << m <<
" rate=" << phyRate <<
" snr=" << snr <<
" ber=" << ber);
87 double retval =
Factorial (n) / (
Factorial (k) *
Factorial (n - k)) * std::pow (p, static_cast<double> (k)) * std::pow (1 - p, static_cast<double> (n - k));
94 unsigned int dstart = (d + 1) / 2;
95 unsigned int dend = d;
98 for (
unsigned int i = dstart; i < dend; i++)
108 unsigned int dstart = d / 2 + 1;
109 unsigned int dend = d;
112 for (
unsigned int i = dstart; i < dend; i++)
116 pd += 0.5 *
Binomial (d / 2, ber, d);
138 uint32_t signalSpread, uint32_t phyRate,
139 uint32_t dFree, uint32_t adFree)
const
141 double ber =
GetBpskBer (snr, signalSpread, phyRate);
147 double pmu = adFree * pd;
148 pmu = std::min (pmu, 1.0);
149 double pms = std::pow (1 - pmu, nbits);
155 uint32_t signalSpread,
157 uint32_t m, uint32_t dFree,
158 uint32_t adFree, uint32_t adFreePlusOne)
const
160 double ber =
GetQamBer (snr, m, signalSpread, phyRate);
167 double pmu = adFree * pd;
170 pmu += adFreePlusOne * pd;
171 pmu = std::min (pmu, 1.0);
172 double pms = std::pow (1 - pmu, static_cast<double> (nbits));
static TypeId GetTypeId(void)
double CalculatePdEven(double ber, unsigned int d) const
static double GetDsssDqpskCck11SuccessRate(double sinr, uint32_t nbits)
Return the chunk success rate of the differential encoded QPSK for 11Mbps data rate.
double CalculatePd(double ber, unsigned int d) const
double GetFecBpskBer(double snr, double nbits, uint32_t signalSpread, uint32_t phyRate, uint32_t dFree, uint32_t adFree) const
enum WifiModulationClass GetModulationClass() const
#define NS_ASSERT(condition)
double CalculatePdOdd(double ber, unsigned int d) const
NS_OBJECT_ENSURE_REGISTERED(NullMessageSimulatorImpl)
double GetQamBer(double snr, unsigned int m, uint32_t signalSpread, uint32_t phyRate) const
Return BER of QAM-m with the given parameters.
static double GetDsssDqpskSuccessRate(double sinr, uint32_t nbits)
Return the chunk success rate of the differential encoded QPSK.
represent a single transmission modeA WifiMode is implemented by a single integer which is used to lo...
the interface for Wifi's error models
double GetFecQamBer(double snr, uint32_t nbits, uint32_t signalSpread, uint32_t phyRate, uint32_t m, uint32_t dfree, uint32_t adFree, uint32_t adFreePlusOne) const
enum WifiCodeRate GetCodeRate(void) const
virtual double GetChunkSuccessRate(WifiMode mode, double snr, uint32_t nbits) const
A pure virtual method that must be implemented in the subclass.
uint32_t GetBandwidth(void) const
NS_LOG_COMPONENT_DEFINE("YansErrorRateModel")
uint8_t GetConstellationSize(void) const
uint64_t GetPhyRate(void) const
double Log2(double val) const
Return the logarithm of the given value to base 2.
uint32_t Factorial(uint32_t k) const
Return k!
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 GetBpskBer(double snr, uint32_t signalSpread, uint32_t phyRate) const
Return BER of BPSK with the given parameters.
double Binomial(uint32_t k, double p, uint32_t n) const
Return Binomial distribution for a given k, p, and n.
static double GetDsssDbpskSuccessRate(double sinr, uint32_t nbits)
Return the chunk success rate of the differential BPSK.
a unique identifier for an interface.
uint64_t GetDataRate(void) const
TypeId SetParent(TypeId tid)
DSSS PHY (Clause 15) and HR/DSSS PHY (Clause 18)