8#include "nr-error-model.h"
9#include "nr-phy-mac-common.h"
180 uint32_t
CalculateTbSize(uint8_t mcs, uint8_t rank, uint32_t nprb)
const;
189 uint32_t
GetPayloadSize(uint8_t mcs, uint8_t rank, uint32_t nprb)
const;
231 const size_t subbandSize,
241 return m_errorModel->GetSpectralEfficiencyForCqi(cqi);
262 uint8_t GetMaxMcsForErrorModel(
const NrSinrMatrix& sinrMat)
const;
267 uint8_t GetWbCqiFromMcs(uint8_t mcs)
const;
273 uint32_t CalcTbSizeForMimoMatrix(uint8_t mcs,
const NrSinrMatrix& sinrMat)
const;
279 double CalcTblerForMimoMatrix(uint8_t mcs,
const NrSinrMatrix& sinrMat)
const;
285 double GetBer()
const;
289 Ptr<NrErrorModel> m_errorModel;
290 TypeId m_errorModelType;
291 uint8_t m_numRefScPerRb{1};
293 static const unsigned int m_crcLen = 24 / 8;
294 mutable std::unordered_map<uint8_t, uint8_t> m_cachedCqiToMcsMap;
Adaptive Modulation and Coding class for the NR module.
void SetErrorModelType(const TypeId &type)
Set Error model type.
void SetAmcModel(AmcModel m)
Set the AMC model type.
std::vector< uint8_t > GetSbMcs(const size_t subbandSize, const NrSinrMatrix &sinrMat) const
Find Sb MCS supported for this channel.
TypeId GetErrorModelType() const
Get the error model type.
uint8_t GetNumRefScPerRb() const
NrAmc()
NrAmc constructor.
void SetUlMode()
Set the object to be in "UL" mode.
double GetSpectralEfficiencyForSinr(double sinr) const
Compute spectral efficient for a given SINR according to Shannon's capacity.
static TypeId GetTypeId()
GetTypeId.
double GetSpectralEfficiencyForCqi(uint8_t cqi) const
Compute spectral efficient for a given CQI according to the error model.
AmcModel GetAmcModel() const
Get the AMC model type.
uint32_t GetPayloadSize(uint8_t mcs, uint8_t rank, uint32_t nprb) const
Calculate the Payload Size (in bytes) from MCS and the number of RB.
NrSinrMatrix ExtractSbFromMat(const uint8_t sbIndex, const size_t subbandSize, const NrSinrMatrix &sinrMat) const
Extract sub-band sinr value from the sinrMatrix.
NrSinrMatrix CreateSinrMatForSb(const NrSinrMatrix &avgSinrSb, const NrSinrMatrix &sinrMat) const
Create wide-band matrix based on average sinr of particular sub-band.
double GetSinrFromSpectralEfficiency(double spectralEff) const
Compute SINR for a given spectral efficiency according to Shannon's capacity.
static constexpr size_t NR_AMC_NUM_SYMBOLS_DEFAULT
Num OFDM syms for TB size.
McsParams GetMaxMcsParams(const NrSinrMatrix &sinrMat, size_t subbandSize) const
Find maximum MCS supported for this channel and obtain related parameters.
uint32_t CalculateTbSize(uint8_t mcs, uint8_t rank, uint32_t nprb) const
Calculate the TransportBlock size (in bytes) giving the MCS and the number of RB assigned.
void SetDlMode()
Set the object to be in "DL" mode.
uint8_t GetCqiFromSpectralEfficiency(double s) const
Get CQI from a SpectralEfficiency value.
uint8_t GetMcsFromSpectralEfficiency(double s) const
Get MCS from a SpectralEfficiency value.
uint8_t CreateCqiFeedbackSiso(const SpectrumValue &sinr, uint8_t &mcsWb) const
Create a CQI/MCS wideband feedback from SINR values.
AmcModel
Valid types of the model used to create a cqi feedback.
@ ErrorModel
Error Model version (can use different error models, see NrErrorModel)
@ ShannonModel
Shannon based model (very conservative)
void SetNumRefScPerRb(uint8_t nref)
Set the the number of subcarriers carrying reference signals per resource block.
uint8_t GetMcsFromCqi(uint8_t cqi) const
Get the MCS value from a CQI value.
uint8_t GetMcs(const NrSinrMatrix &sinrMat) const
Find MCS supported for this channel.
uint32_t GetMaxMcs() const
Get the maximum MCS (depends on the underlying error model)
~NrAmc() override
~NrAmc deconstructor
Mode
Indicate the mode (UL or DL)
NrSinrMatrix stores the MIMO SINR matrix, with dimension rank x nRbs.
Parameters related to MCS selection.
uint8_t wbCqi
Wideband CQI.
uint32_t tbSize
Expected transport block size.
std::vector< uint8_t > sbCqis
Subband CQI values.