Class which implements a converter between SpectrumValue which are defined over different SpectrumModel. More...
#include "spectrum-converter.h"
Public Member Functions | |
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. | |
Ptr< SpectrumValue > | Convert (Ptr< const SpectrumValue > vvf) const |
Convert a particular ValueVsFreq instance to. | |
Public Member Functions inherited from ns3::SimpleRefCount< SpectrumConverter > | |
SimpleRefCount () | |
Default constructor. | |
SimpleRefCount (const SimpleRefCount &o) | |
Copy constructor. | |
uint32_t | GetReferenceCount () const |
Get the reference count of the object. | |
SimpleRefCount & | operator= (const SimpleRefCount &o) |
Assignment operator. | |
void | Ref () const |
Increment the reference count. | |
void | Unref () const |
Decrement the reference count. | |
Private Member Functions | |
double | GetCoefficient (const BandInfo &from, const BandInfo &to) const |
Calculate the coefficient for value conversion between elements. | |
Private Attributes | |
std::vector< size_t > | m_conversionColInd |
column of each non-zero element in m_conversionMatrix | |
std::vector< double > | m_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 SpectrumModel > | m_fromSpectrumModel |
the SpectrumModel this SpectrumConverter instance can convert from | |
Ptr< const SpectrumModel > | m_toSpectrumModel |
the SpectrumModel this SpectrumConverter instance can convert to | |
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.
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.
fromSpectrumModel | the SpectrumModel to convert from |
toSpectrumModel | the SpectrumModel to convert to |
Definition at line 25 of file spectrum-converter.cc.
References GetCoefficient(), m_conversionColInd, m_conversionMatrix, m_conversionRowPtr, m_fromSpectrumModel, m_toSpectrumModel, NS_LOG_FUNCTION, and NS_LOG_LOGIC.
ns3::SpectrumConverter::SpectrumConverter | ( | ) |
Definition at line 21 of file spectrum-converter.cc.
Ptr< SpectrumValue > ns3::SpectrumConverter::Convert | ( | Ptr< const SpectrumValue > | vvf | ) | const |
Convert a particular ValueVsFreq instance to.
vvf | the ValueVsFreq instance to be converted |
Definition at line 66 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().
|
private |
Calculate the coefficient for value conversion between elements.
Definition at line 56 of file spectrum-converter.cc.
References ns3::BandInfo::fh, ns3::BandInfo::fl, and NS_LOG_FUNCTION.
Referenced by SpectrumConverter().
|
private |
column of each non-zero element in m_conversionMatrix
Definition at line 71 of file spectrum-converter.h.
Referenced by SpectrumConverter(), and Convert().
|
private |
matrix of conversion coefficients stored in Compressed Row Storage format
Definition at line 67 of file spectrum-converter.h.
Referenced by SpectrumConverter(), and Convert().
|
private |
offset of rows in m_conversionMatrix
Definition at line 69 of file spectrum-converter.h.
Referenced by SpectrumConverter(), and Convert().
|
private |
the SpectrumModel this SpectrumConverter instance can convert from
Definition at line 73 of file spectrum-converter.h.
Referenced by SpectrumConverter(), and Convert().
|
private |
the SpectrumModel this SpectrumConverter instance can convert to
Definition at line 76 of file spectrum-converter.h.
Referenced by SpectrumConverter(), and Convert().