27 #include <ns3/assert.h>
28 #include <ns3/double.h>
31 #include <ns3/spectrum-value.h>
77 static const int ModulationSchemeForMcs[32] = {
78 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
80 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6,
97 0.15, 0.19, 0.23, 0.31, 0.38, 0.49, 0.6, 0.74, 0.88, 1.03, 1.18, 1.33, 1.48, 1.7, 1.91, 2.16,
98 2.41, 2.57, 2.73, 3.03, 3.32, 3.61, 3.9, 4.21, 4.52, 4.82, 5.12, 5.33, 5.55, 0, 0, 0,
107 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 9, 10, 11, 12, 13,
108 14, 15, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26,
117 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 10, 11, 12, 13,
118 14, 15, 16, 17, 18, 19, 19, 20, 21, 22, 23, 24, 25, 26,
130 {16, 24, 32, 40, 56, 72, 88, 104, 120, 136, 144, 176, 208, 224,
131 256, 280, 328, 336, 376, 408, 440, 488, 520, 552, 584, 616, 712},
132 {32, 56, 72, 104, 120, 144, 176, 224, 256, 296, 328, 376, 440, 488,
133 552, 600, 632, 696, 776, 840, 904, 1000, 1064, 1128, 1192, 1256, 1480},
134 {56, 88, 144, 176, 208, 224, 256, 328, 392, 456, 504, 584, 680, 744,
135 840, 904, 968, 1064, 1160, 1288, 1384, 1480, 1608, 1736, 1800, 1864, 2216},
136 {88, 144, 176, 208, 256, 328, 392, 472, 536,
137 616, 680, 776, 904, 1000, 1128, 1224, 1288, 1416,
138 1544, 1736, 1864, 1992, 2152, 2280, 2408, 2536, 2984},
139 {120, 176, 208, 256, 328, 424, 504, 584, 680,
140 776, 872, 1000, 1128, 1256, 1416, 1544, 1608, 1800,
141 1992, 2152, 2344, 2472, 2664, 2856, 2984, 3112, 3752},
142 {152, 208, 256, 328, 408, 504, 600, 712, 808,
143 936, 1032, 1192, 1352, 1544, 1736, 1800, 1928, 2152,
144 2344, 2600, 2792, 2984, 3240, 3496, 3624, 3752, 4392},
145 {176, 224, 296, 392, 488, 600, 712, 840, 968,
146 1096, 1224, 1384, 1608, 1800, 1992, 2152, 2280, 2536,
147 2792, 2984, 3240, 3496, 3752, 4008, 4264, 4392, 5160},
148 {208, 256, 328, 440, 552, 680, 808, 968, 1096,
149 1256, 1384, 1608, 1800, 2024, 2280, 2472, 2600, 2856,
150 3112, 3496, 3752, 4008, 4264, 4584, 4968, 5160, 5992},
151 {224, 328, 376, 504, 632, 776, 936, 1096, 1256,
152 1416, 1544, 1800, 2024, 2280, 2600, 2728, 2984, 3240,
153 3624, 3880, 4136, 4584, 4776, 5160, 5544, 5736, 6712},
154 {256, 344, 424, 568, 696, 872, 1032, 1224, 1384,
155 1544, 1736, 2024, 2280, 2536, 2856, 3112, 3240, 3624,
156 4008, 4264, 4584, 4968, 5352, 5736, 5992, 6200, 7480},
157 {288, 376, 472, 616, 776, 968, 1128, 1320, 1544,
158 1736, 1928, 2216, 2472, 2856, 3112, 3368, 3624, 4008,
159 4392, 4776, 5160, 5544, 5992, 6200, 6712, 6968, 8248},
160 {328, 424, 520, 680, 840, 1032, 1224, 1480, 1672,
161 1864, 2088, 2408, 2728, 3112, 3496, 3624, 3880, 4392,
162 4776, 5160, 5544, 5992, 6456, 6968, 7224, 7480, 8760},
163 {344, 456, 568, 744, 904, 1128, 1352, 1608, 1800,
164 2024, 2280, 2600, 2984, 3368, 3752, 4008, 4264, 4776,
165 5160, 5544, 5992, 6456, 6968, 7480, 7992, 8248, 9528},
166 {376, 488, 616, 808, 1000, 1224, 1480, 1672, 1928,
167 2216, 2472, 2792, 3240, 3624, 4008, 4264, 4584, 5160,
168 5544, 5992, 6456, 6968, 7480, 7992, 8504, 8760, 10296},
169 {392, 520, 648, 872, 1064, 1320, 1544, 1800, 2088,
170 2344, 2664, 2984, 3368, 3880, 4264, 4584, 4968, 5352,
171 5992, 6456, 6968, 7480, 7992, 8504, 9144, 9528, 11064},
172 {424, 568, 696, 904, 1128, 1384, 1672, 1928, 2216,
173 2536, 2792, 3240, 3624, 4136, 4584, 4968, 5160, 5736,
174 6200, 6968, 7480, 7992, 8504, 9144, 9912, 10296, 11832},
175 {456, 600, 744, 968, 1192, 1480, 1736, 2088, 2344,
176 2664, 2984, 3496, 3880, 4392, 4968, 5160, 5544, 6200,
177 6712, 7224, 7992, 8504, 9144, 9912, 10296, 10680, 12576},
178 {488, 632, 776, 1032, 1288, 1544, 1864, 2216, 2536,
179 2856, 3112, 3624, 4136, 4584, 5160, 5544, 5992, 6456,
180 7224, 7736, 8248, 9144, 9528, 10296, 11064, 11448, 13536},
181 {504, 680, 840, 1096, 1352, 1672, 1992, 2344, 2664,
182 2984, 3368, 3880, 4392, 4968, 5544, 5736, 6200, 6712,
183 7480, 8248, 8760, 9528, 10296, 11064, 11448, 12216, 14112},
184 {536, 712, 872, 1160, 1416, 1736, 2088, 2472, 2792,
185 3112, 3496, 4008, 4584, 5160, 5736, 6200, 6456, 7224,
186 7992, 8504, 9144, 9912, 10680, 11448, 12216, 12576, 14688},
187 {568, 744, 936, 1224, 1480, 1864, 2216, 2536, 2984,
188 3368, 3752, 4264, 4776, 5352, 5992, 6456, 6712, 7480,
189 8248, 9144, 9912, 10680, 11448, 12216, 12960, 13536, 15264},
190 {600, 776, 968, 1256, 1544, 1928, 2280, 2664, 3112,
191 3496, 3880, 4392, 4968, 5736, 6200, 6712, 7224, 7992,
192 8760, 9528, 10296, 11064, 11832, 12576, 13536, 14112, 16416},
193 {616, 808, 1000, 1320, 1608, 2024, 2408, 2792, 3240,
194 3624, 4008, 4584, 5352, 5992, 6456, 6968, 7480, 8248,
195 9144, 9912, 10680, 11448, 12576, 12960, 14112, 14688, 16992},
196 {648, 872, 1064, 1384, 1736, 2088, 2472, 2984, 3368,
197 3752, 4264, 4776, 5544, 6200, 6968, 7224, 7736, 8760,
198 9528, 10296, 11064, 12216, 12960, 13536, 14688, 15264, 17568},
199 {680, 904, 1096, 1416, 1800, 2216, 2600, 3112, 3496,
200 4008, 4392, 4968, 5736, 6456, 7224, 7736, 7992, 9144,
201 9912, 10680, 11448, 12576, 13536, 14112, 15264, 15840, 18336},
202 {712, 936, 1160, 1480, 1864, 2280, 2728, 3240, 3624,
203 4136, 4584, 5352, 5992, 6712, 7480, 7992, 8504, 9528,
204 10296, 11064, 12216, 12960, 14112, 14688, 15840, 16416, 19080},
205 {744, 968, 1192, 1544, 1928, 2344, 2792, 3368, 3752,
206 4264, 4776, 5544, 6200, 6968, 7736, 8248, 8760, 9912,
207 10680, 11448, 12576, 13536, 14688, 15264, 16416, 16992, 19848},
208 {776, 1000, 1256, 1608, 1992, 2472, 2984, 3368, 3880,
209 4392, 4968, 5736, 6456, 7224, 7992, 8504, 9144, 10296,
210 11064, 12216, 12960, 14112, 15264, 15840, 16992, 17568, 20616},
211 {776, 1032, 1288, 1672, 2088, 2536, 2984, 3496, 4008,
212 4584, 5160, 5992, 6712, 7480, 8248, 8760, 9528, 10296,
213 11448, 12576, 13536, 14688, 15840, 16416, 17568, 18336, 21384},
214 {808, 1064, 1320, 1736, 2152, 2664, 3112, 3624, 4264,
215 4776, 5352, 5992, 6712, 7736, 8504, 9144, 9912, 10680,
216 11832, 12960, 14112, 15264, 16416, 16992, 18336, 19080, 22152},
217 {840, 1128, 1384, 1800, 2216, 2728, 3240, 3752, 4392,
218 4968, 5544, 6200, 6968, 7992, 8760, 9528, 9912, 11064,
219 12216, 13536, 14688, 15840, 16992, 17568, 19080, 19848, 22920},
220 {872, 1160, 1416, 1864, 2280, 2792, 3368, 3880, 4584,
221 5160, 5736, 6456, 7224, 8248, 9144, 9912, 10296, 11448,
222 12576, 13536, 14688, 15840, 16992, 18336, 19848, 20616, 23688},
223 {904, 1192, 1480, 1928, 2344, 2856, 3496, 4008, 4584,
224 5160, 5736, 6712, 7480, 8504, 9528, 10296, 10680, 11832,
225 12960, 14112, 15264, 16416, 17568, 19080, 19848, 20616, 24496},
226 {936, 1224, 1544, 1992, 2408, 2984, 3496, 4136, 4776,
227 5352, 5992, 6968, 7736, 8760, 9912, 10296, 11064, 12216,
228 13536, 14688, 15840, 16992, 18336, 19848, 20616, 21384, 25456},
229 {968, 1256, 1544, 2024, 2472, 3112, 3624, 4264, 4968,
230 5544, 6200, 6968, 7992, 9144, 9912, 10680, 11448, 12576,
231 14112, 15264, 16416, 17568, 19080, 19848, 21384, 22152, 25456},
232 {1000, 1288, 1608, 2088, 2600, 3112, 3752, 4392, 4968,
233 5736, 6200, 7224, 8248, 9144, 10296, 11064, 11832, 12960,
234 14112, 15264, 16992, 18336, 19080, 20616, 22152, 22920, 26416},
235 {1032, 1352, 1672, 2152, 2664, 3240, 3880, 4584, 5160,
236 5736, 6456, 7480, 8504, 9528, 10680, 11448, 12216, 13536,
237 14688, 15840, 16992, 18336, 19848, 21384, 22920, 23688, 27376},
238 {1032, 1384, 1672, 2216, 2728, 3368, 4008, 4584, 5352,
239 5992, 6712, 7736, 8760, 9912, 11064, 11832, 12216, 13536,
240 15264, 16416, 17568, 19080, 20616, 22152, 22920, 24496, 28336},
241 {1064, 1416, 1736, 2280, 2792, 3496, 4136, 4776, 5544,
242 6200, 6712, 7736, 8760, 9912, 11064, 11832, 12576, 14112,
243 15264, 16992, 18336, 19848, 21384, 22152, 23688, 24496, 29296},
244 {1096, 1416, 1800, 2344, 2856, 3496, 4136, 4968, 5544,
245 6200, 6968, 7992, 9144, 10296, 11448, 12216, 12960, 14688,
246 15840, 16992, 18336, 19848, 21384, 22920, 24496, 25456, 29296},
247 {1128, 1480, 1800, 2408, 2984, 3624, 4264, 4968, 5736,
248 6456, 7224, 8248, 9528, 10680, 11832, 12576, 13536, 14688,
249 16416, 17568, 19080, 20616, 22152, 23688, 25456, 26416, 30576},
250 {1160, 1544, 1864, 2472, 2984, 3752, 4392, 5160, 5992,
251 6712, 7480, 8504, 9528, 10680, 12216, 12960, 13536, 15264,
252 16416, 18336, 19848, 21384, 22920, 24496, 25456, 26416, 30576},
253 {1192, 1544, 1928, 2536, 3112, 3752, 4584, 5352, 5992,
254 6712, 7480, 8760, 9912, 11064, 12216, 12960, 14112, 15264,
255 16992, 18336, 19848, 21384, 22920, 24496, 26416, 27376, 31704},
256 {1224, 1608, 1992, 2536, 3112, 3880, 4584, 5352, 6200,
257 6968, 7736, 8760, 9912, 11448, 12576, 13536, 14112, 15840,
258 17568, 19080, 20616, 22152, 23688, 25456, 26416, 28336, 32856},
259 {1256, 1608, 2024, 2600, 3240, 4008, 4776, 5544, 6200,
260 6968, 7992, 9144, 10296, 11448, 12960, 13536, 14688, 16416,
261 17568, 19080, 20616, 22920, 24496, 25456, 27376, 28336, 32856},
262 {1256, 1672, 2088, 2664, 3240, 4008, 4776, 5736, 6456,
263 7224, 7992, 9144, 10680, 11832, 12960, 14112, 14688, 16416,
264 18336, 19848, 21384, 22920, 24496, 26416, 28336, 29296, 34008},
265 {1288, 1736, 2088, 2728, 3368, 4136, 4968, 5736, 6456,
266 7480, 8248, 9528, 10680, 12216, 13536, 14688, 15264, 16992,
267 18336, 20616, 22152, 23688, 25456, 27376, 28336, 29296, 35160},
268 {1320, 1736, 2152, 2792, 3496, 4264, 4968, 5992, 6712,
269 7480, 8504, 9528, 11064, 12216, 13536, 14688, 15840, 17568,
270 19080, 20616, 22152, 24496, 25456, 27376, 29296, 30576, 35160},
271 {1352, 1800, 2216, 2856, 3496, 4392, 5160, 5992, 6968,
272 7736, 8504, 9912, 11064, 12576, 14112, 15264, 15840, 17568,
273 19080, 21384, 22920, 24496, 26416, 28336, 29296, 31704, 36696},
274 {1384, 1800, 2216, 2856, 3624, 4392, 5160, 6200, 6968,
275 7992, 8760, 9912, 11448, 12960, 14112, 15264, 16416, 18336,
276 19848, 21384, 22920, 25456, 27376, 28336, 30576, 31704, 36696},
277 {1416, 1864, 2280, 2984, 3624, 4584, 5352, 6200, 7224,
278 7992, 9144, 10296, 11832, 12960, 14688, 15840, 16416, 18336,
279 19848, 22152, 23688, 25456, 27376, 29296, 31704, 32856, 37888},
280 {1416, 1864, 2344, 2984, 3752, 4584, 5352, 6456, 7224,
281 8248, 9144, 10680, 11832, 13536, 14688, 15840, 16992, 19080,
282 20616, 22152, 24496, 26416, 28336, 29296, 31704, 32856, 37888},
283 {1480, 1928, 2344, 3112, 3752, 4776, 5544, 6456, 7480,
284 8248, 9144, 10680, 12216, 13536, 15264, 16416, 16992, 19080,
285 21384, 22920, 24496, 26416, 28336, 30576, 32856, 34008, 39232},
286 {1480, 1992, 2408, 3112, 3880, 4776, 5736, 6712, 7480,
287 8504, 9528, 11064, 12216, 14112, 15264, 16416, 17568, 19848,
288 21384, 22920, 25456, 27376, 29296, 30576, 32856, 34008, 40576},
289 {1544, 1992, 2472, 3240, 4008, 4776, 5736, 6712, 7736,
290 8760, 9528, 11064, 12576, 14112, 15840, 16992, 17568, 19848,
291 22152, 23688, 25456, 27376, 29296, 31704, 34008, 35160, 40576},
292 {1544, 2024, 2536, 3240, 4008, 4968, 5992, 6712, 7736,
293 8760, 9912, 11448, 12576, 14688, 15840, 16992, 18336, 20616,
294 22152, 24496, 26416, 28336, 30576, 31704, 34008, 35160, 40576},
295 {1608, 2088, 2536, 3368, 4136, 4968, 5992, 6968, 7992,
296 9144, 9912, 11448, 12960, 14688, 16416, 17568, 18336, 20616,
297 22920, 24496, 26416, 28336, 30576, 32856, 35160, 36696, 42368},
298 {1608, 2088, 2600, 3368, 4136, 5160, 5992, 6968, 7992,
299 9144, 10296, 11832, 12960, 14688, 16416, 17568, 19080, 20616,
300 22920, 25456, 27376, 29296, 31704, 32856, 35160, 36696, 42368},
301 {1608, 2152, 2664, 3496, 4264, 5160, 6200, 7224, 8248,
302 9144, 10296, 11832, 13536, 15264, 16992, 18336, 19080, 21384,
303 23688, 25456, 27376, 29296, 31704, 34008, 36696, 37888, 43816},
304 {1672, 2152, 2664, 3496, 4264, 5352, 6200, 7224, 8504,
305 9528, 10680, 12216, 13536, 15264, 16992, 18336, 19848, 21384,
306 23688, 25456, 28336, 30576, 32856, 34008, 36696, 37888, 43816},
307 {1672, 2216, 2728, 3624, 4392, 5352, 6456, 7480, 8504,
308 9528, 10680, 12216, 14112, 15840, 17568, 18336, 19848, 22152,
309 24496, 26416, 28336, 30576, 32856, 35160, 36696, 39232, 45352},
310 {1736, 2280, 2792, 3624, 4392, 5544, 6456, 7480, 8760,
311 9912, 11064, 12576, 14112, 15840, 17568, 19080, 19848, 22152,
312 24496, 26416, 29296, 31704, 34008, 35160, 37888, 39232, 45352},
313 {1736, 2280, 2856, 3624, 4584, 5544, 6456, 7736, 8760,
314 9912, 11064, 12576, 14112, 16416, 18336, 19080, 20616, 22920,
315 24496, 27376, 29296, 31704, 34008, 36696, 37888, 40576, 46888},
316 {1800, 2344, 2856, 3752, 4584, 5736, 6712, 7736, 9144,
317 10296, 11448, 12960, 14688, 16416, 18336, 19848, 20616, 22920,
318 25456, 27376, 29296, 31704, 34008, 36696, 39232, 40576, 46888},
319 {1800, 2344, 2856, 3752, 4584, 5736, 6712, 7992, 9144,
320 10296, 11448, 12960, 14688, 16992, 18336, 19848, 21384, 23688,
321 25456, 28336, 30576, 32856, 35160, 37888, 39232, 40576, 48936},
322 {1800, 2408, 2984, 3880, 4776, 5736, 6968, 7992, 9144,
323 10296, 11448, 13536, 15264, 16992, 19080, 20616, 21384, 23688,
324 26416, 28336, 30576, 32856, 35160, 37888, 40576, 42368, 48936},
325 {1864, 2472, 2984, 3880, 4776, 5992, 6968, 8248, 9528,
326 10680, 11832, 13536, 15264, 16992, 19080, 20616, 22152, 24496,
327 26416, 29296, 31704, 34008, 36696, 37888, 40576, 42368, 48936},
328 {1864, 2472, 3112, 4008, 4968, 5992, 6968, 8248, 9528,
329 10680, 11832, 13536, 15264, 17568, 19848, 20616, 22152, 24496,
330 27376, 29296, 31704, 34008, 36696, 39232, 42368, 43816, 51024},
331 {1928, 2536, 3112, 4008, 4968, 5992, 7224, 8504, 9528,
332 11064, 12216, 14112, 15840, 17568, 19848, 21384, 22152, 24496,
333 27376, 29296, 31704, 35160, 36696, 39232, 42368, 43816, 51024},
334 {1928, 2536, 3112, 4136, 4968, 6200, 7224, 8504, 9912,
335 11064, 12216, 14112, 15840, 18336, 19848, 21384, 22920, 25456,
336 27376, 30576, 32856, 35160, 37888, 40576, 42368, 43816, 52752},
337 {1992, 2600, 3240, 4136, 5160, 6200, 7480, 8760, 9912,
338 11064, 12576, 14112, 16416, 18336, 20616, 22152, 22920, 25456,
339 28336, 30576, 32856, 35160, 37888, 40576, 43816, 45352, 52752},
340 {1992, 2600, 3240, 4264, 5160, 6200, 7480, 8760, 9912,
341 11448, 12576, 14688, 16416, 18336, 20616, 22152, 23688, 26416,
342 28336, 30576, 34008, 36696, 39232, 40576, 43816, 45352, 52752},
343 {2024, 2664, 3240, 4264, 5160, 6456, 7736, 8760, 10296,
344 11448, 12960, 14688, 16416, 19080, 20616, 22152, 23688, 26416,
345 29296, 31704, 34008, 36696, 39232, 42368, 45352, 46888, 55056},
346 {2088, 2728, 3368, 4392, 5352, 6456, 7736, 9144, 10296,
347 11832, 12960, 14688, 16992, 19080, 21384, 22920, 24496, 26416,
348 29296, 31704, 34008, 36696, 40576, 42368, 45352, 46888, 55056},
349 {2088, 2728, 3368, 4392, 5352, 6712, 7736, 9144, 10680,
350 11832, 12960, 15264, 16992, 19080, 21384, 22920, 24496, 27376,
351 29296, 32856, 35160, 37888, 40576, 43816, 45352, 46888, 55056},
352 {2088, 2792, 3368, 4392, 5544, 6712, 7992, 9144, 10680,
353 11832, 13536, 15264, 17568, 19848, 22152, 23688, 24496, 27376,
354 30576, 32856, 35160, 37888, 40576, 43816, 46888, 48936, 55056},
355 {2152, 2792, 3496, 4584, 5544, 6712, 7992, 9528, 10680,
356 12216, 13536, 15840, 17568, 19848, 22152, 23688, 25456, 27376,
357 30576, 32856, 35160, 39232, 42368, 43816, 46888, 48936, 57336},
358 {2152, 2856, 3496, 4584, 5544, 6968, 8248, 9528, 11064,
359 12216, 13536, 15840, 17568, 19848, 22152, 23688, 25456, 28336,
360 30576, 34008, 36696, 39232, 42368, 45352, 46888, 48936, 57336},
361 {2216, 2856, 3496, 4584, 5736, 6968, 8248, 9528, 11064,
362 12576, 14112, 15840, 18336, 20616, 22920, 24496, 25456, 28336,
363 31704, 34008, 36696, 39232, 42368, 45352, 48936, 51024, 57336},
364 {2216, 2856, 3624, 4776, 5736, 6968, 8248, 9912, 11064,
365 12576, 14112, 16416, 18336, 20616, 22920, 24496, 26416, 29296,
366 31704, 34008, 36696, 40576, 43816, 45352, 48936, 51024, 59256},
367 {2280, 2984, 3624, 4776, 5736, 7224, 8504, 9912, 11448,
368 12960, 14112, 16416, 18336, 20616, 22920, 24496, 26416, 29296,
369 31704, 35160, 37888, 40576, 43816, 46888, 48936, 51024, 59256},
370 {2280, 2984, 3624, 4776, 5992, 7224, 8504, 9912, 11448,
371 12960, 14688, 16416, 19080, 21384, 23688, 25456, 26416, 29296,
372 32856, 35160, 37888, 40576, 43816, 46888, 51024, 52752, 59256},
373 {2280, 2984, 3752, 4776, 5992, 7224, 8760, 10296, 11448,
374 12960, 14688, 16992, 19080, 21384, 23688, 25456, 27376, 30576,
375 32856, 35160, 39232, 42368, 45352, 46888, 51024, 52752, 61664},
376 {2344, 3112, 3752, 4968, 5992, 7480, 8760, 10296, 11832,
377 13536, 14688, 16992, 19080, 21384, 24496, 25456, 27376, 30576,
378 32856, 36696, 39232, 42368, 45352, 48936, 51024, 52752, 61664},
379 {2344, 3112, 3880, 4968, 5992, 7480, 8760, 10296, 11832,
380 13536, 14688, 16992, 19080, 22152, 24496, 26416, 27376, 30576,
381 34008, 36696, 39232, 42368, 45352, 48936, 52752, 55056, 61664},
382 {2408, 3112, 3880, 4968, 6200, 7480, 9144, 10680, 12216,
383 13536, 15264, 17568, 19848, 22152, 24496, 26416, 28336, 30576,
384 34008, 36696, 40576, 43816, 46888, 48936, 52752, 55056, 63776},
385 {2408, 3240, 3880, 5160, 6200, 7736, 9144, 10680, 12216,
386 13536, 15264, 17568, 19848, 22152, 25456, 26416, 28336, 31704,
387 34008, 37888, 40576, 43816, 46888, 51024, 52752, 55056, 63776},
388 {2472, 3240, 4008, 5160, 6200, 7736, 9144, 10680, 12216,
389 14112, 15264, 17568, 19848, 22920, 25456, 27376, 28336, 31704,
390 35160, 37888, 40576, 43816, 46888, 51024, 52752, 55056, 63776},
391 {2472, 3240, 4008, 5160, 6456, 7736, 9144, 11064, 12576,
392 14112, 15840, 18336, 20616, 22920, 25456, 27376, 29296, 31704,
393 35160, 37888, 42368, 45352, 48936, 51024, 55056, 57336, 66592},
394 {2536, 3240, 4008, 5352, 6456, 7992, 9528, 11064, 12576,
395 14112, 15840, 18336, 20616, 22920, 25456, 27376, 29296, 32856,
396 35160, 39232, 42368, 45352, 48936, 51024, 55056, 57336, 66592},
397 {2536, 3368, 4136, 5352, 6456, 7992, 9528, 11064, 12576,
398 14112, 15840, 18336, 20616, 23688, 26416, 28336, 29296, 32856,
399 36696, 39232, 42368, 45352, 48936, 52752, 55056, 57336, 66592},
400 {2536, 3368, 4136, 5352, 6456, 7992, 9528, 11448, 12960,
401 14688, 16416, 18336, 21384, 23688, 26416, 28336, 30576, 32856,
402 36696, 39232, 42368, 46888, 48936, 52752, 57336, 59256, 68808},
403 {2600, 3368, 4136, 5352, 6712, 8248, 9528, 11448, 12960,
404 14688, 16416, 19080, 21384, 23688, 26416, 28336, 30576, 34008,
405 36696, 40576, 43816, 46888, 51024, 52752, 57336, 59256, 68808},
406 {2600, 3496, 4264, 5544, 6712, 8248, 9912, 11448, 12960,
407 14688, 16416, 19080, 21384, 24496, 27376, 29296, 30576, 34008,
408 37888, 40576, 43816, 46888, 51024, 55056, 57336, 59256, 68808},
409 {2664, 3496, 4264, 5544, 6712, 8248, 9912, 11448, 13536,
410 15264, 16992, 19080, 21384, 24496, 27376, 29296, 30576, 34008,
411 37888, 40576, 43816, 46888, 51024, 55056, 57336, 61664, 71112},
412 {2664, 3496, 4264, 5544, 6968, 8504, 9912, 11832, 13536,
413 15264, 16992, 19080, 22152, 24496, 27376, 29296, 31704, 35160,
414 37888, 40576, 45352, 48936, 51024, 55056, 59256, 61664, 71112},
415 {2728, 3496, 4392, 5736, 6968, 8504, 10296, 11832, 13536,
416 15264, 16992, 19848, 22152, 25456, 28336, 29296, 31704, 35160,
417 37888, 42368, 45352, 48936, 52752, 55056, 59256, 61664, 71112},
418 {2728, 3624, 4392, 5736, 6968, 8760, 10296, 11832, 13536,
419 15264, 16992, 19848, 22152, 25456, 28336, 30576, 31704, 35160,
420 39232, 42368, 45352, 48936, 52752, 57336, 59256, 61664, 73712},
421 {2728, 3624, 4392, 5736, 6968, 8760, 10296, 12216, 14112,
422 15840, 17568, 19848, 22920, 25456, 28336, 30576, 31704, 35160,
423 39232, 42368, 46888, 48936, 52752, 57336, 61664, 63776, 73712},
424 {2792, 3624, 4584, 5736, 7224, 8760, 10296, 12216, 14112,
425 15840, 17568, 19848, 22920, 25456, 28336, 30576, 32856, 36696,
426 39232, 43816, 46888, 51024, 55056, 57336, 61664, 63776, 75376},
427 {2792, 3752, 4584, 5992, 7224, 8760, 10680, 12216, 14112,
428 15840, 17568, 20616, 22920, 26416, 29296, 30576, 32856, 36696,
429 40576, 43816, 46888, 51024, 55056, 57336, 61664, 63776, 75376},
430 {2856, 3752, 4584, 5992, 7224, 9144, 10680, 12576, 14112,
431 16416, 18336, 20616, 23688, 26416, 29296, 31704, 32856, 36696,
432 40576, 43816, 46888, 51024, 55056, 59256, 61664, 63776, 75376},
433 {2856, 3752, 4584, 5992, 7480, 9144, 10680, 12576, 14688,
434 16416, 18336, 20616, 23688, 26416, 29296, 31704, 34008, 36696,
435 40576, 43816, 48936, 51024, 55056, 59256, 63776, 66592, 75376},
436 {2856, 3752, 4584, 5992, 7480, 9144, 10680, 12576, 14688,
437 16416, 18336, 21384, 23688, 26416, 29296, 31704, 34008, 37888,
438 40576, 45352, 48936, 52752, 57336, 59256, 63776, 66592, 75376},
439 {2984, 3880, 4776, 6200, 7480, 9144, 11064, 12960, 14688,
440 16416, 18336, 21384, 23688, 27376, 30576, 31704, 34008, 37888,
441 42368, 45352, 48936, 52752, 57336, 59256, 63776, 66592, 75376},
442 {2984, 3880, 4776, 6200, 7480, 9528, 11064, 12960, 14688,
443 16992, 18336, 21384, 24496, 27376, 30576, 32856, 34008, 37888,
444 42368, 45352, 48936, 52752, 57336, 61664, 63776, 66592, 75376},
445 {2984, 3880, 4776, 6200, 7736, 9528, 11064, 12960, 15264,
446 16992, 19080, 21384, 24496, 27376, 30576, 32856, 35160, 39232,
447 42368, 46888, 48936, 52752, 57336, 61664, 66592, 68808, 75376},
448 {2984, 4008, 4776, 6200, 7736, 9528, 11448, 12960, 15264,
449 16992, 19080, 22152, 24496, 27376, 30576, 32856, 35160, 39232,
450 42368, 46888, 51024, 55056, 59256, 61664, 66592, 68808, 75376},
451 {2984, 4008, 4968, 6456, 7736, 9528, 11448, 13536, 15264,
452 16992, 19080, 22152, 24496, 28336, 31704, 34008, 35160, 39232,
453 43816, 46888, 51024, 55056, 59256, 61664, 66592, 68808, 75376},
454 {3112, 4008, 4968, 6456, 7992, 9528, 11448, 13536, 15264,
455 17568, 19080, 22152, 25456, 28336, 31704, 34008, 35160, 39232,
456 43816, 46888, 51024, 55056, 59256, 63776, 66592, 71112, 75376},
476 "The requested BER in assigning MCS (default is 0.00005).",
479 MakeDoubleChecker<double>())
482 "AMC model used to assign CQI",
484 MakeEnumAccessor<AmcModel>(&LteAmc::m_amcModel),
485 MakeEnumChecker(LteAmc::MiErrorModel,
"Vienna", LteAmc::PiroEW2010,
"PiroEW2010"));
490 LteAmc::GetCqiFromSpectralEfficiency(
double s)
493 NS_ASSERT_MSG(s >= 0.0,
"negative spectral efficiency = " << s);
504 LteAmc::GetMcsFromCqi(
int cqi)
507 NS_ASSERT_MSG(cqi >= 0 && cqi <= 15,
"CQI must be in [0..15] = " << cqi);
519 LteAmc::GetDlTbSizeFromMcs(
int mcs,
int nprb)
531 LteAmc::GetUlTbSizeFromMcs(
int mcs,
int nprb)
543 LteAmc::GetSpectralEfficiencyFromCqi(
int cqi)
546 NS_ASSERT_MSG(cqi >= 0 && cqi <= 15,
"CQI must be in [0..15] = " << cqi);
556 std::vector<int> cqi;
558 if (m_amcModel == PiroEW2010)
562 double sinr_ = (*it);
577 double s = log2(1 + (sinr_ / ((-std::log(5.0 * m_ber)) / 1.5)));
579 int cqi_ = GetCqiFromSpectralEfficiency(s);
581 NS_LOG_LOGIC(
" PRB =" << cqi.size() <<
", sinr = " << sinr_
582 <<
" (=" << 10 * std::log10(sinr_) <<
" dB)"
583 <<
", spectral efficiency =" << s <<
", CQI = " << cqi_
584 <<
", BER = " << m_ber);
590 else if (m_amcModel == MiErrorModel)
592 NS_LOG_DEBUG(
this <<
" AMC-VIENNA RBG size " << (uint16_t)rbgSize);
593 NS_ASSERT_MSG(rbgSize > 0,
" LteAmc-Vienna: RBG size must be greater than 0");
594 std::vector<int> rbgMap;
598 rbgMap.push_back(rbId++);
606 tbStats = LteMiErrorModel::GetTbDecodificationStats(
609 (uint16_t)GetDlTbSizeFromMcs(mcs, rbgSize) / 8,
612 if (tbStats.
tbler > 0.1)
622 NS_LOG_DEBUG(
this <<
"\t RBG " << rbId <<
" MCS " << (uint16_t)mcs <<
" TBLER "
625 if ((tbStats.
tbler > 0.1) && (mcs == 0))
642 NS_LOG_DEBUG(
this <<
"\t MCS " << (uint16_t)mcs <<
"-> CQI " << rbgCqi);
644 for (uint8_t j = 0; j < rbgSize; j++)
646 cqi.push_back(rbgCqi);
This class can be used to hold variables of floating point type such as 'double' or 'float'.
Hold variables of type enum.
Implements the Adaptive Modulation And Coding Scheme.
A base class which provides memory management and object aggregation.
Set of values corresponding to a given SpectrumModel.
Values::const_iterator ConstValuesBegin() const
Values::const_iterator ConstValuesEnd() const
a unique identifier for an interface.
TypeId SetParent(TypeId tid)
Set the parent TypeId.
#define NS_ASSERT_MSG(condition, message)
At runtime, in debugging builds, if this condition is not true, the program prints the message to out...
#define NS_LOG_COMPONENT_DEFINE(name)
Define a Log component with a specific name.
#define NS_LOG_DEBUG(msg)
Use NS_LOG to output a message of level LOG_DEBUG.
#define NS_LOG_LOGIC(msg)
Use NS_LOG to output a message of level LOG_LOGIC.
#define NS_LOG_FUNCTION(parameters)
If log level LOG_FUNCTION is enabled, this macro will output all input parameters separated by ",...
#define NS_OBJECT_ENSURE_REGISTERED(type)
Register an Object subclass with the TypeId system.
Every class exported by the ns3 library is enclosed in the ns3 namespace.
static const int TransportBlockSizeTable[110][27]
Table of number of physical resource blocks (NPRB), TBS index (ITBS), and their associated transport ...
static const int McsToItbsUl[29]
Table of MCS index (IMCS) and its TBS index (ITBS).
Ptr< const AttributeChecker > MakeEnumChecker(T v, std::string n, Ts... args)
Make an EnumChecker pre-configured with a set of allowed values by name.
std::vector< HarqProcessInfoElement_t > HarqProcessInfoList_t
HarqProcessInfoList_t typedef.
Ptr< const AttributeAccessor > MakeDoubleAccessor(T1 a1)
static const double SpectralEfficiencyForCqi[16]
Table of CQI index and its spectral efficiency.
static const double SpectralEfficiencyForMcs[32]
Table of MCS index and its spectral efficiency.
static const int McsToItbsDl[29]
Table of MCS index (IMCS) and its TBS index (ITBS).
double tbler
Transport block BLER.