A Discrete-Event Network Simulator
API
Loading...
Searching...
No Matches
three-gpp-spectrum-propagation-loss-model.h
Go to the documentation of this file.
1/*
2 * Copyright (c) 2015, NYU WIRELESS, Tandon School of Engineering,
3 * New York University
4 * Copyright (c) 2019 SIGNET Lab, Department of Information Engineering,
5 * University of Padova
6 *
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License version 2 as
9 * published by the Free Software Foundation;
10 *
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
15 *
16 * You should have received a copy of the GNU General Public License
17 * along with this program; if not, write to the Free Software
18 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
19 */
20
21#ifndef THREE_GPP_SPECTRUM_PROPAGATION_LOSS_H
22#define THREE_GPP_SPECTRUM_PROPAGATION_LOSS_H
23
26
27#include "ns3/random-variable-stream.h"
28
29#include <complex.h>
30#include <map>
31#include <unordered_map>
32
35
36namespace ns3
37{
38
39class NetDevice;
40
56{
57 friend class ::ThreeGppCalcLongTermMultiPortTest;
58 friend class ::ThreeGppMimoPolarizationTest;
59
60 public:
65
70
71 void DoDispose() override;
72
77 static TypeId GetTypeId();
78
84
90
97 void SetChannelModelAttribute(const std::string& name, const AttributeValue& value);
98
105 void GetChannelModelAttribute(const std::string& name, AttributeValue& value) const;
106
129 Ptr<const SpectrumSignalParameters> spectrumSignalParams,
132 Ptr<const PhasedArrayModel> aPhasedArrayModel,
133 Ptr<const PhasedArrayModel> bPhasedArrayModel) const override;
134
135 protected:
139 struct LongTerm : public SimpleRefCount<LongTerm>
140 {
149 };
150
164 Ptr<SpectrumValue> inPsd,
169 uint8_t numTxPorts,
170 uint8_t numRxPorts,
171 bool isReverse) const;
172
177 double GetFrequency() const;
178
190 Ptr<const PhasedArrayModel> aPhasedArrayModel,
191 Ptr<const PhasedArrayModel> bPhasedArrayModel) const;
202 Ptr<const PhasedArrayModel> uAnt) const;
203
215 std::complex<double> CalculateLongTermComponent(
219 uint16_t sPortIdx,
220 uint16_t uPortIdx,
221 uint16_t cIndex) const;
222
241 const Vector& sSpeed,
242 const Vector& uSpeed,
243 uint8_t numTxPorts,
244 uint8_t numRxPorts,
245 bool isReverse) const;
246
247 int64_t DoAssignStreams(int64_t stream) override;
248
249 mutable std::unordered_map<uint64_t, Ptr<const LongTerm>>
252};
253} // namespace ns3
254
255#endif /* THREE_GPP_SPECTRUM_PROPAGATION_LOSS_H */
Test case that test the correct use of the multi-port antennas in spectrum.
This test tests that the channel matrix is correctly generated when dual-polarized antennas are being...
Hold a value for an Attribute.
Definition: attribute.h:70
MatrixArray class inherits ValArray class and provides additional interfaces to ValArray which enable...
Definition: matrix-array.h:83
spectrum-aware propagation loss model that is compatible with PhasedArrayModel type of ns-3 antenna
Smart pointer class similar to boost::intrusive_ptr.
Definition: ptr.h:77
A template-based reference counting class.
void GetChannelModelAttribute(const std::string &name, AttributeValue &value) const
Returns the value of an attribute belonging to the associated MatrixBasedChannelModel instance.
Ptr< SpectrumSignalParameters > DoCalcRxPowerSpectralDensity(Ptr< const SpectrumSignalParameters > spectrumSignalParams, Ptr< const MobilityModel > a, Ptr< const MobilityModel > b, Ptr< const PhasedArrayModel > aPhasedArrayModel, Ptr< const PhasedArrayModel > bPhasedArrayModel) const override
Computes the received PSD.
Ptr< MatrixBasedChannelModel > m_channelModel
the model to generate the channel matrix
Ptr< MatrixBasedChannelModel::Complex3DVector > GenSpectrumChannelMatrix(Ptr< SpectrumValue > inPsd, Ptr< const MatrixBasedChannelModel::Complex3DVector > longTerm, Ptr< const MatrixBasedChannelModel::ChannelMatrix > channelMatrix, Ptr< const MatrixBasedChannelModel::ChannelParams > channelParams, PhasedArrayModel::ComplexVector doppler, uint8_t numTxPorts, uint8_t numRxPorts, bool isReverse) const
Computes the frequency-domain channel matrix with the dimensions numRxPorts*numTxPorts*numRBs.
Ptr< const MatrixBasedChannelModel::Complex3DVector > GetLongTerm(Ptr< const MatrixBasedChannelModel::ChannelMatrix > channelMatrix, Ptr< const PhasedArrayModel > aPhasedArrayModel, Ptr< const PhasedArrayModel > bPhasedArrayModel) const
Looks for the long term component in m_longTermMap.
void SetChannelModel(Ptr< MatrixBasedChannelModel > channel)
Set the channel model object.
Ptr< const MatrixBasedChannelModel::Complex3DVector > CalcLongTerm(Ptr< const MatrixBasedChannelModel::ChannelMatrix > channelMatrix, Ptr< const PhasedArrayModel > sAnt, Ptr< const PhasedArrayModel > uAnt) const
Computes the long term component.
std::unordered_map< uint64_t, Ptr< const LongTerm > > m_longTermMap
map containing the long term components
int64_t DoAssignStreams(int64_t stream) override
Assign a fixed random variable stream number to the random variables used by this model.
void SetChannelModelAttribute(const std::string &name, const AttributeValue &value)
Sets the value of an attribute belonging to the associated MatrixBasedChannelModel instance.
Ptr< MatrixBasedChannelModel > GetChannelModel() const
Get the channel model object.
Ptr< SpectrumSignalParameters > CalcBeamformingGain(Ptr< const SpectrumSignalParameters > params, Ptr< const MatrixBasedChannelModel::Complex3DVector > longTerm, Ptr< const MatrixBasedChannelModel::ChannelMatrix > channelMatrix, Ptr< const MatrixBasedChannelModel::ChannelParams > channelParams, const Vector &sSpeed, const Vector &uSpeed, uint8_t numTxPorts, uint8_t numRxPorts, bool isReverse) const
Computes the beamforming gain and applies it to the TX PSD.
std::complex< double > CalculateLongTermComponent(Ptr< const MatrixBasedChannelModel::ChannelMatrix > params, Ptr< const PhasedArrayModel > sAnt, Ptr< const PhasedArrayModel > uAnt, uint16_t sPortIdx, uint16_t uPortIdx, uint16_t cIndex) const
Computes a longTerm component from a specific port of s device to the specific port of u device and f...
a unique identifier for an interface.
Definition: type-id.h:59
Every class exported by the ns3 library is enclosed in the ns3 namespace.
Data structure that stores the long term component for a tx-rx pair.
Ptr< const MatrixBasedChannelModel::Complex3DVector > m_longTerm
vector containing the long term component for each cluster
PhasedArrayModel::ComplexVector m_uW
the beamforming vector for the node u used to compute the long term
Ptr< const MatrixBasedChannelModel::ChannelMatrix > m_channel
pointer to the channel matrix used to compute the long term
PhasedArrayModel::ComplexVector m_sW
the beamforming vector for the node s used to compute the long term