A Discrete-Event Network Simulator
API
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
ns3::SpectrumConverter Class Reference

#include <spectrum-converter.h>

+ Inheritance diagram for ns3::SpectrumConverter:

Public Member Functions

 SpectrumConverter (Ptr< const SpectrumModel > fromSpectrumModel, Ptr< const SpectrumModel > toSpectrumModel)
 
Ptr< SpectrumValueConvert (Ptr< const SpectrumValue > vvf) const
 
- Public Member Functions inherited from ns3::SimpleRefCount< SpectrumConverter >
 SimpleRefCount (const SimpleRefCount &o)
 
uint32_t GetReferenceCount (void) const
 
SimpleRefCountoperator= (const SimpleRefCount &o)
 
void Ref (void) const
 
void Unref (void) const
 

Private Member Functions

double GetCoefficient (const BandInfo &from, const BandInfo &to) const
 

Private Attributes

std::vector< std::vector
< double > > 
m_conversionMatrix
 
Ptr< const SpectrumModelm_fromSpectrumModel
 
Ptr< const SpectrumModelm_toSpectrumModel
 

Additional Inherited Members

- Static Public Member Functions inherited from ns3::SimpleRefCount< SpectrumConverter >
static void Cleanup (void)
 

Detailed Description

Class which implements a converter between SpectrumValue which are defined over different SpectrumModel. In more formal terms, this class allows conversion between different function spaces. In practical terms, this allows you to mix different spectrum representation within the same channel, such as a device using a coarse spectrum representation (e.g., one frequency for each IEEE 802.11 channel) and devices using a finer representation (e.g., one frequency for each OFDM subcarrier).

Definition at line 42 of file spectrum-converter.h.

Constructor & Destructor Documentation

ns3::SpectrumConverter::SpectrumConverter ( Ptr< const SpectrumModel fromSpectrumModel,
Ptr< const SpectrumModel toSpectrumModel 
)

Create a SpectrumConverter class that will be able to convert ValueVsFreq instances defined over one SpectrumModel to corresponding ValueVsFreq instances defined over a diffent SpectrumModel

Parameters
fromSpectrumModelthe SpectrumModel to convert from
toSpectrumModelthe SpectrumModel to convert to

Definition at line 36 of file spectrum-converter.cc.

References GetCoefficient(), NS_LOG_FUNCTION, and NS_LOG_LOGIC.

Member Function Documentation

Ptr< SpectrumValue > ns3::SpectrumConverter::Convert ( Ptr< const SpectrumValue vvf) const

Convert a particular ValueVsFreq instance to

Parameters
vvfthe ValueVsFreq instance to be converted
Returns
the converted version of the provided ValueVsFreq

Definition at line 74 of file spectrum-converter.cc.

References NS_ASSERT.

double ns3::SpectrumConverter::GetCoefficient ( const BandInfo from,
const BandInfo to 
) const
private

Calculate the coefficient for value conversion between elements

Parameters
fromBandInfo to convert from
toBandInfo to convert to
Returns
the fraction of the value of the "from" BandInfos that is mapped to the "to" BandInfo

Definition at line 62 of file spectrum-converter.cc.

References ns3::BandInfo::fh, ns3::BandInfo::fl, and NS_LOG_FUNCTION.

Referenced by SpectrumConverter().


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