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
rem-spectrum-phy.h
Go to the documentation of this file.
1
/*
2
* Copyright (c) 2012 CTTC
3
*
4
* SPDX-License-Identifier: GPL-2.0-only
5
*
6
* Author: Nicola Baldo <nbaldo@cttc.es>
7
*/
8
9
#ifndef REM_SPECTRUM_PHY_H
10
#define REM_SPECTRUM_PHY_H
11
12
#include <ns3/mobility-model.h>
13
#include <ns3/net-device.h>
14
#include <ns3/nstime.h>
15
#include <ns3/packet.h>
16
#include <ns3/spectrum-channel.h>
17
#include <ns3/spectrum-phy.h>
18
#include <ns3/spectrum-value.h>
19
20
#include <fstream>
21
#include <string>
22
23
namespace
ns3
24
{
25
26
/**
27
*
28
* This minimal SpectrumPhy implementation calculates the SINR with
29
* respect to the strongest signal for a given point. The original
30
* purpose of this class is to be used to generate a
31
* Radio Environment Map (REM) by locating several instances in a grid
32
* fashion, and connecting them to the channel only for a very short
33
* amount of time.
34
*
35
* The assumption on which this class works is that the system
36
* being considered is an infrastructure radio access network using
37
* FDD, hence all signals will be transmitted simultaneously.
38
*/
39
class
RemSpectrumPhy
:
public
SpectrumPhy
40
{
41
public
:
42
RemSpectrumPhy
();
43
~RemSpectrumPhy
()
override
;
44
45
// inherited from Object
46
void
DoDispose
()
override
;
47
/**
48
* \brief Get the type ID.
49
* \return the object TypeId
50
*/
51
static
TypeId
GetTypeId
();
52
53
// inherited from SpectrumPhy
54
void
SetChannel
(
Ptr<SpectrumChannel>
c)
override
;
55
void
SetMobility
(
Ptr<MobilityModel>
m)
override
;
56
void
SetDevice
(
Ptr<NetDevice>
d)
override
;
57
Ptr<MobilityModel>
GetMobility
()
const override
;
58
Ptr<NetDevice>
GetDevice
()
const override
;
59
Ptr<const SpectrumModel>
GetRxSpectrumModel
()
const override
;
60
Ptr<Object>
GetAntenna
()
const override
;
61
void
StartRx
(
Ptr<SpectrumSignalParameters>
params)
override
;
62
63
/**
64
* set the RX spectrum model to be used
65
*
66
* \param m
67
*/
68
void
SetRxSpectrumModel
(
Ptr<const SpectrumModel>
m);
69
70
/**
71
*
72
* \param noisePower the noise power
73
* \return the Signal to Noise Ratio calculated
74
*/
75
double
GetSinr
(
double
noisePower)
const
;
76
77
/**
78
* make StartRx a no-op from now on, and mark instance as inactive
79
*
80
*/
81
void
Deactivate
();
82
83
/**
84
*
85
* \return true if active
86
*/
87
bool
IsActive
()
const
;
88
89
/**
90
* Reset the SINR calculator
91
*
92
*/
93
void
Reset
();
94
95
/**
96
* set usage of DataChannel
97
*
98
* \param value if true, data channel signal will be processed, control signal otherwise
99
*/
100
void
SetUseDataChannel
(
bool
value);
101
102
/**
103
* set RB Id
104
*
105
* \param rbId Resource Block Id which will be processed
106
*/
107
void
SetRbId
(
int32_t
rbId);
108
109
private
:
110
Ptr<MobilityModel>
m_mobility
;
///< the mobility model
111
Ptr<const SpectrumModel>
m_rxSpectrumModel
;
///< receive spectrum model
112
113
double
m_referenceSignalPower
;
///< reference signal power
114
double
m_sumPower
;
///< sum power
115
116
bool
m_active
;
///< is active?
117
118
bool
m_useDataChannel
;
///< use data channel
119
int32_t
m_rbId
;
///< RBID
120
};
121
122
}
// namespace ns3
123
124
#endif
/* REM_SPECTRUM_PHY_H */
int32_t
ns3::Ptr
Smart pointer class similar to boost::intrusive_ptr.
Definition
mpi-test-fixtures.h:37
ns3::RemSpectrumPhy
This minimal SpectrumPhy implementation calculates the SINR with respect to the strongest signal for ...
Definition
rem-spectrum-phy.h:40
ns3::RemSpectrumPhy::RemSpectrumPhy
RemSpectrumPhy()
Definition
rem-spectrum-phy.cc:29
ns3::RemSpectrumPhy::m_referenceSignalPower
double m_referenceSignalPower
reference signal power
Definition
rem-spectrum-phy.h:113
ns3::RemSpectrumPhy::m_mobility
Ptr< MobilityModel > m_mobility
the mobility model
Definition
rem-spectrum-phy.h:110
ns3::RemSpectrumPhy::DoDispose
void DoDispose() override
Destructor implementation.
Definition
rem-spectrum-phy.cc:46
ns3::RemSpectrumPhy::m_rbId
int32_t m_rbId
RBID.
Definition
rem-spectrum-phy.h:119
ns3::RemSpectrumPhy::Reset
void Reset()
Reset the SINR calculator.
Definition
rem-spectrum-phy.cc:193
ns3::RemSpectrumPhy::GetSinr
double GetSinr(double noisePower) const
Definition
rem-spectrum-phy.cc:175
ns3::RemSpectrumPhy::Deactivate
void Deactivate()
make StartRx a no-op from now on, and mark instance as inactive
Definition
rem-spectrum-phy.cc:181
ns3::RemSpectrumPhy::m_rxSpectrumModel
Ptr< const SpectrumModel > m_rxSpectrumModel
receive spectrum model
Definition
rem-spectrum-phy.h:111
ns3::RemSpectrumPhy::StartRx
void StartRx(Ptr< SpectrumSignalParameters > params) override
Notify the SpectrumPhy instance of an incoming signal.
Definition
rem-spectrum-phy.cc:110
ns3::RemSpectrumPhy::GetAntenna
Ptr< Object > GetAntenna() const override
Get the AntennaModel used by this SpectrumPhy instance for transmission and/or reception.
Definition
rem-spectrum-phy.cc:104
ns3::RemSpectrumPhy::SetRbId
void SetRbId(int32_t rbId)
set RB Id
Definition
rem-spectrum-phy.cc:206
ns3::RemSpectrumPhy::GetTypeId
static TypeId GetTypeId()
Get the type ID.
Definition
rem-spectrum-phy.cc:54
ns3::RemSpectrumPhy::m_sumPower
double m_sumPower
sum power
Definition
rem-spectrum-phy.h:114
ns3::RemSpectrumPhy::SetRxSpectrumModel
void SetRxSpectrumModel(Ptr< const SpectrumModel > m)
set the RX spectrum model to be used
Definition
rem-spectrum-phy.cc:168
ns3::RemSpectrumPhy::~RemSpectrumPhy
~RemSpectrumPhy() override
Definition
rem-spectrum-phy.cc:40
ns3::RemSpectrumPhy::IsActive
bool IsActive() const
Definition
rem-spectrum-phy.cc:187
ns3::RemSpectrumPhy::GetRxSpectrumModel
Ptr< const SpectrumModel > GetRxSpectrumModel() const override
Definition
rem-spectrum-phy.cc:98
ns3::RemSpectrumPhy::GetDevice
Ptr< NetDevice > GetDevice() const override
Get the associated NetDevice instance.
Definition
rem-spectrum-phy.cc:92
ns3::RemSpectrumPhy::m_active
bool m_active
is active?
Definition
rem-spectrum-phy.h:116
ns3::RemSpectrumPhy::SetMobility
void SetMobility(Ptr< MobilityModel > m) override
Set the mobility model associated with this device.
Definition
rem-spectrum-phy.cc:71
ns3::RemSpectrumPhy::SetUseDataChannel
void SetUseDataChannel(bool value)
set usage of DataChannel
Definition
rem-spectrum-phy.cc:200
ns3::RemSpectrumPhy::GetMobility
Ptr< MobilityModel > GetMobility() const override
Get the associated MobilityModel instance.
Definition
rem-spectrum-phy.cc:86
ns3::RemSpectrumPhy::SetChannel
void SetChannel(Ptr< SpectrumChannel > c) override
Set the channel attached to this device.
Definition
rem-spectrum-phy.cc:64
ns3::RemSpectrumPhy::m_useDataChannel
bool m_useDataChannel
use data channel
Definition
rem-spectrum-phy.h:118
ns3::RemSpectrumPhy::SetDevice
void SetDevice(Ptr< NetDevice > d) override
Set the associated NetDevice instance.
Definition
rem-spectrum-phy.cc:78
ns3::SpectrumPhy
Abstract base class for Spectrum-aware PHY layers.
Definition
spectrum-phy.h:35
ns3::TypeId
a unique identifier for an interface.
Definition
type-id.h:48
ns3
Every class exported by the ns3 library is enclosed in the ns3 namespace.
src
lte
model
rem-spectrum-phy.h
Generated on Fri Nov 8 2024 13:59:03 for ns-3 by
1.11.0