A Discrete-Event Network Simulator
Home
Tutorials ▼
English
Documentation ▼
Installation
Manual
Models
Contributing
Wiki
Development ▼
API Docs
Issue Tracker
Merge Requests
API
Loading...
Searching...
No Matches
spectrum-converter.h
Go to the documentation of this file.
1
/*
2
* Copyright (c) 2009 CTTC
3
*
4
* SPDX-License-Identifier: GPL-2.0-only
5
*
6
* Author: Nicola Baldo <nbaldo@cttc.es>
7
*/
8
9
#ifndef SPECTRUM_CONVERTER_H
10
#define SPECTRUM_CONVERTER_H
11
12
#include "
spectrum-value.h
"
13
14
namespace
ns3
15
{
16
17
/**
18
* @ingroup spectrum
19
*
20
* Class which implements a converter between SpectrumValue which are
21
* defined over different SpectrumModel. In more formal terms, this class
22
* allows conversion between different function spaces. In practical
23
* terms, this allows you to mix different spectrum representation
24
* within the same channel, such as a device using a coarse spectrum
25
* representation (e.g., one frequency for each IEEE 802.11 channel)
26
* and devices using a finer representation (e.g., one frequency for
27
* each OFDM subcarrier).
28
*
29
*/
30
class
SpectrumConverter
:
public
SimpleRefCount
<SpectrumConverter>
31
{
32
public
:
33
/**
34
* Create a SpectrumConverter class that will be able to convert ValueVsFreq
35
* instances defined over one SpectrumModel to corresponding ValueVsFreq
36
* instances defined over a different SpectrumModel
37
*
38
* @param fromSpectrumModel the SpectrumModel to convert from
39
* @param toSpectrumModel the SpectrumModel to convert to
40
*/
41
SpectrumConverter
(
Ptr<const SpectrumModel>
fromSpectrumModel,
42
Ptr<const SpectrumModel>
toSpectrumModel);
43
44
/**
45
* Convert a particular ValueVsFreq instance to
46
*
47
* @param vvf the ValueVsFreq instance to be converted
48
*
49
* @return the converted version of the provided ValueVsFreq
50
*/
51
Ptr<SpectrumValue>
Convert
(
Ptr<const SpectrumValue>
vvf)
const
;
52
53
private
:
54
std::vector<double>
m_conversionMatrix
;
//!< matrix of conversion coefficients stored in
55
//!< Compressed Row Storage format
56
std::vector<size_t>
m_conversionRowPtr
;
//!< offset of rows in m_conversionMatrix
57
std::vector<size_t>
58
m_conversionColInd
;
//!< column of each non-zero element in m_conversionMatrix
59
60
Ptr<const SpectrumModel>
m_fromSpectrumModel
;
//!< the SpectrumModel this SpectrumConverter
61
//!< instance can convert from
62
Ptr<const SpectrumModel>
63
m_toSpectrumModel
;
//!< the SpectrumModel this SpectrumConverter instance can convert to
64
};
65
66
}
// namespace ns3
67
68
#endif
/* SPECTRUM_CONVERTER_H */
ns3::Ptr
Smart pointer class similar to boost::intrusive_ptr.
Definition
ptr.h:70
ns3::SimpleRefCount< SpectrumConverter >::SimpleRefCount
SimpleRefCount()
Definition
simple-ref-count.h:79
ns3::SpectrumConverter::m_conversionMatrix
std::vector< double > m_conversionMatrix
matrix of conversion coefficients stored in Compressed Row Storage format
Definition
spectrum-converter.h:54
ns3::SpectrumConverter::m_fromSpectrumModel
Ptr< const SpectrumModel > m_fromSpectrumModel
the SpectrumModel this SpectrumConverter instance can convert from
Definition
spectrum-converter.h:60
ns3::SpectrumConverter::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 ...
Definition
spectrum-converter.cc:77
ns3::SpectrumConverter::m_toSpectrumModel
Ptr< const SpectrumModel > m_toSpectrumModel
the SpectrumModel this SpectrumConverter instance can convert to
Definition
spectrum-converter.h:63
ns3::SpectrumConverter::Convert
Ptr< SpectrumValue > Convert(Ptr< const SpectrumValue > vvf) const
Convert a particular ValueVsFreq instance to.
Definition
spectrum-converter.cc:127
ns3::SpectrumConverter::m_conversionRowPtr
std::vector< size_t > m_conversionRowPtr
offset of rows in m_conversionMatrix
Definition
spectrum-converter.h:56
ns3::SpectrumConverter::m_conversionColInd
std::vector< size_t > m_conversionColInd
column of each non-zero element in m_conversionMatrix
Definition
spectrum-converter.h:58
ns3
Every class exported by the ns3 library is enclosed in the ns3 namespace.
spectrum-value.h
src
spectrum
model
spectrum-converter.h
Generated on
for ns-3 by
1.16.1