A Discrete-Event Network Simulator
API
Loading...
Searching...
No Matches
ns3::SpectrumConverter Class Reference

Class which implements a converter between SpectrumValue which are defined over different SpectrumModel. More...

#include "spectrum-converter.h"

Inheritance diagram for ns3::SpectrumConverter:
Collaboration diagram for ns3::SpectrumConverter:

Public Member Functions

 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 different SpectrumModel.
Ptr< SpectrumValueConvert (Ptr< const SpectrumValue > vvf) const
 Convert a particular ValueVsFreq instance to.
Public Member Functions inherited from ns3::SimpleRefCount< SpectrumConverter >
 SimpleRefCount ()
 Default constructor.
uint32_t GetReferenceCount () const
 Get the reference count of the object.
SimpleRefCountoperator= (const SimpleRefCount &o)
 Assignment operator.
void Ref () const
 Increment the reference count.
void Unref () const
 Decrement the reference count.

Private Attributes

std::vector< size_t > m_conversionColInd
 column of each non-zero element in m_conversionMatrix
std::vector< doublem_conversionMatrix
 matrix of conversion coefficients stored in Compressed Row Storage format
std::vector< size_t > m_conversionRowPtr
 offset of rows in m_conversionMatrix
Ptr< const SpectrumModelm_fromSpectrumModel
 the SpectrumModel this SpectrumConverter instance can convert from
Ptr< const SpectrumModelm_toSpectrumModel
 the SpectrumModel this SpectrumConverter instance can convert to

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 30 of file spectrum-converter.h.

Constructor & Destructor Documentation

◆ SpectrumConverter()

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 different SpectrumModel.

Parameters
fromSpectrumModelthe SpectrumModel to convert from
toSpectrumModelthe SpectrumModel to convert to

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

References m_conversionColInd, m_conversionMatrix, m_conversionRowPtr, m_fromSpectrumModel, m_toSpectrumModel, NS_LOG_FUNCTION, and NS_LOG_LOGIC.

Member Function Documentation

◆ Convert()

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 127 of file spectrum-converter.cc.

References ns3::Create(), m_conversionColInd, m_conversionMatrix, m_conversionRowPtr, m_fromSpectrumModel, m_toSpectrumModel, and NS_ASSERT.

Referenced by SpectrumConverterTestSuite::SpectrumConverterTestSuite().

Here is the call graph for this function:
Here is the caller graph for this function:

Member Data Documentation

◆ m_conversionColInd

std::vector<size_t> ns3::SpectrumConverter::m_conversionColInd
private

column of each non-zero element in m_conversionMatrix

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

Referenced by SpectrumConverter(), and Convert().

◆ m_conversionMatrix

std::vector<double> ns3::SpectrumConverter::m_conversionMatrix
private

matrix of conversion coefficients stored in Compressed Row Storage format

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

Referenced by SpectrumConverter(), and Convert().

◆ m_conversionRowPtr

std::vector<size_t> ns3::SpectrumConverter::m_conversionRowPtr
private

offset of rows in m_conversionMatrix

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

Referenced by SpectrumConverter(), and Convert().

◆ m_fromSpectrumModel

Ptr<const SpectrumModel> ns3::SpectrumConverter::m_fromSpectrumModel
private

the SpectrumModel this SpectrumConverter instance can convert from

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

Referenced by SpectrumConverter(), and Convert().

◆ m_toSpectrumModel

Ptr<const SpectrumModel> ns3::SpectrumConverter::m_toSpectrumModel
private

the SpectrumModel this SpectrumConverter instance can convert to

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

Referenced by SpectrumConverter(), and Convert().


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