INET Framework for OMNeT++/OMNEST
inet::physicallayer::UwbIrStochasticPathLoss Class Reference

Implements the Ghassmezadeh stochastic UWB channel path loss model. More...

#include <UwbIrStochasticPathLoss.h>

Inheritance diagram for inet::physicallayer::UwbIrStochasticPathLoss:
inet::physicallayer::PathLossBase inet::physicallayer::IPathLoss inet::IPrintableObject

Public Member Functions

 UwbIrStochasticPathLoss ()
 
virtual std::ostream & printToStream (std::ostream &stream, int level, int evFlags=0) const override
 Prints this object to the provided output stream. More...
 
virtual double computePathLoss (mps propagationSpeed, Hz frequency, m distance) const override
 Returns the loss factor as a function of propagation speed, carrier frequency and distance. More...
 
virtual m computeRange (mps propagationSpeed, Hz frequency, double loss) const override
 Returns the range for the given loss factor. More...
 
- Public Member Functions inherited from inet::physicallayer::PathLossBase
virtual double computePathLoss (const ITransmission *transmission, const IArrival *arrival) const override
 Returns the loss factor for the provided transmission and arrival. More...
 
- Public Member Functions inherited from inet::IPrintableObject
virtual ~IPrintableObject ()
 
virtual std::string printToString () const
 
virtual std::string printToString (int level, int evFlags=0) const
 
virtual std::string getInfoStringRepresentation (int evFlags=0) const
 
virtual std::string getDetailStringRepresentation (int evFlags=0) const
 
virtual std::string getDebugStringRepresentation (int evFlags=0) const
 
virtual std::string getTraceStringRepresentation (int evFlags=0) const
 
virtual std::string getCompleteStringRepresentation (int evFlags=0) const
 

Protected Member Functions

virtual void initialize (int stage) override
 
virtual double getFDPathLoss (Hz frequency, m distance) const
 
virtual double getGhassemzadehPathLoss (double gamma, double S, m distance) const
 
virtual double getNarrowBandFreeSpacePathLoss (Hz frequency, m distance) const
 
virtual double simtruncnormal (double mean, double stddev, double a, int rng) const
 

Protected Attributes

double PL0
 
double muGamma
 
double muSigma
 
double sigmaGamma
 
double sigmaSigma
 
double pathloss_exponent
 
bool shadowing
 

Static Protected Attributes

static const Hz fc = MHz(4492.8)
 
static const m d0 = m(1)
 
static const double n1_limit = 1.25
 
static const double n2_limit = 2
 
static const double n3_limit = 2
 
static const double s_mu
 
static const double s_sigma
 
static const double kappa = 1
 

Additional Inherited Members

- Public Types inherited from inet::IPrintableObject
enum  PrintLevel {
  PRINT_LEVEL_TRACE, PRINT_LEVEL_DEBUG, PRINT_LEVEL_DETAIL, PRINT_LEVEL_INFO,
  PRINT_LEVEL_COMPLETE = INT_MIN
}
 
enum  PrintFlag { PRINT_FLAG_FORMATTED = (1 << 0), PRINT_FLAG_MULTILINE = (1 << 1) }
 

Detailed Description

Implements the Ghassmezadeh stochastic UWB channel path loss model.

Citation of the following publication is appreciated if you use the MiXiM UWB PHY model for a publication of your own. J. Rousselot, J.-D. Decotignie, An ultra-wideband impulse radio PHY layer model for network simulation. SIMULATION January 2011 vol. 87 no. 1-2 82-112.

For more information, see also:

[1] J. Rousselot, J.-D. Decotignie, An ultra-wideband impulse radio PHY layer model for network simulation. SIMULATION January 2011 vol. 87 no. 1-2 82-112. http://dx.doi.org/10.1177/0037549710377767 [2] J. Rousselot, Ultra Low Power Communication Protocols for UWB Impulse Radio Wireless Sensor Networks. EPFL Thesis 4720, 2010. http://infoscience.epfl.ch/record/147987 [3] A High-Precision Ultra Wideband Impulse Radio Physical Layer Model for Network Simulation, Jérôme Rousselot, Jean-Dominique Decotignie, Second International Omnet++ Workshop,Simu'TOOLS, Rome, 6 Mar 09. http://portal.acm.org/citation.cfm?id=1537714

Constructor & Destructor Documentation

◆ UwbIrStochasticPathLoss()

inet::physicallayer::UwbIrStochasticPathLoss::UwbIrStochasticPathLoss ( )
28  :
29  PL0(0),
30  muGamma(0),
31  muSigma(0),
32  sigmaGamma(0),
33  sigmaSigma(0),
34  pathloss_exponent(0.0),
35  shadowing(true)
36 {
37 }

Member Function Documentation

◆ computePathLoss()

double inet::physicallayer::UwbIrStochasticPathLoss::computePathLoss ( mps  propagationSpeed,
Hz  frequency,
m  distance 
) const
overridevirtual

Returns the loss factor as a function of propagation speed, carrier frequency and distance.

The value is in the range [0, 1] where 1 means no loss at all and 0 means all power is lost.

Implements inet::physicallayer::PathLossBase.

94 {
95  double n1 = simtruncnormal(0, 1, n1_limit, 1);
96  double n2 = simtruncnormal(0, 1, n2_limit, 2);
97  double n3 = simtruncnormal(0, 1, n3_limit, 3);
98  double gamma = muGamma + n1 * sigmaGamma;
99  double sigma = muSigma + n3 * sigmaSigma;
100  double S = n2 * sigma;
101  return getGhassemzadehPathLoss(gamma, S, distance);
102 }

◆ computeRange()

virtual m inet::physicallayer::UwbIrStochasticPathLoss::computeRange ( mps  propagationSpeed,
Hz  frequency,
double  loss 
) const
inlineoverridevirtual

Returns the range for the given loss factor.

The value is in the range [0, +infinity) or NaN if unspecified.

Implements inet::physicallayer::IPathLoss.

79 { return m(NaN); }

◆ getFDPathLoss()

double inet::physicallayer::UwbIrStochasticPathLoss::getFDPathLoss ( Hz  frequency,
m  distance 
) const
protectedvirtual
72  {
73  return 0.5 * PL0 * pow(unit(frequency / fc).get(), -2 * (kappa + 1)) / pow(unit(distance / d0).get(), pathloss_exponent);
74 }

◆ getGhassemzadehPathLoss()

double inet::physicallayer::UwbIrStochasticPathLoss::getGhassemzadehPathLoss ( double  gamma,
double  S,
m  distance 
) const
protectedvirtual
83 {
84  double attenuation = PL0;
85  if (distance < d0)
86  distance = d0;
87  attenuation = attenuation - 10 * gamma * log10(unit(distance / d0).get());
88  if (shadowing)
89  attenuation = attenuation - S;
90  return math::dB2fraction(attenuation);
91 }

Referenced by computePathLoss().

◆ getNarrowBandFreeSpacePathLoss()

double inet::physicallayer::UwbIrStochasticPathLoss::getNarrowBandFreeSpacePathLoss ( Hz  frequency,
m  distance 
) const
protectedvirtual
77 {
78  double attenuation = 4 * M_PI * unit(distance * frequency / mps(SPEED_OF_LIGHT)).get();
79  return 1.0 / (attenuation * attenuation);
80 }

◆ initialize()

void inet::physicallayer::UwbIrStochasticPathLoss::initialize ( int  stage)
overrideprotectedvirtual
48 {
49  if (stage == INITSTAGE_LOCAL) {
50  PL0 = par("PL0");
51  muGamma = par("muGamma");
52  muSigma = par("muSigma");
53  sigmaGamma = par("sigmaGamma");
54  sigmaSigma = par("sigmaSigma");
55  shadowing = par("shadowing");
56  }
57 }

◆ printToStream()

std::ostream & inet::physicallayer::UwbIrStochasticPathLoss::printToStream ( std::ostream &  stream,
int  level,
int  evFlags = 0 
) const
overridevirtual

Prints this object to the provided output stream.

Reimplemented from inet::IPrintableObject.

60 {
61  stream << "UwbIrStochasticPathLoss";
62  if (level <= PRINT_LEVEL_TRACE)
63  stream << ", PL0 = " << PL0
64  << EV_FIELD(muGamma)
65  << EV_FIELD(muSigma)
68  << EV_FIELD(shadowing);
69  return stream;
70 }

◆ simtruncnormal()

double inet::physicallayer::UwbIrStochasticPathLoss::simtruncnormal ( double  mean,
double  stddev,
double  a,
int  rng 
) const
protectedvirtual
40 {
41  double result = a + 1;
42  while (result > a || result < -a)
43  result = normal(mean, stddev, 0);
44  return result;
45 }

Referenced by computePathLoss().

Member Data Documentation

◆ d0

const m inet::physicallayer::UwbIrStochasticPathLoss::d0 = m(1)
staticprotected

◆ fc

const Hz inet::physicallayer::UwbIrStochasticPathLoss::fc = MHz(4492.8)
staticprotected

Referenced by getFDPathLoss().

◆ kappa

const double inet::physicallayer::UwbIrStochasticPathLoss::kappa = 1
staticprotected

Referenced by getFDPathLoss().

◆ muGamma

double inet::physicallayer::UwbIrStochasticPathLoss::muGamma
protected

◆ muSigma

double inet::physicallayer::UwbIrStochasticPathLoss::muSigma
protected

◆ n1_limit

const double inet::physicallayer::UwbIrStochasticPathLoss::n1_limit = 1.25
staticprotected

Referenced by computePathLoss().

◆ n2_limit

const double inet::physicallayer::UwbIrStochasticPathLoss::n2_limit = 2
staticprotected

Referenced by computePathLoss().

◆ n3_limit

const double inet::physicallayer::UwbIrStochasticPathLoss::n3_limit = 2
staticprotected

Referenced by computePathLoss().

◆ pathloss_exponent

double inet::physicallayer::UwbIrStochasticPathLoss::pathloss_exponent
protected

Referenced by getFDPathLoss().

◆ PL0

double inet::physicallayer::UwbIrStochasticPathLoss::PL0
protected

◆ s_mu

const double inet::physicallayer::UwbIrStochasticPathLoss::s_mu
staticprotected

◆ s_sigma

const double inet::physicallayer::UwbIrStochasticPathLoss::s_sigma
staticprotected

◆ shadowing

bool inet::physicallayer::UwbIrStochasticPathLoss::shadowing
protected

◆ sigmaGamma

double inet::physicallayer::UwbIrStochasticPathLoss::sigmaGamma
protected

◆ sigmaSigma

double inet::physicallayer::UwbIrStochasticPathLoss::sigmaSigma
protected

The documentation for this class was generated from the following files:
inet::physicallayer::UwbIrStochasticPathLoss::PL0
double PL0
Definition: UwbIrStochasticPathLoss.h:60
inet::physicallayer::UwbIrStochasticPathLoss::d0
static const m d0
Definition: UwbIrStochasticPathLoss.h:52
inet::physicallayer::UwbIrStochasticPathLoss::kappa
static const double kappa
Definition: UwbIrStochasticPathLoss.h:58
inet::units::units::mps
compose< m, pow< s, -1 > > mps
Definition: Units.h:1151
inet::physicallayer::UwbIrStochasticPathLoss::muSigma
double muSigma
Definition: UwbIrStochasticPathLoss.h:62
inet::physicallayer::UwbIrStochasticPathLoss::n1_limit
static const double n1_limit
Definition: UwbIrStochasticPathLoss.h:53
SPEED_OF_LIGHT
#define SPEED_OF_LIGHT
Definition: INETDefs.h:59
inet::physicallayer::UwbIrStochasticPathLoss::fc
static const Hz fc
Definition: UwbIrStochasticPathLoss.h:51
inet::physicallayer::UwbIrStochasticPathLoss::n2_limit
static const double n2_limit
Definition: UwbIrStochasticPathLoss.h:54
inet::physicallayer::UwbIrStochasticPathLoss::pathloss_exponent
double pathloss_exponent
Definition: UwbIrStochasticPathLoss.h:65
inet::physicallayer::UwbIrStochasticPathLoss::sigmaSigma
double sigmaSigma
Definition: UwbIrStochasticPathLoss.h:64
inet::physicallayer::UwbIrStochasticPathLoss::simtruncnormal
virtual double simtruncnormal(double mean, double stddev, double a, int rng) const
Definition: UwbIrStochasticPathLoss.cc:39
EV_FIELD
#define EV_FIELD(...)
Definition: INETDefs.h:112
inet::math::dB2fraction
double dB2fraction(double dB)
Converts a dB value to fraction.
Definition: INETMath.h:153
NaN
#define NaN
Definition: INETMath.h:91
inet::INITSTAGE_LOCAL
INET_API InitStage INITSTAGE_LOCAL
Initialization of local state that don't use or affect other modules includes:
inet::physicallayer::UwbIrStochasticPathLoss::getGhassemzadehPathLoss
virtual double getGhassemzadehPathLoss(double gamma, double S, m distance) const
Definition: UwbIrStochasticPathLoss.cc:82
inet::IPrintableObject::PRINT_LEVEL_TRACE
@ PRINT_LEVEL_TRACE
Definition: IPrintableObject.h:22
inet::units::unit
pow< internal::none, 0 > unit
Definition: Units.h:72
inet::units::units::S
compose< A, pow< V, -1 > > S
Definition: Units.h:948
inet::physicallayer::UwbIrStochasticPathLoss::n3_limit
static const double n3_limit
Definition: UwbIrStochasticPathLoss.h:55
inet::physicallayer::UwbIrStochasticPathLoss::sigmaGamma
double sigmaGamma
Definition: UwbIrStochasticPathLoss.h:63
inet::units::values::m
value< double, units::m > m
Definition: Units.h:1233
inet::physicallayer::UwbIrStochasticPathLoss::muGamma
double muGamma
Definition: UwbIrStochasticPathLoss.h:61
M_PI
#define M_PI
Definition: INETMath.h:52
inet::physicallayer::UwbIrStochasticPathLoss::shadowing
bool shadowing
Definition: UwbIrStochasticPathLoss.h:66