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-interference.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_INTERFERENCE_H
10
#define SPECTRUM_INTERFERENCE_H
11
12
#include "
spectrum-value.h
"
13
14
#include <ns3/nstime.h>
15
#include <ns3/object.h>
16
#include <ns3/packet.h>
17
18
namespace
ns3
19
{
20
21
class
SpectrumErrorModel;
22
23
/**
24
* @ingroup spectrum
25
*
26
* This class implements a gaussian interference model, i.e., all
27
* incoming signals are added to the total interference.
28
*
29
*/
30
class
SpectrumInterference
:
public
Object
31
{
32
public
:
33
SpectrumInterference
();
34
~SpectrumInterference
()
override
;
35
36
/**
37
* Register this type.
38
* @return The TypeId.
39
*/
40
static
TypeId
GetTypeId
();
41
42
/**
43
* Set the SpectrumErrorModel to be used.
44
*
45
* @param e the error model
46
*/
47
void
SetErrorModel
(
Ptr<SpectrumErrorModel>
e);
48
49
/**
50
* Notify that the PHY is starting a RX attempt
51
*
52
* @param p the packet corresponding to the signal being RX
53
* @param rxPsd the power spectral density of the signal being RX
54
*/
55
void
StartRx
(
Ptr<const Packet>
p,
Ptr<const SpectrumValue>
rxPsd);
56
57
/**
58
* Notify that the PHY has aborted RX
59
*/
60
void
AbortRx
();
61
62
/**
63
* Notify that the RX attempt has ended. The receiving PHY must call
64
* this method upon RX end in order to:
65
* 1) know if RX was successful or not
66
* 2) free up resources that might eventually be used for the
67
* calculation of interference. Note that for this reason this
68
* method must also be called when RX is aborted.
69
*
70
*
71
* @return true if RX was successful, false otherwise
72
*/
73
bool
EndRx
();
74
75
/**
76
* Notify that a new signal is being perceived in the medium. This
77
* method is to be called for all incoming signal, regardless of
78
* whether they're useful signals or interferers.
79
*
80
* @param spd the power spectral density of the new signal
81
* @param duration the duration of the new signal
82
*/
83
void
AddSignal
(
Ptr<const SpectrumValue>
spd,
const
Time
duration);
84
85
/**
86
* Set the Noise Power Spectral Density
87
*
88
* @param noisePsd the Noise Power Spectral Density in power units
89
* (Watt, Pascal...) per Hz.
90
*/
91
void
SetNoisePowerSpectralDensity
(
Ptr<const SpectrumValue>
noisePsd);
92
93
protected
:
94
void
DoDispose
()
override
;
95
96
private
:
97
/**
98
* Evaluate a Chunk, depending on the Rx status and the last update time
99
*/
100
void
ConditionallyEvaluateChunk
();
101
/**
102
* Adds a signal perceived in the medium.
103
* @param spd the power spectral density of the new signal
104
*/
105
void
DoAddSignal
(
Ptr<const SpectrumValue>
spd);
106
/**
107
* Removes a signal perceived in the medium.
108
* @param spd the power spectral density of the new signal
109
*/
110
void
DoSubtractSignal
(
Ptr<const SpectrumValue>
spd);
111
112
bool
m_receiving
;
//!< True if in Rx status
113
114
/**
115
* Stores the power spectral density of the signal whose RX is being attempted
116
*/
117
Ptr<const SpectrumValue>
m_rxSignal
;
118
119
/**
120
* Stores the spectral power density of the sum of incoming signals;
121
* does not include noise, includes the SPD of the signal being RX
122
*/
123
Ptr<SpectrumValue>
m_allSignals
;
124
125
Ptr<const SpectrumValue>
m_noise
;
//!< Noise spectral power density
126
127
Time
m_lastChangeTime
;
//!< the time of the last change in m_TotalPower
128
129
Ptr<SpectrumErrorModel>
m_errorModel
;
//!< Error model
130
};
131
132
}
// namespace ns3
133
134
#endif
/* SPECTRUM_INTERFERENCE_H */
ns3::Object
A base class which provides memory management and object aggregation.
Definition
object.h:78
ns3::Ptr
Smart pointer class similar to boost::intrusive_ptr.
Definition
mpi-test-fixtures.h:37
ns3::SpectrumInterference
This class implements a gaussian interference model, i.e., all incoming signals are added to the tota...
Definition
spectrum-interference.h:31
ns3::SpectrumInterference::~SpectrumInterference
~SpectrumInterference() override
Definition
spectrum-interference.cc:31
ns3::SpectrumInterference::AbortRx
void AbortRx()
Notify that the PHY has aborted RX.
Definition
spectrum-interference.cc:68
ns3::SpectrumInterference::SetNoisePowerSpectralDensity
void SetNoisePowerSpectralDensity(Ptr< const SpectrumValue > noisePsd)
Set the Noise Power Spectral Density.
Definition
spectrum-interference.cc:126
ns3::SpectrumInterference::ConditionallyEvaluateChunk
void ConditionallyEvaluateChunk()
Evaluate a Chunk, depending on the Rx status and the last update time.
Definition
spectrum-interference.cc:109
ns3::SpectrumInterference::m_allSignals
Ptr< SpectrumValue > m_allSignals
Stores the spectral power density of the sum of incoming signals; does not include noise,...
Definition
spectrum-interference.h:123
ns3::SpectrumInterference::EndRx
bool EndRx()
Notify that the RX attempt has ended.
Definition
spectrum-interference.cc:74
ns3::SpectrumInterference::m_lastChangeTime
Time m_lastChangeTime
the time of the last change in m_TotalPower
Definition
spectrum-interference.h:127
ns3::SpectrumInterference::m_receiving
bool m_receiving
True if in Rx status.
Definition
spectrum-interference.h:112
ns3::SpectrumInterference::GetTypeId
static TypeId GetTypeId()
Register this type.
Definition
spectrum-interference.cc:37
ns3::SpectrumInterference::m_noise
Ptr< const SpectrumValue > m_noise
Noise spectral power density.
Definition
spectrum-interference.h:125
ns3::SpectrumInterference::SetErrorModel
void SetErrorModel(Ptr< SpectrumErrorModel > e)
Set the SpectrumErrorModel to be used.
Definition
spectrum-interference.cc:138
ns3::SpectrumInterference::DoSubtractSignal
void DoSubtractSignal(Ptr< const SpectrumValue > spd)
Removes a signal perceived in the medium.
Definition
spectrum-interference.cc:100
ns3::SpectrumInterference::StartRx
void StartRx(Ptr< const Packet > p, Ptr< const SpectrumValue > rxPsd)
Notify that the PHY is starting a RX attempt.
Definition
spectrum-interference.cc:58
ns3::SpectrumInterference::m_errorModel
Ptr< SpectrumErrorModel > m_errorModel
Error model.
Definition
spectrum-interference.h:129
ns3::SpectrumInterference::DoAddSignal
void DoAddSignal(Ptr< const SpectrumValue > spd)
Adds a signal perceived in the medium.
Definition
spectrum-interference.cc:91
ns3::SpectrumInterference::SpectrumInterference
SpectrumInterference()
Definition
spectrum-interference.cc:21
ns3::SpectrumInterference::DoDispose
void DoDispose() override
Destructor implementation.
Definition
spectrum-interference.cc:47
ns3::SpectrumInterference::AddSignal
void AddSignal(Ptr< const SpectrumValue > spd, const Time duration)
Notify that a new signal is being perceived in the medium.
Definition
spectrum-interference.cc:83
ns3::SpectrumInterference::m_rxSignal
Ptr< const SpectrumValue > m_rxSignal
Stores the power spectral density of the signal whose RX is being attempted.
Definition
spectrum-interference.h:117
ns3::Time
Simulation virtual time values and global simulation resolution.
Definition
nstime.h:94
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.
spectrum-value.h
src
spectrum
model
spectrum-interference.h
Generated on Thu Dec 12 2024 18:40:47 for ns-3 by
1.11.0