Channel Matrix Generation following 3GPP TR 38.901. More...
#include "three-gpp-channel-model.h"
Classes | |
struct | ParamsTable |
Data structure that stores the parameters of 3GPP TR 38.901, Table 7.5-6, for a certain scenario. More... | |
struct | ThreeGppChannelMatrix |
Extends the struct ChannelMatrix by including information that are used within the class ThreeGppChannelModel. More... | |
Public Member Functions | |
ThreeGppChannelModel () | |
Constructor. More... | |
~ThreeGppChannelModel () | |
Destructor. More... | |
int64_t | AssignStreams (int64_t stream) |
Assign a fixed random variable stream number to the random variables used by this model. More... | |
void | DoDispose () override |
Destructor implementation. More... | |
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_channelMap. More... | |
Ptr< ChannelConditionModel > | GetChannelConditionModel () const |
Get the associated channel condition model. More... | |
double | GetFrequency (void) const |
Returns the center frequency. More... | |
std::string | GetScenario (void) const |
Returns the propagation scenario. More... | |
void | SetChannelConditionModel (Ptr< ChannelConditionModel > model) |
Set the channel condition model. More... | |
void | SetFrequency (double f) |
Sets the center frequency of the model. More... | |
void | SetScenario (const std::string &scenario) |
Sets the propagation scenario. More... | |
![]() | |
virtual | ~MatrixBasedChannelModel () |
Destructor for MatrixBasedChannelModel. More... | |
![]() | |
Object () | |
Constructor. More... | |
virtual | ~Object () |
Destructor. More... | |
void | AggregateObject (Ptr< Object > other) |
Aggregate two Objects together. More... | |
void | Dispose (void) |
Dispose of this Object. More... | |
AggregateIterator | GetAggregateIterator (void) const |
Get an iterator to the Objects aggregated to this one. More... | |
virtual TypeId | GetInstanceTypeId (void) const |
Get the most derived TypeId for this Object. More... | |
template<> | |
Ptr< Object > | GetObject () const |
Specialization of () for objects of type ns3::Object. More... | |
template<typename T > | |
Ptr< T > | GetObject (TypeId tid) const |
Get a pointer to the requested aggregated Object by TypeId. More... | |
template<> | |
Ptr< Object > | GetObject (TypeId tid) const |
Specialization of (TypeId tid) for objects of type ns3::Object. More... | |
template<typename T > | |
Ptr< T > | GetObject (void) const |
Get a pointer to the requested aggregated Object. More... | |
void | Initialize (void) |
Invoke DoInitialize on all Objects aggregated to this one. More... | |
bool | IsInitialized (void) const |
Check if the object has been initialized. More... | |
![]() | |
SimpleRefCount () | |
Default constructor. More... | |
SimpleRefCount (const SimpleRefCount &o) | |
Copy constructor. More... | |
uint32_t | GetReferenceCount (void) const |
Get the reference count of the object. More... | |
SimpleRefCount & | operator= (const SimpleRefCount &o) |
Assignment operator. More... | |
void | Ref (void) const |
Increment the reference count. More... | |
void | Unref (void) const |
Decrement the reference count. More... | |
![]() | |
virtual | ~ObjectBase () |
Virtual destructor. More... | |
void | GetAttribute (std::string name, AttributeValue &value) const |
Get the value of an attribute, raising fatal errors if unsuccessful. More... | |
bool | GetAttributeFailSafe (std::string name, AttributeValue &value) const |
Get the value of an attribute without raising erros. More... | |
void | SetAttribute (std::string name, const AttributeValue &value) |
Set a single attribute, raising fatal errors if unsuccessful. More... | |
bool | SetAttributeFailSafe (std::string name, const AttributeValue &value) |
Set a single attribute without raising errors. More... | |
bool | TraceConnect (std::string name, std::string context, const CallbackBase &cb) |
Connect a TraceSource to a Callback with a context. More... | |
bool | TraceConnectWithoutContext (std::string name, const CallbackBase &cb) |
Connect a TraceSource to a Callback without a context. More... | |
bool | TraceDisconnect (std::string name, std::string context, const CallbackBase &cb) |
Disconnect from a TraceSource a Callback previously connected with a context. More... | |
bool | TraceDisconnectWithoutContext (std::string name, const CallbackBase &cb) |
Disconnect from a TraceSource a Callback previously connected without a context. More... | |
Static Public Member Functions | |
static TypeId | GetTypeId () |
Get the type ID. More... | |
![]() | |
static constexpr uint32_t | GetKey (uint32_t x1, uint32_t x2) |
Calculate the channel key using the Cantor function. More... | |
![]() | |
static TypeId | GetTypeId (void) |
Register this type. More... | |
![]() | |
static TypeId | GetTypeId (void) |
Get the type ID. More... | |
Private Member Functions | |
DoubleVector | CalcAttenuationOfBlockage (Ptr< ThreeGppChannelMatrix > params, const DoubleVector &clusterAOA, const DoubleVector &clusterZOA) const |
Applies the blockage model A described in 3GPP TR 38.901. More... | |
bool | ChannelMatrixNeedsUpdate (Ptr< const ThreeGppChannelMatrix > channelMatrix, Ptr< const ChannelCondition > channelCondition) const |
Check if the channel matrix has to be updated. More... | |
Ptr< ThreeGppChannelMatrix > | GetNewChannel (Vector locUT, Ptr< const ChannelCondition > channelCondition, Ptr< const PhasedArrayModel > sAntenna, Ptr< const PhasedArrayModel > uAntenna, Angles &uAngle, Angles &sAngle, double dis2D, double hBS, double hUT) const |
Compute the channel matrix between two devices using the procedure described in 3GPP TR 38.901. More... | |
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. More... | |
void | Shuffle (double *first, double *last) const |
Shuffle the elements of a simple sequence container of type double. More... | |
Static Private Member Functions | |
static std::pair< double, double > | WrapAngles (double azimuthRad, double inclinationRad) |
Wrap an (azimuth, inclination) angle pair in a valid range. More... | |
Private Attributes | |
bool | m_blockage |
enables the blockage model A More... | |
double | m_blockerSpeed |
the blocker speed More... | |
Ptr< ChannelConditionModel > | m_channelConditionModel |
the channel condition model More... | |
std::unordered_map< uint32_t, Ptr< ThreeGppChannelMatrix > > | m_channelMap |
map containing the channel realizations More... | |
double | m_frequency |
the operating frequency More... | |
Ptr< NormalRandomVariable > | m_normalRv |
normal random variable More... | |
uint16_t | m_numNonSelfBlocking |
number of non-self-blocking regions More... | |
bool | m_portraitMode |
true if potrait mode, false if landscape More... | |
std::string | m_scenario |
the 3GPP scenario More... | |
Ptr< UniformRandomVariable > | m_uniformRv |
uniform random variable More... | |
Ptr< UniformRandomVariable > | m_uniformRvShuffle |
uniform random variable used to shuffle array in GetNewChannel More... | |
Time | m_updatePeriod |
the channel update period More... | |
Static Private Attributes | |
static const uint8_t | PHI_INDEX = 0 |
index of the PHI value in the m_nonSelfBlocking array More... | |
static const uint8_t | R_INDEX = 4 |
index of the R value in the m_nonSelfBlocking array More... | |
static const uint8_t | THETA_INDEX = 2 |
index of the THETA value in the m_nonSelfBlocking array More... | |
static const uint8_t | X_INDEX = 1 |
index of the X value in the m_nonSelfBlocking array More... | |
static const uint8_t | Y_INDEX = 3 |
index of the Y value in the m_nonSelfBlocking array More... | |
Additional Inherited Members | |
![]() | |
typedef std::vector< PhasedArrayModel::ComplexVector > | Complex2DVector |
type definition for complex matrices More... | |
typedef std::vector< Complex2DVector > | Complex3DVector |
type definition for complex 3D matrices More... | |
typedef std::vector< DoubleVector > | Double2DVector |
type definition for matrices of doubles More... | |
typedef std::vector< Double2DVector > | Double3DVector |
type definition for 3D matrices of doubles More... | |
typedef std::vector< double > | DoubleVector |
type definition for vectors of doubles More... | |
![]() | |
static const uint8_t | AOA_INDEX = 0 |
index of the AOA value in the m_angle array More... | |
static const uint8_t | AOD_INDEX = 2 |
index of the AOD value in the m_angle array More... | |
static const uint8_t | ZOA_INDEX = 1 |
index of the ZOA value in the m_angle array More... | |
static const uint8_t | ZOD_INDEX = 3 |
index of the ZOD value in the m_angle array More... | |
![]() | |
Object (const Object &o) | |
Copy an Object. More... | |
virtual void | DoInitialize (void) |
Initialize() implementation. More... | |
virtual void | NotifyNewAggregate (void) |
Notify all Objects aggregated to this one of a new Object being aggregated. More... | |
![]() | |
void | ConstructSelf (const AttributeConstructionList &attributes) |
Complete construction of ObjectBase; invoked by derived classes. More... | |
virtual void | NotifyConstructionCompleted (void) |
Notifier called once the ObjectBase is fully constructed. More... | |
![]() | |
static TypeId | GetObjectIid (void) |
Ensure the TypeId for ObjectBase gets fully configured to anchor the inheritance tree properly. More... | |
Channel Matrix Generation following 3GPP TR 38.901.
Introspection did not find any typical Config paths.
The class implements the channel matrix generation procedure described in 3GPP TR 38.901.
No TraceSources are defined for this type.
Size of this type is 184 bytes (on a 64-bit architecture).
Definition at line 48 of file three-gpp-channel-model.h.
ns3::ThreeGppChannelModel::ThreeGppChannelModel | ( | ) |
Constructor.
Definition at line 163 of file three-gpp-channel-model.cc.
References m_normalRv, m_uniformRv, m_uniformRvShuffle, and NS_LOG_FUNCTION.
ns3::ThreeGppChannelModel::~ThreeGppChannelModel | ( | ) |
int64_t ns3::ThreeGppChannelModel::AssignStreams | ( | int64_t | stream | ) |
Assign a fixed random variable stream number to the random variables used by this model.
stream | first stream index to use |
Definition at line 2014 of file three-gpp-channel-model.cc.
References m_normalRv, m_uniformRv, m_uniformRvShuffle, NS_LOG_FUNCTION, and ns3::RandomVariableStream::SetStream().
|
private |
Applies the blockage model A described in 3GPP TR 38.901.
params | the channel matrix |
clusterAOA | vector containing the azimuth angle of arrival for each cluster |
clusterZOA | vector containing the zenith angle of arrival for each cluster |
Definition at line 1784 of file three-gpp-channel-model.cc.
References ns3::DegreesToRadians(), ns3::UniformRandomVariable::GetValue(), m_blockerSpeed, m_frequency, m_normalRv, m_numNonSelfBlocking, m_portraitMode, m_scenario, m_uniformRv, ns3::Now(), NS_ASSERT_MSG, NS_LOG_FUNCTION, NS_LOG_INFO, PHI_INDEX, R_INDEX, THETA_INDEX, X_INDEX, and Y_INDEX.
Referenced by GetNewChannel().
|
private |
Check if the channel matrix has to be updated.
channelMatrix | channel matrix |
channelCondition | the channel condition |
Definition at line 947 of file three-gpp-channel-model.cc.
References ns3::Time::IsZero(), m_updatePeriod, ns3::Now(), ns3::Simulator::Now(), ns3::Time::NS, NS_LOG_DEBUG, and NS_LOG_FUNCTION.
Referenced by GetChannel().
|
overridevirtual |
Destructor implementation.
This method is called by Dispose() or by the Object's destructor, whichever comes first.
Subclasses are expected to implement their real destruction code in an overridden version of this method and chain up to their parent's implementation once they are done. i.e, for simplicity, the destructor of every subclass should be empty and its content should be moved to the associated DoDispose() method.
It is safe to call GetObject() from within this method.
Reimplemented from ns3::Object.
Definition at line 180 of file three-gpp-channel-model.cc.
References m_channelConditionModel, and m_channelMap.
|
overridevirtual |
Looks for the channel matrix associated to the aMob and bMob pair in m_channelMap.
If found, it checks if it has to be updated. If not found or if it has to be updated, it generates a new uncorrelated channel matrix using the method GetNewChannel and updates m_channelMap.
aMob | mobility model of the a device |
bMob | mobility model of the b device |
aAntenna | antenna of the a device |
bAntenna | antenna of the b device |
Implements ns3::MatrixBasedChannelModel.
Definition at line 971 of file three-gpp-channel-model.cc.
References ChannelMatrixNeedsUpdate(), ns3::Node::GetId(), ns3::MatrixBasedChannelModel::GetKey(), GetNewChannel(), m_channelConditionModel, m_channelMap, max, min, NS_LOG_DEBUG, NS_LOG_FUNCTION, and sample-rng-plot::x.
Ptr< ChannelConditionModel > ns3::ThreeGppChannelModel::GetChannelConditionModel | ( | void | ) | const |
Get the associated channel condition model.
Definition at line 251 of file three-gpp-channel-model.cc.
References m_channelConditionModel, and NS_LOG_FUNCTION.
Referenced by GetTypeId().
double ns3::ThreeGppChannelModel::GetFrequency | ( | void | ) | const |
Returns the center frequency.
Definition at line 266 of file three-gpp-channel-model.cc.
References m_frequency, and NS_LOG_FUNCTION.
Referenced by GetTypeId().
|
private |
Compute the channel matrix between two devices using the procedure described in 3GPP TR 38.901.
locUT | the location of the UT |
channelCondition | the channel condition |
sAntenna | the s node antenna array |
uAntenna | the u node antenna array |
uAngle | the u node angle |
sAngle | the s node angle |
dis2D | the 2D distance between tx and rx |
hBS | the height of the BS |
hUT | the height of the UT |
Definition at line 1040 of file three-gpp-channel-model.cc.
References CalcAttenuationOfBlockage(), ns3::DegreesToRadians(), ns3::Angles::GetAzimuth(), ns3::Angles::GetInclination(), GetThreeGppTable(), ns3::UniformRandomVariable::GetValue(), bianchi11ax::k, m_blockage, m_frequency, m_normalRv, m_uniformRv, ns3::max(), min, ns3::min(), ns3::Simulator::Now(), NS_ASSERT, NS_ASSERT_MSG, NS_FATAL_ERROR, NS_LOG_FUNCTION, NS_LOG_INFO, ns3::offSetAlpha, ns3::RadiansToDegrees(), Shuffle(), and WrapAngles().
Referenced by GetChannel().
std::string ns3::ThreeGppChannelModel::GetScenario | ( | void | ) | const |
Returns the propagation scenario.
Definition at line 285 of file three-gpp-channel-model.cc.
References m_scenario, and NS_LOG_FUNCTION.
Referenced by GetTypeId().
|
privatevirtual |
Get the parameters needed to apply the channel generation procedure.
channelCondition | the channel condition |
hBS | the height of the BS |
hUT | the height of the UT |
distance2D | the 2D distance between tx and rx |
Definition at line 292 of file three-gpp-channel-model.cc.
References m_frequency, m_scenario, max, NS_ASSERT_MSG, NS_FATAL_ERROR, NS_LOG_FUNCTION, NS_LOG_WARN, ns3::sqrtC_office_LOS, ns3::sqrtC_office_NLOS, ns3::sqrtC_RMa_LOS, ns3::sqrtC_RMa_NLOS, ns3::sqrtC_RMa_O2I, ns3::sqrtC_UMa_LOS, ns3::sqrtC_UMa_NLOS, ns3::sqrtC_UMa_O2I, ns3::sqrtC_UMi_LOS, ns3::sqrtC_UMi_NLOS, and ns3::sqrtC_UMi_O2I.
Referenced by GetNewChannel().
|
static |
Get the type ID.
Definition at line 188 of file three-gpp-channel-model.cc.
References GetChannelConditionModel(), GetFrequency(), GetScenario(), m_blockage, m_blockerSpeed, m_numNonSelfBlocking, m_portraitMode, m_updatePeriod, ns3::MakeBooleanAccessor(), ns3::MakeBooleanChecker(), ns3::MakeDoubleAccessor(), ns3::MakeIntegerAccessor(), ns3::MakePointerAccessor(), ns3::MakeStringAccessor(), ns3::MakeStringChecker(), ns3::MakeTimeAccessor(), ns3::MakeTimeChecker(), ns3::MilliSeconds(), SetChannelConditionModel(), SetFrequency(), ns3::TypeId::SetParent(), and SetScenario().
void ns3::ThreeGppChannelModel::SetChannelConditionModel | ( | Ptr< ChannelConditionModel > | model | ) |
Set the channel condition model.
a | pointer to the ChannelConditionModel object |
Definition at line 244 of file three-gpp-channel-model.cc.
References m_channelConditionModel, and NS_LOG_FUNCTION.
Referenced by GetTypeId().
void ns3::ThreeGppChannelModel::SetFrequency | ( | double | f | ) |
Sets the center frequency of the model.
f | the center frequency in Hz |
Definition at line 258 of file three-gpp-channel-model.cc.
References f(), m_frequency, NS_ASSERT_MSG, and NS_LOG_FUNCTION.
Referenced by GetTypeId().
void ns3::ThreeGppChannelModel::SetScenario | ( | const std::string & | scenario | ) |
Sets the propagation scenario.
scenario | the propagation scenario |
Definition at line 273 of file three-gpp-channel-model.cc.
References m_scenario, NS_ASSERT_MSG, and NS_LOG_FUNCTION.
Referenced by GetTypeId().
|
private |
Shuffle the elements of a simple sequence container of type double.
first | Pointer to the first element among the elements to be shuffled |
last | Pointer to the last element among the elements to be shuffled |
Definition at line 2005 of file three-gpp-channel-model.cc.
References ns3::UniformRandomVariable::GetInteger(), and m_uniformRvShuffle.
Referenced by GetNewChannel().
|
staticprivate |
Wrap an (azimuth, inclination) angle pair in a valid range.
Specifically, inclination must be in [0, M_PI] and azimuth in [0, 2*M_PI). If the inclination angle is outside of its range, the azimuth angle is rotated by M_PI. This methods aims specifically at solving the problem of generating angles at the boundaries of the angle domain, specifically, generating angle distributions close to inclinationRad=0 and inclinationRad=M_PI.
azimuthRad | the azimuth angle in radians |
inclinationRad | the inclination angle in radians |
Definition at line 1763 of file three-gpp-channel-model.cc.
References NS_ASSERT_MSG, and ns3::WrapTo2Pi().
Referenced by GetNewChannel().
|
private |
enables the blockage model A
Definition at line 268 of file three-gpp-channel-model.h.
Referenced by GetNewChannel(), and GetTypeId().
|
private |
the blocker speed
Definition at line 271 of file three-gpp-channel-model.h.
Referenced by CalcAttenuationOfBlockage(), and GetTypeId().
|
private |
the channel condition model
Definition at line 262 of file three-gpp-channel-model.h.
Referenced by DoDispose(), GetChannel(), GetChannelConditionModel(), and SetChannelConditionModel().
|
private |
map containing the channel realizations
Definition at line 258 of file three-gpp-channel-model.h.
Referenced by DoDispose(), and GetChannel().
|
private |
the operating frequency
Definition at line 260 of file three-gpp-channel-model.h.
Referenced by CalcAttenuationOfBlockage(), GetFrequency(), GetNewChannel(), GetThreeGppTable(), and SetFrequency().
|
private |
normal random variable
Definition at line 264 of file three-gpp-channel-model.h.
Referenced by ThreeGppChannelModel(), AssignStreams(), CalcAttenuationOfBlockage(), and GetNewChannel().
|
private |
number of non-self-blocking regions
Definition at line 269 of file three-gpp-channel-model.h.
Referenced by CalcAttenuationOfBlockage(), and GetTypeId().
|
private |
true if potrait mode, false if landscape
Definition at line 270 of file three-gpp-channel-model.h.
Referenced by CalcAttenuationOfBlockage(), and GetTypeId().
|
private |
the 3GPP scenario
Definition at line 261 of file three-gpp-channel-model.h.
Referenced by CalcAttenuationOfBlockage(), GetScenario(), GetThreeGppTable(), and SetScenario().
|
private |
uniform random variable
Definition at line 263 of file three-gpp-channel-model.h.
Referenced by ThreeGppChannelModel(), AssignStreams(), CalcAttenuationOfBlockage(), and GetNewChannel().
|
private |
uniform random variable used to shuffle array in GetNewChannel
Definition at line 265 of file three-gpp-channel-model.h.
Referenced by ThreeGppChannelModel(), AssignStreams(), and Shuffle().
|
private |
the channel update period
Definition at line 259 of file three-gpp-channel-model.h.
Referenced by ChannelMatrixNeedsUpdate(), and GetTypeId().
|
staticprivate |
index of the PHI value in the m_nonSelfBlocking array
Definition at line 273 of file three-gpp-channel-model.h.
Referenced by CalcAttenuationOfBlockage().
|
staticprivate |
index of the R value in the m_nonSelfBlocking array
Definition at line 277 of file three-gpp-channel-model.h.
Referenced by CalcAttenuationOfBlockage().
|
staticprivate |
index of the THETA value in the m_nonSelfBlocking array
Definition at line 275 of file three-gpp-channel-model.h.
Referenced by CalcAttenuationOfBlockage().
|
staticprivate |
index of the X value in the m_nonSelfBlocking array
Definition at line 274 of file three-gpp-channel-model.h.
Referenced by CalcAttenuationOfBlockage().
|
staticprivate |
index of the Y value in the m_nonSelfBlocking array
Definition at line 276 of file three-gpp-channel-model.h.
Referenced by CalcAttenuationOfBlockage().