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

#include <DimensionalNoise.h>

Inheritance diagram for inet::physicallayer::DimensionalNoise:
inet::physicallayer::NarrowbandNoiseBase inet::physicallayer::NoiseBase inet::physicallayer::INoise inet::physicallayer::IPrintableObject

Public Member Functions

 DimensionalNoise (simtime_t startTime, simtime_t endTime, Hz carrierFrequency, Hz bandwidth, const ConstMapping *power)
 
virtual ~DimensionalNoise ()
 
virtual std::ostream & printToStream (std::ostream &stream, int level) const override
 Prints this object to the provided output stream. More...
 
virtual const ConstMappinggetPower () const
 
virtual W computeMaxPower (simtime_t startTime, simtime_t endTime) const override
 
- Public Member Functions inherited from inet::physicallayer::NarrowbandNoiseBase
 NarrowbandNoiseBase (simtime_t startTime, simtime_t endTime, Hz carrierFrequency, Hz bandwidth)
 
virtual Hz getCarrierFrequency () const
 
virtual Hz getBandwidth () const
 
- Public Member Functions inherited from inet::physicallayer::NoiseBase
 NoiseBase (simtime_t startTime, simtime_t endTime)
 
virtual const simtime_t getStartTime () const override
 
virtual const simtime_t getEndTime () const override
 
- 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 Attributes

const ConstMappingpower
 
- Protected Attributes inherited from inet::physicallayer::NarrowbandNoiseBase
const Hz carrierFrequency
 
const Hz bandwidth
 
- Protected Attributes inherited from inet::physicallayer::NoiseBase
const simtime_t startTime
 
const simtime_t endTime
 

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
}
 

Constructor & Destructor Documentation

inet::physicallayer::DimensionalNoise::DimensionalNoise ( simtime_t  startTime,
simtime_t  endTime,
Hz  carrierFrequency,
Hz  bandwidth,
const ConstMapping power 
)
24  :
26  power(power)
27 {
28 }
const Hz carrierFrequency
Definition: NarrowbandNoiseBase.h:30
const simtime_t endTime
Definition: NoiseBase.h:31
const simtime_t startTime
Definition: NoiseBase.h:30
const ConstMapping * power
Definition: DimensionalNoise.h:32
const Hz bandwidth
Definition: NarrowbandNoiseBase.h:31
NarrowbandNoiseBase(simtime_t startTime, simtime_t endTime, Hz carrierFrequency, Hz bandwidth)
Definition: NarrowbandNoiseBase.cc:24
virtual inet::physicallayer::DimensionalNoise::~DimensionalNoise ( )
inlinevirtual
36 { delete power; }
const ConstMapping * power
Definition: DimensionalNoise.h:32

Member Function Documentation

W inet::physicallayer::DimensionalNoise::computeMaxPower ( simtime_t  startTime,
simtime_t  endTime 
) const
overridevirtual

Implements inet::physicallayer::NarrowbandNoiseBase.

44 {
45  const DimensionSet& dimensions = power->getDimensionSet();
46  Argument start(dimensions);
47  Argument end(dimensions);
48  if (dimensions.hasDimension(Dimension::time)) {
49  start.setTime(startTime);
50  end.setTime(endTime);
51  }
52  if (dimensions.hasDimension(Dimension::frequency)) {
53  start.setArgValue(Dimension::frequency, carrierFrequency.get() - bandwidth.get() / 2);
54  end.setArgValue(Dimension::frequency, carrierFrequency.get() + bandwidth.get() / 2);
55  }
56  W maxPower = W(MappingUtils::findMax(*power, start, end));
57  EV_DEBUG << "Computing maximum noise power: start = " << start << ", end = " << end << " -> " << maxPower << endl;
58  return maxPower;
59 }
const Hz carrierFrequency
Definition: NarrowbandNoiseBase.h:30
static const Dimension time
Shortcut to the time Dimension, same as &#39;Dimension("time")&#39;, but spares the parsing of a string...
Definition: MappingBase.h:64
const simtime_t endTime
Definition: NoiseBase.h:31
static Argument::mapped_type findMax(const ConstMapping &m, Argument::mapped_type_cref cRetNotFound=cMaxNotFound)
Iterates over the passed mapping and returns value at the key entry with the highest value...
Definition: MappingUtils.cc:237
const simtime_t startTime
Definition: NoiseBase.h:30
const value_type & get() const
Definition: Units.h:89
compose< J, pow< s,-1 > > W
Definition: Units.h:770
const DimensionSet & getDimensionSet() const
Returns this Mappings domain as DimensionSet.
Definition: MappingBase.h:995
const ConstMapping * power
Definition: DimensionalNoise.h:32
static const Dimension frequency
Shortcut to the frequency Dimension, same as &#39;Dimension("frequency")&#39;, but spares the parsing of a st...
Definition: MappingBase.h:68
const Hz bandwidth
Definition: NarrowbandNoiseBase.h:31
virtual const ConstMapping* inet::physicallayer::DimensionalNoise::getPower ( ) const
inlinevirtual
std::ostream & inet::physicallayer::DimensionalNoise::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::NarrowbandNoiseBase.

31 {
32  stream << "DimensionalNoise";
33  if (level <= PRINT_LEVEL_DETAIL)
34  stream << ", powerDimensionSet = " << power->getDimensionSet();
35  if (level <= PRINT_LEVEL_DEBUG)
36  stream << ", powerMax = " << MappingUtils::findMax(*power)
37  << ", powerMin = " << MappingUtils::findMin(*power);
38  if (level <= PRINT_LEVEL_TRACE)
39  stream << ", power = " << power;
40  return NarrowbandNoiseBase::printToStream(stream, level);
41 }
static Argument::mapped_type findMax(const ConstMapping &m, Argument::mapped_type_cref cRetNotFound=cMaxNotFound)
Iterates over the passed mapping and returns value at the key entry with the highest value...
Definition: MappingUtils.cc:237
const DimensionSet & getDimensionSet() const
Returns this Mappings domain as DimensionSet.
Definition: MappingBase.h:995
const ConstMapping * power
Definition: DimensionalNoise.h:32
virtual std::ostream & printToStream(std::ostream &stream, int level) const override
Prints this object to the provided output stream.
Definition: NarrowbandNoiseBase.cc:31
static Argument::mapped_type findMin(const ConstMapping &m, Argument::mapped_type_cref cRetNotFound=cMinNotFound)
Iterates over the passed mapping and returns value at the key entry with the smallest value...
Definition: MappingUtils.cc:322

Member Data Documentation

const ConstMapping* inet::physicallayer::DimensionalNoise::power
protected

Referenced by computeMaxPower(), and printToStream().


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