39 .SetGroupName (
"Wifi")
53 double EbNo = snr * signalSpread / phyRate;
54 double z = std::sqrt (EbNo);
55 double ber = 0.5 * erfc (z);
64 double EbNo = snr * signalSpread / phyRate;
65 double z = std::sqrt ((1.5 * log2 (m) * EbNo) / (m - 1.0));
66 double z1 = ((1.0 - 1.0 / std::sqrt (m)) * erfc (z));
67 double z2 = 1 - std::pow ((1 - z1), 2);
68 double ber = z2 / log2 (m);
69 NS_LOG_INFO (
"Qam m=" << m <<
" rate=" << phyRate <<
" snr=" << snr <<
" ber=" << ber);
88 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));
96 unsigned int dstart = (d + 1) / 2;
97 unsigned int dend = d;
100 for (
unsigned int i = dstart; i < dend; i++)
111 unsigned int dstart = d / 2 + 1;
112 unsigned int dend = d;
115 for (
unsigned int i = dstart; i < dend; i++)
119 pd += 0.5 *
Binomial (d / 2, ber, d);
142 uint32_t signalSpread, uint64_t phyRate,
143 uint32_t dFree, uint32_t adFree)
const 145 NS_LOG_FUNCTION (
this << snr << nbits << signalSpread << phyRate << dFree << adFree);
146 double ber =
GetBpskBer (snr, signalSpread, phyRate);
152 double pmu = adFree * pd;
154 double pms = std::pow (1 - pmu, nbits);
160 uint32_t signalSpread,
162 uint32_t m, uint32_t dFree,
163 uint32_t adFree, uint32_t adFreePlusOne)
const 165 NS_LOG_FUNCTION (
this << snr << nbits << signalSpread << phyRate << m << dFree << adFree << adFreePlusOne);
166 double ber =
GetQamBer (snr, m, signalSpread, phyRate);
173 double pmu = adFree * pd;
176 pmu += adFreePlusOne * pd;
178 double pms = std::pow (1 - pmu, nbits);
368 NS_ASSERT (
"undefined DSSS/HR-DSSS datarate");
static TypeId GetTypeId(void)
Get the type ID.
#define NS_LOG_FUNCTION(parameters)
If log level LOG_FUNCTION is enabled, this macro will output all input parameters separated by "...
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.
#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.
#define NS_LOG_INFO(msg)
Use NS_LOG to output a message of level LOG_INFO.
double GetFecQamBer(double snr, uint64_t nbits, uint32_t signalSpread, uint64_t phyRate, uint32_t m, uint32_t dfree, uint32_t adFree, uint32_t adFreePlusOne) const
represent a single transmission modeA WifiMode is implemented by a single integer which is used to lo...
static double GetDsssDbpskSuccessRate(double sinr, uint64_t nbits)
Return the chunk success rate of the differential BPSK.
the interface for Wifi's error models
Model the error rate for different modulations.
double CalculatePdEven(double ber, unsigned int d) const
double GetQamBer(double snr, unsigned int m, uint32_t signalSpread, uint64_t phyRate) const
Return BER of QAM-m with the given parameters.
WifiMode GetMode(void) const
WifiModulationClass GetModulationClass() const
Every class exported by the ns3 library is enclosed in the ns3 namespace.
virtual double GetChunkSuccessRate(WifiMode mode, WifiTxVector txVector, double snr, uint64_t nbits) const
A pure virtual method that must be implemented in the subclass.
static double GetDsssDqpskCck5_5SuccessRate(double sinr, uint64_t nbits)
Return the chunk success rate of the differential encoded QPSK for 5.5Mbps data rate.
uint16_t GetConstellationSize(void) const
double CalculatePdOdd(double ber, unsigned int d) const
uint32_t Factorial(uint32_t k) const
Return k!
uint64_t GetPhyRate(uint16_t channelWidth, uint16_t guardInterval, uint8_t nss) const
double Binomial(uint32_t k, double p, uint32_t n) const
Return Binomial distribution for a given k, p, and n.
double GetBpskBer(double snr, uint32_t signalSpread, uint64_t phyRate) const
Return BER of BPSK with the given parameters.
uint16_t GetChannelWidth(void) const
static double GetDsssDqpskSuccessRate(double sinr, uint64_t nbits)
Return the chunk success rate of the differential encoded QPSK.
WifiCodeRate GetCodeRate(void) const
double GetFecBpskBer(double snr, uint64_t nbits, uint32_t signalSpread, uint64_t phyRate, uint32_t dFree, uint32_t adFree) const
a unique identifier for an interface.
TypeId SetParent(TypeId tid)
Set the parent TypeId.
uint64_t GetDataRate(uint16_t channelWidth, uint16_t guardInterval, uint8_t nss) const
static double GetDsssDqpskCck11SuccessRate(double sinr, uint64_t nbits)
Return the chunk success rate of the differential encoded QPSK for 11Mbps data rate.
double CalculatePd(double ber, unsigned int d) const