Two Ray Spectrum Propagation Loss Model. More...
#include "two-ray-spectrum-propagation-loss-model.h"
Classes | |
struct | FtrParams |
Struct holding the Fluctuating Two Ray fast-fading model parameters. More... | |
Public Types | |
using | CarrierFrequencyFtrParamsTuple = std::tuple< std::vector< double >, std::vector< FtrParams > > |
Tuple collecting vectors of carrier frequencies and FTR fading model parameters, encoded as a FtrParams struct. More... | |
using | FtrParamsLookupTable = std::map< std::string, std::map< ChannelCondition::LosConditionValue, CarrierFrequencyFtrParamsTuple > > |
Nested map associating 3GPP scenario and LosCondition to the corresponding tuple of carrier frequencies and corresponding fitted FTR parameters. More... | |
Public Member Functions | |
TwoRaySpectrumPropagationLossModel () | |
Constructor. More... | |
~TwoRaySpectrumPropagationLossModel () override | |
Destructor. More... | |
Ptr< SpectrumSignalParameters > | DoCalcRxPowerSpectralDensity (Ptr< const SpectrumSignalParameters > txPsd, Ptr< const MobilityModel > a, Ptr< const MobilityModel > b, Ptr< const PhasedArrayModel > aPhasedArrayModel, Ptr< const PhasedArrayModel > bPhasedArrayModel) const override |
Compute the received PSD. More... | |
void | DoDispose () override |
Destructor implementation. More... | |
void | SetFrequency (double f) |
Sets the center frequency of the model. More... | |
void | SetScenario (const std::string &scenario) |
Sets the propagation scenario. More... | |
Public Member Functions inherited from ns3::PhasedArraySpectrumPropagationLossModel | |
PhasedArraySpectrumPropagationLossModel () | |
~PhasedArraySpectrumPropagationLossModel () override | |
int64_t | AssignStreams (int64_t stream) |
If this loss model uses objects of type RandomVariableStream, set the stream numbers to the integers starting with the offset 'stream'. More... | |
Ptr< SpectrumSignalParameters > | CalcRxPowerSpectralDensity (Ptr< const SpectrumSignalParameters > txPsd, Ptr< const MobilityModel > a, Ptr< const MobilityModel > b, Ptr< const PhasedArrayModel > aPhasedArrayModel, Ptr< const PhasedArrayModel > bPhasedArrayModel) const |
This method is to be called to calculate. More... | |
Ptr< PhasedArraySpectrumPropagationLossModel > | GetNext () const |
Return the pointer to the next PhasedArraySpectrumPropagationLossModel, if any. More... | |
void | SetNext (Ptr< PhasedArraySpectrumPropagationLossModel > next) |
Used to chain various instances of PhasedArraySpectrumPropagationLossModel. More... | |
Public Member Functions inherited from ns3::Object | |
Object () | |
Constructor. More... | |
~Object () override | |
Destructor. More... | |
void | AggregateObject (Ptr< Object > other) |
Aggregate two Objects together. More... | |
void | Dispose () |
Dispose of this Object. More... | |
AggregateIterator | GetAggregateIterator () const |
Get an iterator to the Objects aggregated to this one. More... | |
TypeId | GetInstanceTypeId () const override |
Get the most derived TypeId for this Object. More... | |
template<typename T > | |
Ptr< T > | GetObject () const |
Get a pointer to the requested aggregated 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... | |
void | Initialize () |
Invoke DoInitialize on all Objects aggregated to this one. More... | |
bool | IsInitialized () const |
Check if the object has been initialized. More... | |
Public Member Functions inherited from ns3::SimpleRefCount< Object, ObjectBase, ObjectDeleter > | |
SimpleRefCount () | |
Default constructor. More... | |
SimpleRefCount (const SimpleRefCount &o[[maybe_unused]]) | |
Copy constructor. More... | |
uint32_t | GetReferenceCount () const |
Get the reference count of the object. More... | |
SimpleRefCount & | operator= (const SimpleRefCount &o[[maybe_unused]]) |
Assignment operator. More... | |
void | Ref () const |
Increment the reference count. More... | |
void | Unref () const |
Decrement the reference count. More... | |
Public Member Functions inherited from ns3::ObjectBase | |
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 errors. 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 Public Member Functions inherited from ns3::PhasedArraySpectrumPropagationLossModel | |
static TypeId | GetTypeId () |
Get the type ID. More... | |
Static Public Member Functions inherited from ns3::Object | |
static TypeId | GetTypeId () |
Register this type. More... | |
Static Public Member Functions inherited from ns3::ObjectBase | |
static TypeId | GetTypeId () |
Get the type ID. More... | |
Protected Member Functions | |
int64_t | DoAssignStreams (int64_t stream) override |
Assign a fixed random variable stream number to the random variables used by this model. More... | |
Protected Member Functions inherited from ns3::Object | |
Object (const Object &o) | |
Copy an Object. More... | |
virtual void | DoInitialize () |
Initialize() implementation. More... | |
virtual void | NotifyNewAggregate () |
Notify all Objects aggregated to this one of a new Object being aggregated. More... | |
Protected Member Functions inherited from ns3::ObjectBase | |
void | ConstructSelf (const AttributeConstructionList &attributes) |
Complete construction of ObjectBase; invoked by derived classes. More... | |
virtual void | NotifyConstructionCompleted () |
Notifier called once the ObjectBase is fully constructed. More... | |
Private Member Functions | |
double | CalcBeamformingGain (Ptr< const MobilityModel > a, Ptr< const MobilityModel > b, Ptr< const PhasedArrayModel > aPhasedArrayModel, Ptr< const PhasedArrayModel > bPhasedArrayModel) const |
Compute the beamforming gain by combining single-element and array gains. More... | |
double | GetFtrFastFading (const FtrParams ¶ms) const |
Compute the stochastic power gain due to the fast fading, modeled according to the Fluctuating Two-Ray Model. More... | |
FtrParams | GetFtrParameters (Ptr< const MobilityModel > a, Ptr< const MobilityModel > b) const |
Retrieves the FTR fading model parameters related to the carrier frequency and LOS condition. More... | |
ChannelCondition::LosConditionValue | GetLosCondition (Ptr< const MobilityModel > a, Ptr< const MobilityModel > b) const |
Retrieves the LOS condition associated to the specified mobility models. More... | |
std::size_t | SearchClosestFc (const std::vector< double > &frequencies, double targetFc) const |
Get the index of the closest carrier frequency for which the FTR estimated parameters are available. More... | |
Private Attributes | |
Ptr< ChannelConditionModel > | m_channelConditionModel |
Channel condition model used to retrieve the LOS/NLOS condition of the communicating endpoints. More... | |
double | m_frequency |
The operating frequency. More... | |
Ptr< GammaRandomVariable > | m_gammaRv |
Random variable used to sample the Nakagami distributed amplitude of the FTR specular components. More... | |
Ptr< NormalRandomVariable > | m_normalRv |
Random variable used to sample the normal distributed amplitudes of the FTR diffuse components. More... | |
std::string | m_scenario |
the 3GPP scenario More... | |
Ptr< UniformRandomVariable > | m_uniformRv |
Random variable used to sample the uniform distributed phases of the FTR specular components. More... | |
Friends | |
class | ::ArrayResponseTest |
class | ::FtrFadingModelAverageTest |
class | ::OverallGainAverageTest |
Additional Inherited Members | |
Related Functions inherited from ns3::ObjectBase | |
static TypeId | GetObjectIid () |
Ensure the TypeId for ObjectBase gets fully configured to anchor the inheritance tree properly. More... | |
Two Ray Spectrum Propagation Loss Model.
This class implements a performance-oriented channel and beamforming models alternative to the ThreeGppSpectrumPropagationLossModel and ThreeGppChannelModel. The main method is DoCalcRxPowerSpectralDensity, which takes as input the power spectral density (PSD) of the transmitted signal, the mobility models of the transmitting node and receiving node, and returns the PSD of the received signal.
The fading model is calibrated with the ThreeGppChannelModel, aiming to provide an end-to-end channel gain which matches as much as possible the TR 38.901-based channel model. Therefore, this model is to be used for large-scale simulations of MIMO wireless networks, for which the ThreeGppChannelModel would prove too computationally intensive. The target applicability of this model, in terms of frequency range, is 0.5-100 GHz.
Definition at line 57 of file two-ray-spectrum-propagation-loss-model.h.
using ns3::TwoRaySpectrumPropagationLossModel::CarrierFrequencyFtrParamsTuple = std::tuple<std::vector<double>, std::vector<FtrParams> > |
Tuple collecting vectors of carrier frequencies and FTR fading model parameters, encoded as a FtrParams struct.
Definition at line 125 of file two-ray-spectrum-propagation-loss-model.h.
using ns3::TwoRaySpectrumPropagationLossModel::FtrParamsLookupTable = std::map<std::string, std::map<ChannelCondition::LosConditionValue, CarrierFrequencyFtrParamsTuple> > |
Nested map associating 3GPP scenario and LosCondition to the corresponding tuple of carrier frequencies and corresponding fitted FTR parameters.
Definition at line 131 of file two-ray-spectrum-propagation-loss-model.h.
ns3::TwoRaySpectrumPropagationLossModel::TwoRaySpectrumPropagationLossModel | ( | ) |
Constructor.
Definition at line 902 of file two-ray-spectrum-propagation-loss-model.cc.
References m_gammaRv, m_normalRv, m_uniformRv, NS_LOG_FUNCTION, and ns3::ObjectBase::SetAttribute().
|
override |
Destructor.
Definition at line 917 of file two-ray-spectrum-propagation-loss-model.cc.
References m_gammaRv, m_normalRv, m_uniformRv, and NS_LOG_FUNCTION.
|
private |
Compute the beamforming gain by combining single-element and array gains.
Computes the overall beamforming and array gain, assuming analog beamforming both at the transmitter and at the receiver and arbitrary single-element radiation patterns. The computation is performed following Rebato, Mattia, et al. "Study of realistic antenna patterns in 5G mmwave cellular scenarios.", 2018 IEEE International Conference on Communications (ICC). IEEE, 2018.
Additionally, whenever the link is in NLOS a penalty factor is introduced, to take into account for the possible misalignment of the beamforming vectors due to the lack of a dominant multipath component. See Kulkarni, Mandar N., Eugene Visotsky, and Jeffrey G. Andrews. "Correction factor for analysis of MIMO wireless networks with highly directional beamforming." IEEE Wireless Communications Letters 7.5 (2018) for further details on this approach.
a | first node mobility model |
b | second node mobility model |
aPhasedArrayModel | the antenna array of the first node |
bPhasedArrayModel | the antenna array of the second node |
Definition at line 1031 of file two-ray-spectrum-propagation-loss-model.cc.
References GetLosCondition(), ns3::ChannelCondition::NLOS, MRG32k3a::norm, and NS_LOG_FUNCTION.
Referenced by DoCalcRxPowerSpectralDensity().
|
overrideprotectedvirtual |
Assign a fixed random variable stream number to the random variables used by this model.
Subclasses must implement this; those not using random variables can return zero.
stream | first stream index to use |
Implements ns3::PhasedArraySpectrumPropagationLossModel.
Definition at line 1168 of file two-ray-spectrum-propagation-loss-model.cc.
References m_gammaRv, m_normalRv, m_uniformRv, NS_LOG_FUNCTION, and ns3::RandomVariableStream::SetStream().
|
overridevirtual |
Compute the received PSD.
This function computes the received PSD by applying the Fluctuating Two-Ray (FTR) fast fading model and the beamforming gain. In particular, the beamforming gain is computed as the combination of the single-element and the array gains. The path loss and shadowing are to be computed separately, using the ThreeGppPropagationLossModel class.
txPsd | the PSD of the transmitted signal |
a | first node mobility model |
b | second node mobility model |
aPhasedArrayModel | the antenna array of the first node |
bPhasedArrayModel | the antenna array of the second node |
Implements ns3::PhasedArraySpectrumPropagationLossModel.
Definition at line 1116 of file two-ray-spectrum-propagation-loss-model.cc.
References CalcBeamformingGain(), GetFtrFastFading(), GetFtrParameters(), NS_ASSERT_MSG, NS_LOG_DEBUG, NS_LOG_FUNCTION, two-ray-to-three-gpp-ch-calibration::params, and ns3::SpectrumSignalParameters::psd.
|
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::PhasedArraySpectrumPropagationLossModel.
Definition at line 927 of file two-ray-spectrum-propagation-loss-model.cc.
|
private |
Compute the stochastic power gain due to the fast fading, modeled according to the Fluctuating Two-Ray Model.
Specifically, the amplitude of the random fading term is sampled as:
TODO: Currently the equations are not rendered, but neither are other formulas. Fixed in the mainline, so this should also render properly after a rebase will be done
, where is a unit-mean Gamma distributed random variable of shape and rate , and are zero-mean Gaussian random variables of variance , is a uniform random variable over , and are the constant amplitudes of the reflected components.
See J. M. Romero-Jerez, F. J. Lopez-Martinez, J. F. Paris and A. Goldsmith, "The Fluctuating Two-Ray Fading Model for mmWave Communications," 2016 IEEE Globecom Workshops (GC Wkshps) for further details on such model.
params | the FTR fading model parameters |
Definition at line 1083 of file two-ray-spectrum-propagation-loss-model.cc.
References ns3::UniformRandomVariable::GetValue(), m_gammaRv, m_normalRv, m_uniformRv, MRG32k3a::norm, NS_LOG_FUNCTION, two-ray-to-three-gpp-ch-calibration::params, and two-ray-to-three-gpp-ch-calibration::x.
Referenced by DoCalcRxPowerSpectralDensity().
|
private |
Retrieves the FTR fading model parameters related to the carrier frequency and LOS condition.
The calibration has been undertaken using the 3GPP 38.901 as a reference. The latter's small-scale fading distributions depend on the scenario (UMa, UMi, RMa, InH), the LOS condition (LOS/NLOS) and the carrier frequency. Therefore, the output of the calibration is a map associating such simulation parameters to the specific FTR parameters. Specifically, such parameters represent the FTR distribution yielding channel realizations which exhibit the closest statistics to the small-scale fading obtained when using the 3GPP 38.901 model. The estimation relies on reference curves obtained by collecting multiple 38.901 channel realizations and computing the corresponding end-to-end channel gain by setting the speed of the TX and RX pair to 0, disabling the shadowing and fixing the LOS condition. In such a way, any variation of the received power around the mean is given by the small-scale fading only. Finally, the reference ECDF of the channel gains is compared to the ECDF obtained from the FTR distribution using different values of the parameters. The parameters which provide the best fit (in a goodness-of-fit sense) are kept for the specific scenario, LOS condition and carrier frequency. The goodness of the fit is measured using the well-known Anderson-Darling metric.
For additional details, please refer to src/spectrum/examples/three-gpp-two-ray-channel-calibration.cc and src/spectrum/utils/two-ray-to-three-gpp-ch-calibration.py, which show how to obtain the reference curves and then estimate the FTR parameters based on the reference data, respectively.
a | first node mobility model |
b | second node mobility model |
Definition at line 1002 of file two-ray-spectrum-propagation-loss-model.cc.
References GetLosCondition(), m_frequency, m_scenario, NS_ASSERT, NS_ASSERT_MSG, NS_LOG_FUNCTION, two-ray-to-three-gpp-ch-calibration::params, SearchClosestFc(), and ns3::SIM_PARAMS_TO_FTR_PARAMS_TABLE.
Referenced by DoCalcRxPowerSpectralDensity().
|
private |
Retrieves the LOS condition associated to the specified mobility models.
a | the mobility model of the first node |
b | the mobility model of the second node |
Definition at line 990 of file two-ray-spectrum-propagation-loss-model.cc.
References m_channelConditionModel, NS_ASSERT, and NS_LOG_FUNCTION.
Referenced by CalcBeamformingGain(), and GetFtrParameters().
|
static |
Get the type ID.
Definition at line 932 of file two-ray-spectrum-propagation-loss-model.cc.
References m_channelConditionModel, ns3::MakeDoubleAccessor(), ns3::MakePointerAccessor(), ns3::MakeStringAccessor(), ns3::MakeStringChecker(), SetFrequency(), ns3::TypeId::SetParent(), and SetScenario().
|
private |
Get the index of the closest carrier frequency for which the FTR estimated parameters are available.
frequencies | the vector of carrier frequencies which have been calibrated |
targetFc | the carrier frequency of the current simulation |
Definition at line 1156 of file two-ray-spectrum-propagation-loss-model.cc.
References two-ray-to-three-gpp-ch-calibration::frequencies.
Referenced by GetFtrParameters().
void ns3::TwoRaySpectrumPropagationLossModel::SetFrequency | ( | double | f | ) |
Sets the center frequency of the model.
f | the center frequency in Hz |
Definition at line 981 of file two-ray-spectrum-propagation-loss-model.cc.
References f(), m_frequency, NS_ASSERT_MSG, and NS_LOG_FUNCTION.
Referenced by GetTypeId().
void ns3::TwoRaySpectrumPropagationLossModel::SetScenario | ( | const std::string & | scenario | ) |
Sets the propagation scenario.
scenario | the propagation scenario |
Definition at line 960 of file two-ray-spectrum-propagation-loss-model.cc.
References m_scenario, NS_ABORT_MSG, NS_LOG_FUNCTION, and ns3::SIM_PARAMS_TO_FTR_PARAMS_TABLE.
Referenced by GetTypeId().
|
friend |
Definition at line 61 of file two-ray-spectrum-propagation-loss-model.h.
|
friend |
Definition at line 60 of file two-ray-spectrum-propagation-loss-model.h.
|
friend |
Definition at line 62 of file two-ray-spectrum-propagation-loss-model.h.
|
private |
Channel condition model used to retrieve the LOS/NLOS condition of the communicating endpoints.
Definition at line 324 of file two-ray-spectrum-propagation-loss-model.h.
Referenced by GetLosCondition(), and GetTypeId().
|
private |
The operating frequency.
Definition at line 299 of file two-ray-spectrum-propagation-loss-model.h.
Referenced by GetFtrParameters(), and SetFrequency().
|
private |
Random variable used to sample the Nakagami distributed amplitude of the FTR specular components.
Definition at line 316 of file two-ray-spectrum-propagation-loss-model.h.
Referenced by TwoRaySpectrumPropagationLossModel(), ~TwoRaySpectrumPropagationLossModel(), DoAssignStreams(), and GetFtrFastFading().
|
private |
Random variable used to sample the normal distributed amplitudes of the FTR diffuse components.
Definition at line 310 of file two-ray-spectrum-propagation-loss-model.h.
Referenced by TwoRaySpectrumPropagationLossModel(), ~TwoRaySpectrumPropagationLossModel(), DoAssignStreams(), and GetFtrFastFading().
|
private |
the 3GPP scenario
Definition at line 318 of file two-ray-spectrum-propagation-loss-model.h.
Referenced by GetFtrParameters(), and SetScenario().
|
private |
Random variable used to sample the uniform distributed phases of the FTR specular components.
Definition at line 304 of file two-ray-spectrum-propagation-loss-model.h.
Referenced by TwoRaySpectrumPropagationLossModel(), ~TwoRaySpectrumPropagationLossModel(), DoAssignStreams(), and GetFtrFastFading().