A Discrete-Event Network Simulator
API
Loading...
Searching...
No Matches
nist-error-rate-model.h
Go to the documentation of this file.
1/*
2 * Copyright (c) 2010 The Boeing Company
3 *
4 * SPDX-License-Identifier: GPL-2.0-only
5 *
6 * Author: Gary Pei <guangyu.pei@boeing.com>
7 */
8
9#ifndef NIST_ERROR_RATE_MODEL_H
10#define NIST_ERROR_RATE_MODEL_H
11
12#include "error-rate-model.h"
13#include "wifi-mode.h"
14
15namespace ns3
16{
17
18/**
19 * @ingroup wifi
20 *
21 * A model for the error rate for different modulations. For OFDM modulation,
22 * the model description and validation can be found in
23 * http://www.nsnam.org/~pei/80211ofdm.pdf. For DSSS modulations (802.11b),
24 * the model uses the DsssErrorRateModel.
25 */
27{
28 public:
29 /**
30 * @brief Get the type ID.
31 * @return the object TypeId
32 */
33 static TypeId GetTypeId();
34
36
37 private:
39 const WifiTxVector& txVector,
40 double snr,
41 uint64_t nbits,
42 uint8_t numRxAntennas,
43 WifiPpduField field,
44 uint16_t staId) const override;
45 /**
46 * Return the bValue such that coding rate = bValue / (bValue + 1).
47 *
48 * @param codeRate the coding rate
49 *
50 * @return the bValue such that coding rate = bValue / (bValue + 1)
51 */
52 uint8_t GetBValue(WifiCodeRate codeRate) const;
53 /**
54 * Return the coded BER for the given p and b.
55 *
56 * @param p the SNR ratio (in linear scale)
57 * @param bValue such that coding rate = bValue / (bValue + 1)
58 *
59 * @return the coded BER
60 */
61 double CalculatePe(double p, uint8_t bValue) const;
62 /**
63 * Return BER of BPSK at the given SNR.
64 *
65 * @param snr SNR ratio (in linear scale)
66 *
67 * @return BER of BPSK at the given SNR
68 */
69 double GetBpskBer(double snr) const;
70 /**
71 * Return BER of QPSK at the given SNR.
72 *
73 * @param snr SNR ratio (in linear scale)
74 *
75 * @return BER of QPSK at the given SNR
76 */
77 double GetQpskBer(double snr) const;
78 /**
79 * Return BER of QAM for a given constellation size at the given SNR.
80 *
81 * @param constellationSize the constellation size (M)
82 * @param snr SNR ratio (in linear scale)
83 * @return BER of QAM for a given constellation size at the given SNR
84 */
85 double GetQamBer(uint16_t constellationSize, double snr) const;
86 /**
87 * Return BER of BPSK at the given SNR after applying FEC.
88 *
89 * @param snr SNR ratio (in linear scale)
90 * @param nbits the number of bits in the chunk
91 * @param bValue the bValue such that coding rate = bValue / (bValue + 1)
92 *
93 * @return BER of BPSK at the given SNR after applying FEC
94 */
95 double GetFecBpskBer(double snr, uint64_t nbits, uint8_t bValue) const;
96 /**
97 * Return BER of QPSK at the given SNR after applying FEC.
98 *
99 * @param snr SNR ratio (in linear scale)
100 * @param nbits the number of bits in the chunk
101 * @param bValue the bValue such that coding rate = bValue / (bValue + 1)
102 *
103 * @return BER of QPSK at the given SNR after applying FEC
104 */
105 double GetFecQpskBer(double snr, uint64_t nbits, uint8_t bValue) const;
106 /**
107 * Return BER of QAM for a given constellation size at the given SNR after applying FEC.
108 *
109 * @param constellationSize the constellation size (M)
110 * @param snr SNR ratio (in linear scale)
111 * @param nbits the number of bits in the chunk
112 * @param bValue the bValue such that coding rate = bValue / (bValue + 1)
113 *
114 * @return BER of QAM for a given constellation size at the given SNR after applying FEC
115 */
116 double GetFecQamBer(uint16_t constellationSize,
117 double snr,
118 uint64_t nbits,
119 uint8_t bValue) const;
120};
121
122} // namespace ns3
123
124#endif /* NIST_ERROR_RATE_MODEL_H */
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.
Definition type-id.h:48
represent a single transmission mode
Definition wifi-mode.h:40
This class mimics the TXVECTOR which is to be passed to the PHY in order to define the parameters whi...
WifiPpduField
The type of PPDU field (grouped for convenience)
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...