A Discrete-Event Network Simulator
API
Loading...
Searching...
No Matches
three-gpp-channel-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_CHANNEL_H
22#define THREE_GPP_CHANNEL_H
23
24#include "ns3/angles.h"
25#include <ns3/boolean.h>
26#include <ns3/channel-condition-model.h>
27#include <ns3/matrix-based-channel-model.h>
28
29#include <complex.h>
30#include <unordered_map>
31
32namespace ns3
33{
34
35class MobilityModel;
36
47{
48 public:
53
57 ~ThreeGppChannelModel() override;
58
59 void DoDispose() override;
60
65 static TypeId GetTypeId();
66
72
78
83 void SetFrequency(double f);
84
89 double GetFrequency() const;
90
95 void SetScenario(const std::string& scenario);
96
101 std::string GetScenario() const;
102
118 Ptr<const PhasedArrayModel> bAntenna) override;
119
129 Ptr<const MobilityModel> bMob) const override;
137 int64_t AssignStreams(int64_t stream);
138
139 protected:
153 static std::pair<double, double> WrapAngles(double azimuthRad, double inclinationRad);
154
160 void Shuffle(double* first, double* last) const;
161
167 {
172 // TODO these are not currently used, they have to be correctly set when including the
173 // spatial consistent update procedure
174 /*The following parameters are stored for spatial consistent updating. The notation is
175 that of 3GPP technical reports, but it can apply also to other channel realizations*/
177 Vector m_preLocUT;
178 Vector m_locUT;
183 double m_DS;
184 double m_K_factor;
197 Vector m_speed;
198 double m_dis2D;
199 double m_dis3D;
202 uint8_t m_cluster1st;
203 uint8_t m_cluster2nd;
204 };
205
210 struct ParamsTable : public SimpleRefCount<ParamsTable>
211 {
212 uint8_t m_numOfCluster = 0;
213 uint8_t m_raysPerCluster = 0;
214 double m_uLgDS = 0;
215 double m_sigLgDS = 0;
216 double m_uLgASD =
217 0;
218 double m_sigLgASD =
219 0;
220 double m_uLgASA = 0;
221 double m_sigLgASA =
222 0;
223 double m_uLgZSA = 0;
224 double m_sigLgZSA =
225 0;
226 double m_uLgZSD =
227 0;
228 double m_sigLgZSD =
229 0;
230 double m_offsetZOD = 0;
231 double m_cDS = 0;
232 double m_cASD = 0;
233 double m_cASA = 0;
234 double m_cZSA = 0;
235 double m_uK = 0;
236 double m_sigK = 0;
237 double m_rTau = 0;
238 double m_uXpr = 0;
239 double m_sigXpr = 0;
241 double m_sqrtC[7][7];
243 };
244
254 double hBS,
255 double hUT,
256 double distance2D) const;
257
281 const Ptr<const ChannelCondition> channelCondition,
282 const Ptr<const ParamsTable> table3gpp,
283 const Ptr<const MobilityModel> aMob,
284 const Ptr<const MobilityModel> bMob) const;
285
301 Ptr<const ParamsTable> table3gpp,
302 const Ptr<const MobilityModel> sMob,
303 const Ptr<const MobilityModel> uMob,
305 Ptr<const PhasedArrayModel> uAntenna) const;
315 const DoubleVector& clusterAOA,
316 const DoubleVector& clusterZOA) const;
317
325 Ptr<const ChannelCondition> channelCondition) const;
326
335 Ptr<const ChannelMatrix> channelMatrix);
336
337 std::unordered_map<uint64_t, Ptr<ChannelMatrix>>
341 std::unordered_map<uint64_t, Ptr<ThreeGppChannelParams>>
346 double m_frequency;
347 std::string m_scenario;
353
354 // Variable used to compute the additional Doppler contribution for the delayed
355 // (reflected) paths, as described in 3GPP TR 37.885 v15.3.0, Sec. 6.2.3.
356 double m_vScatt;
360
361 // parameters for the blockage model
366
367 static const uint8_t PHI_INDEX = 0;
368 static const uint8_t X_INDEX = 1;
369 static const uint8_t THETA_INDEX =
370 2;
371 static const uint8_t Y_INDEX = 3;
372 static const uint8_t R_INDEX = 4;
373};
374} // namespace ns3
375
376#endif /* THREE_GPP_CHANNEL_H */
double f(double x, void *params)
Definition: 80211b.c:70
O2iConditionValue
Possible values for Outdoor to Indoor condition.
LosConditionValue
Possible values for Line-of-Sight condition.
This is an interface for a channel model that can be described by a channel matrix,...
std::vector< double > DoubleVector
Type definition for vectors of doubles.
std::vector< Double2DVector > Double3DVector
Type definition for 3D matrices of doubles.
std::vector< DoubleVector > Double2DVector
Type definition for matrices of doubles.
Smart pointer class similar to boost::intrusive_ptr.
Definition: ptr.h:78
A template-based reference counting class.
Channel Matrix Generation following 3GPP TR 38.901.
DoubleVector CalcAttenuationOfBlockage(const Ptr< ThreeGppChannelModel::ThreeGppChannelParams > channelParams, const DoubleVector &clusterAOA, const DoubleVector &clusterZOA) const
Applies the blockage model A described in 3GPP TR 38.901.
int64_t AssignStreams(int64_t stream)
Assign a fixed random variable stream number to the random variables used by this model.
bool m_portraitMode
true if portrait mode, false if landscape
bool ChannelParamsNeedsUpdate(Ptr< const ThreeGppChannelParams > channelParams, Ptr< const ChannelCondition > channelCondition) const
Check if the channel params has to be updated.
virtual Ptr< const ParamsTable > GetThreeGppTable(Ptr< const ChannelCondition > channelCondition, double hBS, double hUT, double distance2D) const
Get the parameters needed to apply the channel generation procedure.
Ptr< NormalRandomVariable > m_normalRv
normal random variable
static const uint8_t Y_INDEX
index of the Y value in the m_nonSelfBlocking array
bool m_blockage
enables the blockage model A
Ptr< const ChannelParams > GetParams(Ptr< const MobilityModel > aMob, Ptr< const MobilityModel > bMob) const override
Looks for the channel params associated to the aMob and bMob pair in m_channelParamsMap.
~ThreeGppChannelModel() override
Destructor.
bool ChannelMatrixNeedsUpdate(Ptr< const ThreeGppChannelParams > channelParams, Ptr< const ChannelMatrix > channelMatrix)
Check if the channel matrix has to be updated (it needs update when the channel params generation tim...
static const uint8_t THETA_INDEX
index of the THETA value in the m_nonSelfBlocking array
std::unordered_map< uint64_t, Ptr< ThreeGppChannelParams > > m_channelParamsMap
map containing the common channel parameters per pair of nodes, the key of this map is reciprocal and...
static std::pair< double, double > WrapAngles(double azimuthRad, double inclinationRad)
Wrap an (azimuth, inclination) angle pair in a valid range.
double m_blockerSpeed
the blocker speed
Ptr< const ChannelMatrix > GetChannel(Ptr< const MobilityModel > aMob, Ptr< const MobilityModel > bMob, Ptr< const PhasedArrayModel > aAntenna, Ptr< const PhasedArrayModel > bAntenna) override
Looks for the channel matrix associated to the aMob and bMob pair in m_channelMatrixMap.
void SetFrequency(double f)
Sets the center frequency of the model.
std::unordered_map< uint64_t, Ptr< ChannelMatrix > > m_channelMatrixMap
map containing the channel realizations per pair of PhasedAntennaArray instances, the key of this map...
Ptr< UniformRandomVariable > m_uniformRv
uniform random variable
void DoDispose() override
Destructor implementation.
void SetScenario(const std::string &scenario)
Sets the propagation scenario.
void SetChannelConditionModel(Ptr< ChannelConditionModel > model)
Set the channel condition model.
Ptr< UniformRandomVariable > m_uniformRvDoppler
uniform random variable, used to compute the additional Doppler contribution
uint16_t m_numNonSelfBlocking
number of non-self-blocking regions
std::string GetScenario() const
Returns the propagation scenario.
virtual Ptr< ChannelMatrix > GetNewChannel(Ptr< const ThreeGppChannelParams > channelParams, Ptr< const ParamsTable > table3gpp, const Ptr< const MobilityModel > sMob, const Ptr< const MobilityModel > uMob, Ptr< const PhasedArrayModel > sAntenna, Ptr< const PhasedArrayModel > uAntenna) const
Compute the channel matrix between two nodes a and b, and their antenna arrays aAntenna and bAntenna ...
static const uint8_t PHI_INDEX
index of the PHI value in the m_nonSelfBlocking array
double m_frequency
the operating frequency
double m_vScatt
value used to compute the additional Doppler contribution for the delayed paths
Ptr< ChannelConditionModel > GetChannelConditionModel() const
Get the associated channel condition model.
Ptr< ChannelConditionModel > m_channelConditionModel
the channel condition model
std::string m_scenario
the 3GPP scenario
static const uint8_t R_INDEX
index of the R value in the m_nonSelfBlocking array
static TypeId GetTypeId()
Get the type ID.
void Shuffle(double *first, double *last) const
Shuffle the elements of a simple sequence container of type double.
Ptr< ThreeGppChannelParams > GenerateChannelParameters(const Ptr< const ChannelCondition > channelCondition, const Ptr< const ParamsTable > table3gpp, const Ptr< const MobilityModel > aMob, const Ptr< const MobilityModel > bMob) const
Prepare 3gpp channel parameters among the nodes a and b.
double GetFrequency() const
Returns the center frequency.
Time m_updatePeriod
the channel update period
static const uint8_t X_INDEX
index of the X value in the m_nonSelfBlocking array
Ptr< UniformRandomVariable > m_uniformRvShuffle
uniform random variable used to shuffle array in GetNewChannel
Simulation virtual time values and global simulation resolution.
Definition: nstime.h:105
a unique identifier for an interface.
Definition: type-id.h:59
Definition: first.py:1
Every class exported by the ns3 library is enclosed in the ns3 namespace.
Data structure that stores channel parameters.
Data structure that stores the parameters of 3GPP TR 38.901, Table 7.5-6, for a certain scenario.
double m_sqrtC[7][7]
The square root matrix and follows the order of [SF, K, DS, ASD, ASA, ZSD, ZSA].
double m_sigLgZSD
Standard deviation of 10-base logarithm of zenith angle spread of departure.
double m_cASD
Cluster ASD (Azimuth angle Spread of Departure)
double m_uLgZSD
Mean value of 10-base logarithm of zenith angle spread of departure.
double m_uLgASA
Mean value of 10-base logarithm of azimuth angle spread of arrival.
double m_sigXpr
Standard deviation of Cross-Polarization Ratio.
double m_uLgASD
Mean value of 10-base logarithm of azimuth angle spread of departure.
double m_cASA
Cluster ASA (Azimuth angle Spread of Arrival)
uint8_t m_raysPerCluster
Number of rays per cluster.
double m_sigK
Standard deviation of K-factor.
double m_perClusterShadowingStd
Per cluster shadowing standard deviation.
double m_sigLgASD
Standard deviation of 10-base logarithm of azimuth angle spread of departure.
double m_offsetZOD
Offset of zenith angle of departure.
double m_uLgDS
Mean value of 10-base logarithm of delay spread.
double m_sigLgASA
Standard deviation of 10-base logarithm of azimuth angle spread of arrival.
double m_uLgZSA
Mean value of 10-base logarithm of zenith angle spread of arrival.
double m_cZSA
Cluster ZSA (Zenith angle Spread of Arrival)
double m_sigLgZSA
Standard deviation of 10-base logarithm of zenith angle spread of arrival.
double m_uXpr
Mean of Cross-Polarization Ratio.
double m_sigLgDS
Standard deviation value of 10-base logarithm of delay spread.
Extends the struct ChannelParams by including information that is used within the ThreeGppChannelMode...
MatrixBasedChannelModel::Double2DVector m_rayAoaRadian
the vector containing AOA angles
MatrixBasedChannelModel::Double3DVector m_clusterPhase
the initial random phases
MatrixBasedChannelModel::Double2DVector m_norRvAngles
stores the normal variable for random angles angle[cluster][id] generated for equation (7....
ChannelCondition::LosConditionValue m_losCondition
contains the information about the LOS state of the channel
MatrixBasedChannelModel::Double2DVector m_rayZodRadian
the vector containing ZOD angles
ChannelCondition::O2iConditionValue m_o2iCondition
contains the information about the O2I state of the channel
MatrixBasedChannelModel::Double2DVector m_rayAodRadian
the vector containing AOD angles
DoubleVector m_attenuation_dB
vector that stores the attenuation of the blockage
Vector m_preLocUT
location of UT when generating the previous channel
MatrixBasedChannelModel::Double2DVector m_rayZoaRadian
the vector containing ZOA angles
MatrixBasedChannelModel::Double2DVector m_nonSelfBlocking
store the blockages
uint8_t m_cluster1st
index of the first strongest cluster
MatrixBasedChannelModel::Double2DVector m_crossPolarizationPowerRatios
cross polarization power ratios
uint8_t m_cluster2nd
index of the second strongest cluster