5#ifndef NR_EESM_ERROR_MODEL_H
6#define NR_EESM_ERROR_MODEL_H
8#include "nr-error-model.h"
15class NrL2smEesmTestCase;
80 friend NrL2smEesmTestCase;
110 const SpectrumValue& sinr,
111 const std::vector<int>& map,
141 Mode mode)
const override;
148 uint32_t
GetMaxCbSize(uint32_t tbSize, uint8_t mcs)
const override;
154 typedef std::vector<double> DoubleVector;
155 typedef std::tuple<DoubleVector, DoubleVector> DoubleTuple;
156 typedef std::vector<std::vector<std::map<uint32_t, DoubleTuple>>> SimulatedBlerFromSINR;
164 std::string
PrintMap(
const std::vector<int>& map)
const;
185 double SinrEff(
const SpectrumValue& sinr,
186 const std::vector<int>& map,
200 double SinrExp(
const SpectrumValue& sinr,
const std::vector<int>& map, uint8_t mcs)
const;
219 const std::vector<int>& map,
261 static std::vector<std::string> m_bgTypeName;
272 double MappingSinrBler(
double sinrEff, uint8_t mcs, uint32_t cbSize);
287 Ptr<NrErrorModelOutput> GetTbBitDecodificationStats(
const SpectrumValue& sinr,
288 const std::vector<int>& map,
310 GraphType GetBaseGraphType(uint32_t tbSize, uint8_t mcs)
const;
322 std::pair<uint32_t, uint32_t> CodeBlockSegmentation(uint32_t B, GraphType bg_type)
const;
331 const std::vector<double>& GetSinrDbVectorFromSimulatedValues(GraphType graphType,
333 uint32_t cbSizeIndex)
const;
341 const std::vector<double>& GetBLERVectorFromSimulatedValues(GraphType graphType,
343 uint32_t cbSizeIndex)
const;
Ptr< NrErrorModelOutput > GetTbDecodificationStats(const SpectrumValue &sinr, const std::vector< int > &map, uint32_t size, uint8_t mcs, const NrErrorModelHistory &sinrHistory) override
Get an output for the decodification error probability of a given transport block,...
virtual double GetMcsEq(uint8_t mcsTx) const =0
Get the "Equivalent MCS" after retransmission combining.
uint32_t GetMaxCbSize(uint32_t tbSize, uint8_t mcs) const override
Get the maximum code block size in Bytes, as per NR. It depends on the LDPC base graph type.
double SinrEff(const SpectrumValue &sinr, const std::vector< int > &map, uint8_t mcs, double a, double b) const
compute the effective SINR for the specified MCS and SINR, according to the EESM method.
uint32_t GetPayloadSize(uint32_t usefulSc, uint8_t mcs, uint8_t rank, uint32_t rbNum, Mode mode) const override
Get the payload size in Bytes, following the MCSs in NR. It follows TS 38.214 Section 5....
virtual const std::vector< double > * GetBetaTable() const =0
static TypeId GetTypeId()
GetTypeId.
virtual const std::vector< double > * GetSpectralEfficiencyForMcs() const =0
virtual const std::vector< uint8_t > * GetMcsMTable() const =0
double SinrExp(const SpectrumValue &sinr, const std::vector< int > &map, uint8_t mcs) const
compute the sum of exponential SINRs for the specified MCS and SINR, according to the EESM method,...
uint8_t GetMaxMcs() const override
Get the maximum MCS. It depends on NR tables being used.
virtual const std::vector< double > * GetMcsEcrTable() const =0
~NrEesmErrorModel() override
~NrEesmErrorModel
std::string PrintMap(const std::vector< int > &map) const
function to print the RB map
virtual double ComputeSINR(const SpectrumValue &sinr, const std::vector< int > &map, uint8_t mcs, uint32_t sizeBit, const NrErrorModel::NrErrorModelHistory &sinrHistory) const =0
Compute the effective SINR after retransmission combining.
virtual const SimulatedBlerFromSINR * GetSimulatedBlerFromSINR() const =0
virtual const std::vector< double > * GetSpectralEfficiencyForCqi() const =0
NrEesmErrorModel()
NrEesmErrorModel constructor.
Interface for calculating the error probability for a transport block.
std::vector< Ptr< NrErrorModelOutput > > NrErrorModelHistory
Vector of previous output.
Mode
Indicate the mode (UL or DL)
The NrEesmErrorModelOutput struct.
double m_sinrExp
Sum of exponential SINR (needed for HARQ-IR)
SpectrumValue m_sinr
perceived SINRs in the whole bandwidth
double m_sinrEff
The effective SINR (needed just for the test)
NrEesmErrorModelOutput()=delete
NrEesmErrorModelOutput constructor (deleted)
NrEesmErrorModelOutput(double tbler)
NrEesmErrorModelOutput constructor to use.
uint32_t m_infoBits
number of info bits
std::vector< int > m_map
map of the active RBs
uint32_t m_codeBits
number of code bits
Store the output of an NRErrorModel.