|
INET Framework for OMNeT++/OMNEST
|
A model for the error rate for different modulations.
More...
#include <Ieee80211NistErrorModel.h>
|
| virtual std::ostream & | printToStream (std::ostream &stream, int level, int evFlags=0) const override |
| | Prints this object to the provided output stream. More...
|
| |
| | Ieee80211ErrorModelBase () |
| |
| virtual double | computePacketErrorRate (const ISnir *snir, IRadioSignal::SignalPart part) const override |
| | Returns the packet error rate based on SNIR, modulation, FEC encoding and any other physical layer characteristics. More...
|
| |
| virtual double | computeBitErrorRate (const ISnir *snir, IRadioSignal::SignalPart part) const override |
| | Returns the bit error rate based on SNIR, modulation, FEC encoding and any other physical layer characteristics. More...
|
| |
| virtual double | computeSymbolErrorRate (const ISnir *snir, IRadioSignal::SignalPart part) const override |
| | Returns the symbol error rate based on SNIR, modulation, and any other physical layer characteristics. More...
|
| |
| virtual | ~IPrintableObject () |
| |
| virtual std::string | printToString () const |
| |
| virtual std::string | printToString (int level, int evFlags=0) const |
| |
| virtual std::string | getInfoStringRepresentation (int evFlags=0) const |
| |
| virtual std::string | getDetailStringRepresentation (int evFlags=0) const |
| |
| virtual std::string | getDebugStringRepresentation (int evFlags=0) const |
| |
| virtual std::string | getTraceStringRepresentation (int evFlags=0) const |
| |
| virtual std::string | getCompleteStringRepresentation (int evFlags=0) const |
| |
|
| double | calculatePe (double p, uint32_t bValue) const |
| |
| double | getBpskBer (double snr) const |
| |
| double | getQpskBer (double snr) const |
| |
| double | get16QamBer (double snr) const |
| |
| double | get64QamBer (double snr) const |
| |
| double | get256QamBer (double snr) const |
| |
| double | get1024QamBer (double snr) const |
| |
| double | getFecBpskBer (double snr, double nbits, uint32_t bValue) const |
| |
| double | getFecQpskBer (double snr, double nbits, uint32_t bValue) const |
| |
| double | getFec16QamBer (double snr, uint32_t nbits, uint32_t bValue) const |
| |
| double | getFec64QamBer (double snr, uint32_t nbits, uint32_t bValue) const |
| |
| double | getFec256QamBer (double snr, uint64_t nbits, uint32_t bValue) const |
| |
| double | getFec1024QamBer (double snr, uint64_t nbits, uint32_t bValue) const |
| |
| virtual double | getOFDMAndERPOFDMChunkSuccessRate (const ApskModulationBase *subcarrierModulation, const ConvolutionalCode *convolutionalCode, unsigned int bitLength, double snr) const |
| |
| virtual double | getDSSSAndHrDSSSChunkSuccessRate (bps bitrate, unsigned int bitLength, double snr) const |
| |
| virtual double | getHeaderSuccessRate (const IIeee80211Mode *mode, unsigned int headerBitLength, double snr) const override |
| |
| virtual double | getDataSuccessRate (const IIeee80211Mode *mode, unsigned int bitLength, double snr) const override |
| |
| virtual Packet * | computeCorruptedPacket (const Packet *packet, double ber) const override |
| |
| virtual double | getDsssDbpskSuccessRate (unsigned int bitLength, double snir) const |
| |
| virtual double | getDsssDqpskSuccessRate (unsigned int bitLength, double snir) const |
| |
| virtual double | getDsssDqpskCck5_5SuccessRate (unsigned int bitLength, double snir) const |
| |
| virtual double | getDsssDqpskCck11SuccessRate (unsigned int bitLength, double snir) const |
| |
| virtual void | initialize (int stage) override |
| |
| virtual double | getScalarSnir (const ISnir *snir) const |
| |
| virtual bool | hasProbabilisticError (b length, double ber) const |
| |
| virtual Packet * | corruptBits (const Packet *packet, double ber, bool &isCorrupted) const |
| |
| virtual Packet * | corruptBytes (const Packet *packet, double ber, bool &isCorrupted) const |
| |
| virtual Packet * | corruptChunks (const Packet *packet, double ber, bool &isCorrupted) const |
| |
| virtual Packet * | corruptPacket (const Packet *packet, bool &isCorrupted) const |
| |
| virtual Packet * | computeCorruptedPacket (const ISnir *snir) const override |
| |
|
| enum | CorruptionMode {
CorruptionMode::CM_UNDEFINED = -1,
CorruptionMode::CM_PACKET,
CorruptionMode::CM_CHUNK,
CorruptionMode::CM_BYTE,
CorruptionMode::CM_BIT
} |
| |
| enum | SnirMode { SnirMode::SM_UNDEFINED = -1,
SnirMode::SM_MIN,
SnirMode::SM_MEAN
} |
| |
| enum | PrintLevel {
PRINT_LEVEL_TRACE,
PRINT_LEVEL_DEBUG,
PRINT_LEVEL_DETAIL,
PRINT_LEVEL_INFO,
PRINT_LEVEL_COMPLETE = INT_MIN
} |
| |
| enum | PrintFlag { PRINT_FLAG_FORMATTED = (1 << 0),
PRINT_FLAG_MULTILINE = (1 << 1)
} |
| |
| double | spectralEfficiency1bit = 2000000.0 / 1000000.0 |
| |
| double | spectralEfficiency2bit = 2000000.0 / 1000000.0 / 2.0 |
| |
| double | sirPerfect = 10.0 |
| |
| double | sirImpossible = 0.1 |
| |
| CorruptionMode | corruptionMode = CorruptionMode::CM_UNDEFINED |
| |
| SnirMode | snirMode = SnirMode::SM_UNDEFINED |
| |
| double | snirOffset = NaN |
| |
A model for the error rate for different modulations.
For OFDM modulation, the model description and validation can be found in http://www.nsnam.org/~pei/80211ofdm.pdf. For DSSS modulations (802.11b), the model uses a separate error model.
◆ calculatePe()
| double inet::physicallayer::Ieee80211NistErrorModel::calculatePe |
( |
double |
p, |
|
|
uint32_t |
bValue |
|
) |
| const |
|
protected |
106 double D =
sqrt(4.0 * p * (1.0 - p));
111 * (36.0 * pow(D, 10.0) + 211.0 * pow(D, 12.0) + 1404.0 * pow(D, 14.0) + 11633.0 * pow(D, 16.0)
112 + 77433.0 * pow(D, 18.0) + 502690.0 * pow(D, 20.0) + 3322763.0 * pow(D, 22.0)
113 + 21292910.0 * pow(D, 24.0) + 134365911.0 * pow(D, 26.0));
115 else if (bValue == 2) {
117 pe = 1.0 / (2.0 * bValue)
118 * (3.0 * pow(D, 6.0) + 70.0 * pow(D, 7.0) + 285.0 * pow(D, 8.0) + 1276.0 * pow(D, 9.0)
119 + 6160.0 * pow(D, 10.0) + 27128.0 * pow(D, 11.0) + 117019.0 * pow(D, 12.0)
120 + 498860.0 * pow(D, 13.0) + 2103891.0 * pow(D, 14.0) + 8784123.0 * pow(D, 15.0));
122 else if (bValue == 3) {
124 pe = 1.0 / (2.0 * bValue)
125 * (42.0 * pow(D, 5.0) + 201.0 * pow(D, 6.0) + 1492.0 * pow(D, 7.0) + 10469.0 * pow(D, 8.0)
126 + 62935.0 * pow(D, 9.0) + 379644.0 * pow(D, 10.0) + 2253373.0 * pow(D, 11.0)
127 + 13073811.0 * pow(D, 12.0) + 75152755.0 * pow(D, 13.0) + 428005675.0 * pow(D, 14.0));
129 else if (bValue == 5) {
132 pe = 1.0 / (2.0 * bValue)
133 * (92.0 * pow(D, 4.0) + 528.0 * pow(D, 5.0) + 8694.0 * pow(D, 6.0) + 79453.0 * pow(D, 7.0)
134 + 792114.0 * pow(D, 8.0) + 7375573.0 * pow(D, 9.0) + 67884974.0 * pow(D, 10.0)
135 + 610875423.0 * pow(D, 11.0) + 5427275376.0 * pow(D, 12.0) + 47664215639.0 * pow(D, 13.0));
Referenced by getFec1024QamBer(), getFec16QamBer(), getFec256QamBer(), getFec64QamBer(), getFecBpskBer(), and getFecQpskBer().
◆ get1024QamBer()
| double inet::physicallayer::Ieee80211NistErrorModel::get1024QamBer |
( |
double |
snr | ) |
const |
|
protected |
74 double z =
std::sqrt(snr / (341.0 * 2.0));
75 double ber = 31.0 / 160.0 * 0.5 * erfc(z);
76 EV <<
"1024-Qam" <<
" snr=" << snr <<
" ber=" << ber;
Referenced by getFec1024QamBer().
◆ get16QamBer()
| double inet::physicallayer::Ieee80211NistErrorModel::get16QamBer |
( |
double |
snr | ) |
const |
|
protected |
50 double z =
sqrt(snr / (5.0 * 2.0));
51 double ber = 0.75 * 0.5 * erfc(z);
52 EV <<
"16-Qam" <<
" snr=" << snr <<
" ber=" << ber <<
"\n";
Referenced by getFec16QamBer().
◆ get256QamBer()
| double inet::physicallayer::Ieee80211NistErrorModel::get256QamBer |
( |
double |
snr | ) |
const |
|
protected |
67 double ber = 15.0 / 32.0 * 0.5 * erfc(z);
68 EV <<
"256-Qam" <<
" snr=" << snr <<
" ber=" << ber;
Referenced by getFec256QamBer().
◆ get64QamBer()
| double inet::physicallayer::Ieee80211NistErrorModel::get64QamBer |
( |
double |
snr | ) |
const |
|
protected |
58 double z =
sqrt(snr / (21.0 * 2.0));
59 double ber = 7.0 / 12.0 * 0.5 * erfc(z);
60 EV <<
"64-Qam" <<
" snr=" << snr <<
" ber=" << ber <<
"\n";
Referenced by getFec64QamBer().
◆ getBpskBer()
| double inet::physicallayer::Ieee80211NistErrorModel::getBpskBer |
( |
double |
snr | ) |
const |
|
protected |
35 double ber = 0.5 * erfc(z);
36 EV <<
"bpsk snr=" << snr <<
" ber=" << ber <<
"\n";
Referenced by getFecBpskBer().
◆ getDataSuccessRate()
| double inet::physicallayer::Ieee80211NistErrorModel::getDataSuccessRate |
( |
const IIeee80211Mode * |
mode, |
|
|
unsigned int |
bitLength, |
|
|
double |
snr |
|
) |
| const |
|
overrideprotectedvirtual |
Implements inet::physicallayer::Ieee80211ErrorModelBase.
287 double successRate = 0;
288 if (
auto ofdmMode =
dynamic_cast<const Ieee80211OfdmMode *
>(mode))
290 ofdmMode->getDataMode()->getCode()->getConvolutionalCode(),
291 bitLength +
b(ofdmMode->getHeaderMode()->getServiceFieldLength()).get(),
293 else if (
auto htMode =
dynamic_cast<const Ieee80211HtMode *
>(mode))
295 htMode->getDataMode()->getCode()->getForwardErrorCorrection(),
299 else if (
auto vhtMode =
dynamic_cast<const Ieee80211VhtMode *
>(mode))
301 vhtMode->getDataMode()->getCode()->getForwardErrorCorrection(),
305 else if (
auto dsssMode =
dynamic_cast<const Ieee80211DsssMode *
>(mode))
307 else if (
auto hrDsssMode =
dynamic_cast<const Ieee80211HrDsssMode *
>(mode))
310 throw cRuntimeError(
"Unsupported 802.11 mode");
311 EV_DEBUG <<
"SNIR = " << snr <<
", bit length = " << bitLength <<
", data error rate = " << 1 - successRate << endl;
312 if (successRate >= 1)
◆ getDSSSAndHrDSSSChunkSuccessRate()
| double inet::physicallayer::Ieee80211NistErrorModel::getDSSSAndHrDSSSChunkSuccessRate |
( |
bps |
bitrate, |
|
|
unsigned int |
bitLength, |
|
|
double |
snr |
|
) |
| const |
|
protectedvirtual |
◆ getFec1024QamBer()
| double inet::physicallayer::Ieee80211NistErrorModel::getFec1024QamBer |
( |
double |
snr, |
|
|
uint64_t |
nbits, |
|
|
uint32_t |
bValue |
|
) |
| const |
|
protected |
◆ getFec16QamBer()
| double inet::physicallayer::Ieee80211NistErrorModel::getFec16QamBer |
( |
double |
snr, |
|
|
uint32_t |
nbits, |
|
|
uint32_t |
bValue |
|
) |
| const |
|
protected |
◆ getFec256QamBer()
| double inet::physicallayer::Ieee80211NistErrorModel::getFec256QamBer |
( |
double |
snr, |
|
|
uint64_t |
nbits, |
|
|
uint32_t |
bValue |
|
) |
| const |
|
protected |
◆ getFec64QamBer()
| double inet::physicallayer::Ieee80211NistErrorModel::getFec64QamBer |
( |
double |
snr, |
|
|
uint32_t |
nbits, |
|
|
uint32_t |
bValue |
|
) |
| const |
|
protected |
◆ getFecBpskBer()
| double inet::physicallayer::Ieee80211NistErrorModel::getFecBpskBer |
( |
double |
snr, |
|
|
double |
nbits, |
|
|
uint32_t |
bValue |
|
) |
| const |
|
protected |
◆ getFecQpskBer()
| double inet::physicallayer::Ieee80211NistErrorModel::getFecQpskBer |
( |
double |
snr, |
|
|
double |
nbits, |
|
|
uint32_t |
bValue |
|
) |
| const |
|
protected |
◆ getHeaderSuccessRate()
| double inet::physicallayer::Ieee80211NistErrorModel::getHeaderSuccessRate |
( |
const IIeee80211Mode * |
mode, |
|
|
unsigned int |
headerBitLength, |
|
|
double |
snr |
|
) |
| const |
|
overrideprotectedvirtual |
Implements inet::physicallayer::Ieee80211ErrorModelBase.
246 double successRate = 0;
247 if (
auto ofdmMode =
dynamic_cast<const Ieee80211OfdmMode *
>(mode)) {
248 int chunkLength = bitLength -
b(ofdmMode->getHeaderMode()->getServiceFieldLength()).get();
249 ASSERT(chunkLength == 24);
251 ofdmMode->getHeaderMode()->getCode()->getConvolutionalCode(),
255 else if (
auto htMode =
dynamic_cast<const Ieee80211HtMode *
>(mode)) {
258 int chunkLength = bitLength;
260 htMode->getHeaderMode()->getCode()->getForwardErrorCorrection(),
264 else if (
auto vhtMode =
dynamic_cast<const Ieee80211VhtMode *
>(mode)) {
267 int chunkLength = bitLength;
269 vhtMode->getHeaderMode()->getCode()->getForwardErrorCorrection(),
273 else if (
auto dsssMode =
dynamic_cast<const Ieee80211DsssMode *
>(mode))
275 else if (
auto hrDsssMode =
dynamic_cast<const Ieee80211HrDsssMode *
>(mode))
278 throw cRuntimeError(
"Unsupported 802.11 mode");
279 EV_DEBUG <<
"SNIR = " << snr <<
", bit length = " << bitLength <<
", header error rate = " << 1 - successRate << endl;
280 if (successRate >= 1)
◆ getOFDMAndERPOFDMChunkSuccessRate()
| double inet::physicallayer::Ieee80211NistErrorModel::getOFDMAndERPOFDMChunkSuccessRate |
( |
const ApskModulationBase * |
subcarrierModulation, |
|
|
const ConvolutionalCode * |
convolutionalCode, |
|
|
unsigned int |
bitLength, |
|
|
double |
snr |
|
) |
| const |
|
protectedvirtual |
194 if (convolutionalCode->getCodeRatePuncturingK() == 1 && convolutionalCode->getCodeRatePuncturingN() == 2)
199 if (convolutionalCode->getCodeRatePuncturingK() == 1 && convolutionalCode->getCodeRatePuncturingN() == 2)
204 if (convolutionalCode->getCodeRatePuncturingK() == 1 && convolutionalCode->getCodeRatePuncturingN() == 2)
209 if (convolutionalCode->getCodeRatePuncturingK() == 2 && convolutionalCode->getCodeRatePuncturingN() == 3)
211 else if (convolutionalCode->getCodeRatePuncturingK() == 5 && convolutionalCode->getCodeRatePuncturingN() == 6)
216 if (convolutionalCode->getCodeRatePuncturingK() == 5 && convolutionalCode->getCodeRatePuncturingN() == 6)
221 if (convolutionalCode->getCodeRatePuncturingK() == 5 && convolutionalCode->getCodeRatePuncturingN() == 6)
226 throw cRuntimeError(
"Unknown modulation");
Referenced by getDataSuccessRate(), and getHeaderSuccessRate().
◆ getQpskBer()
| double inet::physicallayer::Ieee80211NistErrorModel::getQpskBer |
( |
double |
snr | ) |
const |
|
protected |
42 double z =
sqrt(snr / 2.0);
43 double ber = 0.5 * erfc(z);
44 EV <<
"qpsk snr=" << snr <<
" ber=" << ber <<
"\n";
Referenced by getFecQpskBer().
◆ printToStream()
| virtual std::ostream& inet::physicallayer::Ieee80211NistErrorModel::printToStream |
( |
std::ostream & |
stream, |
|
|
int |
level, |
|
|
int |
evFlags = 0 |
|
) |
| const |
|
inlineoverridevirtual |
The documentation for this class was generated from the following files:
static const QbpskModulation singleton
Definition: QbpskModulation.h:24
double getFec16QamBer(double snr, uint32_t nbits, uint32_t bValue) const
Definition: Ieee80211NistErrorModel.cc:143
virtual double getDsssDqpskCck11SuccessRate(unsigned int bitLength, double snir) const
Definition: Ieee80211ErrorModelBase.cc:98
double getFec256QamBer(double snr, uint64_t nbits, uint32_t bValue) const
Definition: Ieee80211NistErrorModel.cc:167
double getBpskBer(double snr) const
Definition: Ieee80211NistErrorModel.cc:32
double get16QamBer(double snr) const
Definition: Ieee80211NistErrorModel.cc:48
virtual double getDsssDqpskCck5_5SuccessRate(unsigned int bitLength, double snir) const
Definition: Ieee80211ErrorModelBase.cc:81
static const QpskModulation singleton
Definition: QpskModulation.h:25
value< Value, pow< Unit, 1, 2 > > sqrt(const value< Value, Unit > &a)
Definition: Units.h:272
double calculatePe(double p, uint32_t bValue) const
Definition: Ieee80211NistErrorModel.cc:104
double getQpskBer(double snr) const
Definition: Ieee80211NistErrorModel.cc:40
static const BpskModulation singleton
Definition: BpskModulation.h:25
double get64QamBer(double snr) const
Definition: Ieee80211NistErrorModel.cc:56
double getFecQpskBer(double snr, double nbits, uint32_t bValue) const
Definition: Ieee80211NistErrorModel.cc:92
value< int64_t, units::b > b
Definition: Units.h:1241
static const Qam64Modulation singleton
Definition: Qam64Modulation.h:26
double getFec64QamBer(double snr, uint32_t nbits, uint32_t bValue) const
Definition: Ieee80211NistErrorModel.cc:155
virtual double getDsssDbpskSuccessRate(unsigned int bitLength, double snir) const
Definition: Ieee80211ErrorModelBase.cc:67
double getFecBpskBer(double snr, double nbits, uint32_t bValue) const
Definition: Ieee80211NistErrorModel.cc:80
virtual double getOFDMAndERPOFDMChunkSuccessRate(const ApskModulationBase *subcarrierModulation, const ConvolutionalCode *convolutionalCode, unsigned int bitLength, double snr) const
Definition: Ieee80211NistErrorModel.cc:191
static const Qam1024Modulation singleton
Definition: Qam1024Modulation.h:26
const T minnan(const T &a, const T &b)
This function properly and symmetrically handles NaNs in contrast with std::min and std::fmin.
Definition: INETMath.h:216
double get256QamBer(double snr) const
Definition: Ieee80211NistErrorModel.cc:64
virtual double getDSSSAndHrDSSSChunkSuccessRate(bps bitrate, unsigned int bitLength, double snr) const
Definition: Ieee80211NistErrorModel.cc:229
static const Qam16Modulation singleton
Definition: Qam16Modulation.h:26
double get1024QamBer(double snr) const
Definition: Ieee80211NistErrorModel.cc:72
virtual double getDsssDqpskSuccessRate(unsigned int bitLength, double snir) const
Definition: Ieee80211ErrorModelBase.cc:74
static const Qam256Modulation singleton
Definition: Qam256Modulation.h:26
double getFec1024QamBer(double snr, uint64_t nbits, uint32_t bValue) const
Definition: Ieee80211NistErrorModel.cc:179