38 return ((std::sqrt (2.0) + 1.0) / std::sqrt (8.0 * 3.1415926 * std::sqrt (2.0)))
39 * (1.0 / std::sqrt (x)) * std::exp ( -(2.0 - std::sqrt (2.0)) *
x);
46 double EbN0 = sinr * 22000000.0 / 1000000.0;
47 double ber = 0.5 * std::exp (-EbN0);
48 return std::pow ((1.0 - ber), static_cast<double> (nbits));
55 double EbN0 = sinr * 22000000.0 / 1000000.0 / 2.0;
57 return std::pow ((1.0 - ber), static_cast<double> (nbits));
66 double EbN0 = sinr * 22000000.0 / 1375000.0 / 4.0;
67 double sep = SymbolErrorProb16Cck (4.0 * EbN0 / 2.0);
68 return std::pow (1.0 - sep,nbits / 4.0);
70 NS_LOG_WARN (
"Running a 802.11b CCK Matlab model less accurate than GSL model");
84 double a1 = 5.3681634344056195e-001;
85 double a2 = 3.3092430025608586e-003;
86 double a3 = 4.1654372361004000e-001;
87 double a4 = 1.0288981434358866e+000;
88 ber = a1 * std::exp (-std::pow ((sinr - a2) / a3, a4));
90 return std::pow ((1.0 - ber), static_cast<double> (nbits));
100 double EbN0 = sinr * 22000000.0 / 1375000.0 / 8.0;
101 double sep = SymbolErrorProb256Cck (8.0 * EbN0 / 2.0);
102 return std::pow (1.0 - sep, nbits / 8.0);
104 NS_LOG_WARN (
"Running a 802.11b CCK Matlab model less accurate than GSL model");
118 double a1 = 7.9056742265333456e-003;
119 double a2 = -1.8397449399176360e-001;
120 double a3 = 1.0740689468707241e+000;
121 double a4 = 1.0523316904502553e+000;
122 double a5 = 3.0552298746496687e-001;
123 double a6 = 2.2032715128698435e+000;
124 ber = (a1 * sinr * sinr + a2 * sinr + a3) / (sinr * sinr * sinr + a4 * sinr * sinr + a5 * sinr + a6);
126 return std::pow ((1.0 - ber), static_cast<double> (nbits));
132 IntegralFunction (
double x,
void *params)
134 double beta = ((FunctionParameters *) params)->beta;
135 double n = ((FunctionParameters *) params)->n;
136 double IntegralFunction = std::pow (2 * gsl_cdf_ugaussian_P (x + beta) - 1, n - 1)
137 * std::exp (-x * x / 2.0) / std::sqrt (2.0 * M_PI);
138 return IntegralFunction;
142 DsssErrorRateModel::SymbolErrorProb16Cck (
double e2)
147 FunctionParameters params;
148 params.beta = std::sqrt (2.0 * e2);
151 gsl_integration_workspace *
w = gsl_integration_workspace_alloc (1000);
154 F.function = &IntegralFunction;
157 gsl_integration_qagiu (&F,-params.beta, 0, 1e-7, 1000, w, &sep, &error);
158 gsl_integration_workspace_free (w);
167 double DsssErrorRateModel::SymbolErrorProb256Cck (
double e1)
169 return 1.0 - std::pow (1.0 - SymbolErrorProb16Cck (e1 / 2.0), 2.0);
static double GetDsssDqpskCck11SuccessRate(double sinr, uint32_t nbits)
Return the chunk success rate of the differential encoded QPSK for 11Mbps data rate.
static const double WLAN_SIR_PERFECT
NS_LOG_COMPONENT_DEFINE("DsssErrorRateModel")
static double GetDsssDqpskSuccessRate(double sinr, uint32_t nbits)
Return the chunk success rate of the differential encoded QPSK.
#define NS_LOG_FUNCTION_NOARGS()
Output the name of the function.
static double GetDsssDqpskCck5_5SuccessRate(double sinr, uint32_t nbits)
Return the chunk success rate of the differential encoded QPSK for 5.5Mbps data rate.
static const double WLAN_SIR_IMPOSSIBLE
static double DqpskFunction(double x)
A function DQPSK.
static double GetDsssDbpskSuccessRate(double sinr, uint32_t nbits)
Return the chunk success rate of the differential BPSK.