LteMcs.h Source File

Simu5G: LteMcs.h Source File
Simu5G
LteMcs.h
1//
2// Simu5G
3//
4// Copyright (C) 2012-2021 Giovanni Nardini, Giovanni Stea, Antonio Virdis et al. (University of Pisa)
5// Copyright (C) 2022-2026 Giovanni Nardini, Giovanni Stea et al. (University of Pisa)
6//
7// This file is part of a software released under the license included in file
8// "license.pdf". Please read LICENSE and README files before using it.
9// The above files and the present reference are part of the software itself,
10// and cannot be removed from it.
11//
12
13#ifndef _LTE_LTEMCS_H_
14#define _LTE_LTEMCS_H_
15
16#include "simu5g/common/LteCommon.h"
17
18namespace simu5g {
19
20// This file contains MCS types and constants; MCS and ITBS tables;
21// and functions related to MCS and Tx-Modes.
22
23struct CqiElem
24{
26 LteMod mod_;
27
29 double rate_;
30
32 CqiElem(LteMod mod = _QPSK, double rate = 0.0) : mod_(mod), rate_(rate)
33 {
34 }
35
36};
37
42extern const CqiElem cqiTable[];
43
44struct McsElem
45{
46 LteMod mod_;
47 Tbs iTbs_;
48 double threshold_;
49
50 McsElem(LteMod mod = _QPSK, Tbs iTbs = 0, double threshold = 0.0) : mod_(mod), iTbs_(iTbs), threshold_(threshold)
51 {
52 }
53
54};
55
60class McsTable
61{
62 public:
63
64 McsElem table[CQI2ITBSSIZE];
65
66 McsTable();
67
69 const McsElem& at(Tbs tbs) const
70 {
71 return table[tbs];
72 }
73
75 void rescale(double scale);
76};
77
78/********************************************
79* ITBS 2 TBS FRIGHTENING TABLES
80********************************************/
81
82extern const unsigned int itbs2tbs_qpsk_1[][110];
83extern const unsigned int itbs2tbs_16qam_1[][110];
84extern const unsigned int itbs2tbs_64qam_1[][110];
85extern const unsigned int itbs2tbs_qpsk_2[][110];
86extern const unsigned int itbs2tbs_16qam_2[][110];
87extern const unsigned int itbs2tbs_64qam_2[][110];
88extern const unsigned int itbs2tbs_qpsk_4[][110];
89extern const unsigned int itbs2tbs_16qam_4[][110];
90extern const unsigned int itbs2tbs_64qam_4[][110];
91extern const unsigned int itbs2tbs_qpsk_8[][110];
92extern const unsigned int itbs2tbs_16qam8[][110];
93extern const unsigned int itbs2tbs_64qam8[][110];
94
102const unsigned int *itbs2tbs(LteMod mod, TxMode txMode, unsigned char layers, unsigned char itbs);
103
111std::vector<unsigned char> cwMapping(const TxMode& txMode, const Rank& ri, const unsigned int antennaPorts);
112
113} //namespace
114
115#endif
116
void rescale(double scale)
MCS Table re-scaling function.
const McsElem & at(Tbs tbs) const
MCS table seek operator.
Definition LteMcs.h:69
Definition AlertReceiver.h:24
unsigned short Tbs
Transport Block Size.
Definition LteTypes.h:137
const CqiElem cqiTable[]
std::vector< unsigned char > cwMapping(const TxMode &txMode, const Rank &ri, const unsigned int antennaPorts)
unsigned short Rank
Connection Identifier: <MacNodeId,LogicalCid>
Definition LteTypes.h:130
const unsigned int * itbs2tbs(LteMod mod, TxMode txMode, unsigned char layers, unsigned char itbs)