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