5G-LENA nr-v4.0-29-g6d8085cd
The 5G/NR module for the ns-3 simulator
Loading...
Searching...
No Matches
nr-mimo-matrices.h
1// Copyright (c) 2024 Centre Tecnologic de Telecomunicacions de Catalunya (CTTC)
2//
3// SPDX-License-Identifier: GPL-2.0-only
4
5#ifndef NR_MIMO_MATRICES_H
6#define NR_MIMO_MATRICES_H
7
8#include "ns3/matrix-array.h"
9#include "ns3/spectrum-value.h"
10
11namespace ns3
12{
13
14class NrIntfNormChanMat;
15class NrSinrMatrix;
16
21class NrCovMat : public ComplexMatrixArray
22{
23 public:
24 NrCovMat() = default;
25 NrCovMat(ComplexMatrixArray arr)
26 : ComplexMatrixArray(arr){};
27
30 virtual void AddInterferenceSignal(const ComplexMatrixArray& rhs);
31
34 virtual void SubtractInterferenceSignal(const ComplexMatrixArray& rhs);
35
40 virtual NrIntfNormChanMat CalcIntfNormChannel(const ComplexMatrixArray& chanMat) const;
41
42 private:
47 virtual NrIntfNormChanMat CalcIntfNormChannelMimo(const ComplexMatrixArray& chanMat) const;
48};
49
63class NrIntfNormChanMat : public ComplexMatrixArray
64{
65 public:
66 NrIntfNormChanMat() = default;
67 NrIntfNormChanMat(ComplexMatrixArray arr)
68 : ComplexMatrixArray(arr){};
69
73 virtual NrSinrMatrix ComputeSinrForPrecoding(const ComplexMatrixArray& precMats) const;
74
81
86 virtual uint8_t GetSasaokaWidebandRank() const;
87
93 virtual uint8_t GetWaterfillingWidebandRank(uint8_t maxRank, double thr) const;
97 virtual uint8_t GetEigenWidebandRank(double thr) const;
98
102 virtual std::vector<uint8_t> GetEigenSubbandRanks(double thr) const;
103
105 virtual ComplexMatrixArray ExtractOptimalPrecodingMatrices(uint8_t rank) const;
106
107 private:
111 virtual ComplexMatrixArray ComputeMse(const ComplexMatrixArray& precMats) const;
112
117 virtual ComplexMatrixArray ComputeMseMimo(const ComplexMatrixArray& precMats) const;
118};
119
121class NrSinrMatrix : public DoubleMatrixArray
122{
123 public:
124 NrSinrMatrix() = default;
125 NrSinrMatrix(DoubleMatrixArray arr)
126 : DoubleMatrixArray(arr){};
127 NrSinrMatrix(const std::valarray<double>& values)
128 : DoubleMatrixArray(values){};
129 NrSinrMatrix(uint8_t rank, size_t nRbs)
130 : DoubleMatrixArray(rank, nRbs){};
131
132 uint8_t GetRank() const;
133 size_t GetNumRbs() const;
137 SpectrumValue GetVectorizedSpecVal() const;
138};
139
140} // namespace ns3
141
142#endif // NR_MIMO_MATRICES_H
virtual NrIntfNormChanMat CalcIntfNormChannel(const ComplexMatrixArray &chanMat) const
Calculate the interference-normalized channel matrix for SISO and MIMO. See NrIntfNormChanMat for det...
virtual void SubtractInterferenceSignal(const ComplexMatrixArray &rhs)
virtual void AddInterferenceSignal(const ComplexMatrixArray &rhs)
virtual uint8_t GetWaterfillingWidebandRank(uint8_t maxRank, double thr) const
GetWaterfillingWidebandRank extracts the rank from an input channel matrix using the waterfilling tec...
virtual NrSinrMatrix ComputeSinrForPrecoding(const ComplexMatrixArray &precMats) const
Compute the MIMO SINR when a specific precoder is applied.
virtual ComplexMatrixArray ExtractOptimalPrecodingMatrices(uint8_t rank) const
ExtractOptimalPrecodingMatrices extracts optimal precoding matrices for a given rank.
virtual NrIntfNormChanMat GetWidebandChannel() const
Compute the average received signal parameters (channel and interference matrix) between the differen...
virtual std::vector< uint8_t > GetEigenSubbandRanks(double thr) const
GetEigenSubbandRanks extracts the rank from an input channel matrix.
virtual uint8_t GetSasaokaWidebandRank() const
GetSasaokaWidebandRank extracts the rank from an input channel matrix using Sasaoka's increment of ca...
virtual uint8_t GetEigenWidebandRank(double thr) const
GetEigenWidebandRank extracts the rank from an input channel matrix.
NrSinrMatrix stores the MIMO SINR matrix, with dimension rank x nRbs.
SpectrumValue GetVectorizedSpecVal() const
Linearize a 2D matrix into a vector, and convert that vector to a SpectrumValue Matches layer-to-code...