5G-LENA nr-v4.0
The 5G/NR module for the ns-3 simulator
Loading...
Searching...
No Matches
nr-mimo-chunk-processor.cc
1// Copyright (c) 2024 Centre Tecnologic de Telecomunicacions de Catalunya (CTTC)
2//
3// SPDX-License-Identifier: GPL-2.0-only
4
5#include "nr-mimo-chunk-processor.h"
6
7#include "ns3/log.h"
8
9namespace ns3
10{
11
12NS_LOG_COMPONENT_DEFINE("NrMimoChunkProcessor");
13
14void
16{
17 NS_LOG_FUNCTION(this);
18 m_sinrChunksCbs.push_back(cb);
19}
20
21void
23{
24 NS_LOG_FUNCTION(this);
25 m_signalChunksCbs.push_back(cb);
26}
27
28void
30{
31 NS_LOG_FUNCTION(this);
32 m_mimoSinrChunks.clear();
33 m_mimoSignalChunks.clear();
34}
35
36void
38{
39 NS_LOG_FUNCTION(this);
40 m_mimoSinrChunks.push_back(mimoSinr);
41}
42
43void
45{
46 NS_LOG_FUNCTION(this);
47 m_mimoSignalChunks.push_back(mimoSignal);
48}
49
50void
52{
53 NS_LOG_FUNCTION(this);
54
55 // Callbacks with a list of all SINR chunks seen in this slot
56 for (const auto& cb : m_sinrChunksCbs)
57 {
58 (cb)(m_mimoSinrChunks);
59 }
60 // Callbacks with a list of all signal chunks seen in this slot
61 for (const auto& cb : m_signalChunksCbs)
62 {
63 (cb)(m_mimoSignalChunks);
64 }
65}
66
67} // namespace ns3
void AddCallback(MimoSinrChunksCb cb)
Add a callback for processing received SINR values.
void EvaluateChunk(const MimoSinrChunk &mimoSinr)
Store the current MIMO SINR and duration.
void Start()
Start processing a transmission, clear internal variables.
void End()
Finish calculation and inform interested objects about calculated values.
MIMO signal information used to compute CQI feedback including rank and precoding matrix.
MIMO SINR used to compute the TBLER of a data transmission.