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 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License version 2 as
6 * published by the Free Software Foundation;
7 *
8 * This program is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU General Public License for more details.
12 *
13 * You should have received a copy of the GNU General Public License
14 * along with this program; if not, write to the Free Software
15 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
16 *
17 * Author: Gary Pei <guangyu.pei@boeing.com>
18 */
19
20#ifndef NIST_ERROR_RATE_MODEL_H
21#define NIST_ERROR_RATE_MODEL_H
22
23#include "error-rate-model.h"
24#include "wifi-mode.h"
25
26namespace ns3
27{
28
29/**
30 * \ingroup wifi
31 *
32 * A model for the error rate for different modulations. For OFDM modulation,
33 * the model description and validation can be found in
34 * http://www.nsnam.org/~pei/80211ofdm.pdf. For DSSS modulations (802.11b),
35 * the model uses the DsssErrorRateModel.
36 */
38{
39 public:
40 /**
41 * \brief Get the type ID.
42 * \return the object TypeId
43 */
44 static TypeId GetTypeId();
45
47
48 private:
50 const WifiTxVector& txVector,
51 double snr,
52 uint64_t nbits,
53 uint8_t numRxAntennas,
54 WifiPpduField field,
55 uint16_t staId) const override;
56 /**
57 * Return the bValue such that coding rate = bValue / (bValue + 1).
58 *
59 * \param codeRate the coding rate
60 *
61 * \return the bValue such that coding rate = bValue / (bValue + 1)
62 */
63 uint8_t GetBValue(WifiCodeRate codeRate) const;
64 /**
65 * Return the coded BER for the given p and b.
66 *
67 * \param p the SNR ratio (in linear scale)
68 * \param bValue such that coding rate = bValue / (bValue + 1)
69 *
70 * \return the coded BER
71 */
72 double CalculatePe(double p, uint8_t bValue) const;
73 /**
74 * Return BER of BPSK at the given SNR.
75 *
76 * \param snr SNR ratio (in linear scale)
77 *
78 * \return BER of BPSK at the given SNR
79 */
80 double GetBpskBer(double snr) const;
81 /**
82 * Return BER of QPSK at the given SNR.
83 *
84 * \param snr SNR ratio (in linear scale)
85 *
86 * \return BER of QPSK at the given SNR
87 */
88 double GetQpskBer(double snr) const;
89 /**
90 * Return BER of QAM for a given constellation size at the given SNR.
91 *
92 * \param constellationSize the constellation size (M)
93 * \param snr SNR ratio (in linear scale)
94 * \return BER of QAM for a given constellation size at the given SNR
95 */
96 double GetQamBer(uint16_t constellationSize, double snr) const;
97 /**
98 * Return BER of BPSK at the given SNR after applying FEC.
99 *
100 * \param snr SNR ratio (in linear scale)
101 * \param nbits the number of bits in the chunk
102 * \param bValue the bValue such that coding rate = bValue / (bValue + 1)
103 *
104 * \return BER of BPSK at the given SNR after applying FEC
105 */
106 double GetFecBpskBer(double snr, uint64_t nbits, uint8_t bValue) const;
107 /**
108 * Return BER of QPSK at the given SNR after applying FEC.
109 *
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 QPSK at the given SNR after applying FEC
115 */
116 double GetFecQpskBer(double snr, uint64_t nbits, uint8_t bValue) const;
117 /**
118 * Return BER of QAM for a given constellation size at the given SNR after applying FEC.
119 *
120 * \param constellationSize the constellation size (M)
121 * \param snr SNR ratio (in linear scale)
122 * \param nbits the number of bits in the chunk
123 * \param bValue the bValue such that coding rate = bValue / (bValue + 1)
124 *
125 * \return BER of QAM for a given constellation size at the given SNR after applying FEC
126 */
127 double GetFecQamBer(uint16_t constellationSize,
128 double snr,
129 uint64_t nbits,
130 uint8_t bValue) const;
131};
132
133} // namespace ns3
134
135#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:59
represent a single transmission mode
Definition: wifi-mode.h:51
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...