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

This class implements the stochastic Rician fading model. More...

#include <RicianFading.h>

Inheritance diagram for inet::physicallayer::RicianFading:
inet::physicallayer::FreeSpacePathLoss inet::physicallayer::PathLossBase inet::physicallayer::IPathLoss inet::physicallayer::IPrintableObject

Public Member Functions

 RicianFading ()
 
virtual std::ostream & printToStream (std::ostream &stream, int level) 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...
 
- Public Member Functions inherited from inet::physicallayer::FreeSpacePathLoss
 FreeSpacePathLoss ()
 
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::physicallayer::IPrintableObject
virtual ~IPrintableObject ()
 
virtual std::string getInfoStringRepresentation () const
 
virtual std::string getDetailStringRepresentation () const
 
virtual std::string getDebugStringRepresentation () const
 
virtual std::string getTraceStringRepresentation () const
 
virtual std::string getCompleteStringRepresentation () const
 

Protected Member Functions

virtual void initialize (int stage) override
 
- Protected Member Functions inherited from inet::physicallayer::FreeSpacePathLoss
virtual double computeFreeSpacePathLoss (m waveLength, m distance, double alpha, double systemLoss) const
 

Protected Attributes

double k
 
- Protected Attributes inherited from inet::physicallayer::FreeSpacePathLoss
double alpha
 
double systemLoss
 

Additional Inherited Members

- Public Types inherited from inet::physicallayer::IPrintableObject
enum  PrintLevel {
  PRINT_LEVEL_TRACE, PRINT_LEVEL_DEBUG, PRINT_LEVEL_DETAIL, PRINT_LEVEL_INFO,
  PRINT_LEVEL_COMPLETE = INT_MIN
}
 

Detailed Description

This class implements the stochastic Rician fading model.

Author
Oliver Graute

Constructor & Destructor Documentation

inet::physicallayer::RicianFading::RicianFading ( )
26  :
27  k(1)
28 {
29 }
double k
Definition: RicianFading.h:35

Member Function Documentation

double inet::physicallayer::RicianFading::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.

Reimplemented from inet::physicallayer::FreeSpacePathLoss.

50 {
51  m waveLength = propagationSpeed / frequency;
52  double c = 1.0 / (2.0 * (k + 1));
53  double x = normal(0, 1);
54  double y = normal(0, 1);
55  double rr = c * ((x + sqrt(2 * k)) * (x + sqrt(2 * k)) + y * y);
56  double freeSpacePathLoss = computeFreeSpacePathLoss(waveLength, distance, alpha, systemLoss);
57  return rr * freeSpacePathLoss;
58 }
virtual double computeFreeSpacePathLoss(m waveLength, m distance, double alpha, double systemLoss) const
Definition: FreeSpacePathLoss.cc:49
double systemLoss
Definition: FreeSpacePathLoss.h:36
double k
Definition: RicianFading.h:35
value< Value, pow< Unit, 1, 2 > > sqrt(const value< Value, Unit > &a)
Definition: Units.h:247
double alpha
Definition: FreeSpacePathLoss.h:35
const value< double, compose< units::m, pow< units::s,-1 > > > c(299792458)
value< double, units::m > m
Definition: Units.h:1047
void inet::physicallayer::RicianFading::initialize ( int  stage)
overrideprotectedvirtual

Reimplemented from inet::physicallayer::FreeSpacePathLoss.

32 {
34  if (stage == INITSTAGE_LOCAL) {
35  k = math::dB2fraction(par("k"));
36  }
37 }
double k
Definition: RicianFading.h:35
double dB2fraction(double dB)
Converts a dB value to fraction.
Definition: INETMath.h:166
Local initializations.
Definition: InitStages.h:35
virtual void initialize(int stage) override
Definition: FreeSpacePathLoss.cc:32
std::ostream & inet::physicallayer::RicianFading::printToStream ( std::ostream &  stream,
int  level 
) const
overridevirtual

Prints this object to the provided output stream.

Function calls to operator<< with pointers or references either const or not are all forwarded to this function.

Reimplemented from inet::physicallayer::FreeSpacePathLoss.

40 {
41  stream << "RicianFading";
42  if (level <= PRINT_LEVEL_TRACE)
43  stream << ", alpha = " << alpha
44  << ", system loss = " << systemLoss
45  << ", k = " << k;
46  return stream;
47 }
double systemLoss
Definition: FreeSpacePathLoss.h:36
double k
Definition: RicianFading.h:35
double alpha
Definition: FreeSpacePathLoss.h:35

Member Data Documentation

double inet::physicallayer::RicianFading::k
protected

The documentation for this class was generated from the following files: