A Discrete-Event Network Simulator
API
Loading...
Searching...
No Matches
lte-interference.h
Go to the documentation of this file.
1/*
2 * Copyright (c) 2009 CTTC
3 *
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License version 2 as
6 * published by the Free Software Foundation;
7 *
8 * This program is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU General Public License for more details.
12 *
13 * You should have received a copy of the GNU General Public License
14 * along with this program; if not, write to the Free Software
15 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
16 *
17 * Author: Nicola Baldo <nbaldo@cttc.es>
18 */
19
20#ifndef LTE_INTERFERENCE_H
21#define LTE_INTERFERENCE_H
22
23#include <ns3/nstime.h>
24#include <ns3/object.h>
25#include <ns3/packet.h>
26#include <ns3/spectrum-value.h>
27
28#include <list>
29
30namespace ns3
31{
32
33class LteChunkProcessor;
34
35/**
36 * This class implements a gaussian interference model, i.e., all
37 * incoming signals are added to the total interference.
38 *
39 */
40class LteInterference : public Object
41{
42 public:
44 ~LteInterference() override;
45
46 /**
47 * \brief Get the type ID.
48 * \return the object TypeId
49 */
50 static TypeId GetTypeId();
51 void DoDispose() override;
52
53 /**
54 * \brief Add a LteChunkProcessor that will use the time-vs-frequency SINR
55 * calculated by this LteInterference instance. Note that all the
56 * added LteChunkProcessors will work in parallel.
57 *
58 * @param p
59 */
61
62 /**
63 * \brief Add a LteChunkProcessor that will use the time-vs-frequency
64 * interference calculated by this LteInterference instance. Note
65 * that all the added LteChunkProcessors will work in parallel.
66 *
67 * @param p
68 */
70
71 /**
72 * Add a LteChunkProcessor that will use the time-vs-frequency
73 * power calculated by this LteInterference instance. Note
74 * that all the added LteChunkProcessors will work in parallel.
75 *
76 * @param p
77 */
79
80 /**
81 * \brief Notify that the PHY is starting a RX attempt
82 *
83 * @param rxPsd the power spectral density of the signal being RX
84 */
85 virtual void StartRx(Ptr<const SpectrumValue> rxPsd);
86
87 /**
88 * notify that the RX attempt has ended. The receiving PHY must call
89 * this method when RX ends or RX is aborted.
90 *
91 */
92 virtual void EndRx();
93
94 /**
95 * notify that a new signal is being perceived in the medium. This
96 * method is to be called for all incoming signal, regardless of
97 * whether they're useful signals or interferers.
98 *
99 * @param spd the power spectral density of the new signal
100 * @param duration the duration of the new signal
101 */
102 virtual void AddSignal(Ptr<const SpectrumValue> spd, const Time duration);
103
104 /**
105 *
106 * @param noisePsd the Noise Power Spectral Density in power units
107 * (Watt, Pascal...) per Hz.
108 */
110
111 protected:
112 /**
113 * Conditionally evaluate chunk
114 */
115 virtual void ConditionallyEvaluateChunk();
116 /**
117 * Add signal function
118 *
119 * @param spd the power spectral density of the new signal
120 */
121 virtual void DoAddSignal(Ptr<const SpectrumValue> spd);
122 /**
123 * Subtract signal
124 *
125 * @param spd the power spectral density of the new signal
126 * @param signalId the signal ID
127 */
128 virtual void DoSubtractSignal(Ptr<const SpectrumValue> spd, uint32_t signalId);
129
130 bool m_receiving{false}; ///< are we receiving?
131
132 Ptr<SpectrumValue> m_rxSignal{nullptr}; /**< stores the power spectral density of
133 * the signal whose RX is being
134 * attempted
135 */
136
138 nullptr}; /**< stores the spectral
139 * power density of the sum of incoming signals;
140 * does not include noise, includes the SPD of the signal being RX
141 */
142
143 Ptr<const SpectrumValue> m_noise{nullptr}; ///< the noise value
144
145 Time m_lastChangeTime{Seconds(0)}; /**< the time of the last change in
146 * m_TotalPower
147 */
148
149 uint32_t m_lastSignalId{0}; ///< the last signal ID
150 uint32_t m_lastSignalIdBeforeReset{0}; ///< the last signal ID before reset
151
152 /** all the processor instances that need to be notified whenever
153 a new interference chunk is calculated */
154 std::list<Ptr<LteChunkProcessor>> m_rsPowerChunkProcessorList;
155
156 /** all the processor instances that need to be notified whenever
157 a new SINR chunk is calculated */
158 std::list<Ptr<LteChunkProcessor>> m_sinrChunkProcessorList;
159
160 /** all the processor instances that need to be notified whenever
161 a new interference chunk is calculated */
162 std::list<Ptr<LteChunkProcessor>> m_interfChunkProcessorList;
163};
164
165} // namespace ns3
166
167#endif /* LTE_INTERFERENCE_H */
This class implements a gaussian interference model, i.e., all incoming signals are added to the tota...
static TypeId GetTypeId()
Get the type ID.
virtual void DoSubtractSignal(Ptr< const SpectrumValue > spd, uint32_t signalId)
Subtract signal.
Ptr< SpectrumValue > m_rxSignal
stores the power spectral density of the signal whose RX is being attempted
bool m_receiving
are we receiving?
virtual void AddSinrChunkProcessor(Ptr< LteChunkProcessor > p)
Add a LteChunkProcessor that will use the time-vs-frequency SINR calculated by this LteInterference i...
virtual void ConditionallyEvaluateChunk()
Conditionally evaluate chunk.
virtual void SetNoisePowerSpectralDensity(Ptr< const SpectrumValue > noisePsd)
Ptr< SpectrumValue > m_allSignals
stores the spectral power density of the sum of incoming signals; does not include noise,...
virtual void EndRx()
notify that the RX attempt has ended.
uint32_t m_lastSignalIdBeforeReset
the last signal ID before reset
std::list< Ptr< LteChunkProcessor > > m_rsPowerChunkProcessorList
all the processor instances that need to be notified whenever a new interference chunk is calculated
virtual void AddSignal(Ptr< const SpectrumValue > spd, const Time duration)
notify that a new signal is being perceived in the medium.
virtual void AddInterferenceChunkProcessor(Ptr< LteChunkProcessor > p)
Add a LteChunkProcessor that will use the time-vs-frequency interference calculated by this LteInterf...
Ptr< const SpectrumValue > m_noise
the noise value
virtual void AddRsPowerChunkProcessor(Ptr< LteChunkProcessor > p)
Add a LteChunkProcessor that will use the time-vs-frequency power calculated by this LteInterference ...
Time m_lastChangeTime
the time of the last change in m_TotalPower
std::list< Ptr< LteChunkProcessor > > m_interfChunkProcessorList
all the processor instances that need to be notified whenever a new interference chunk is calculated
virtual void StartRx(Ptr< const SpectrumValue > rxPsd)
Notify that the PHY is starting a RX attempt.
void DoDispose() override
Destructor implementation.
uint32_t m_lastSignalId
the last signal ID
std::list< Ptr< LteChunkProcessor > > m_sinrChunkProcessorList
all the processor instances that need to be notified whenever a new SINR chunk is calculated
virtual void DoAddSignal(Ptr< const SpectrumValue > spd)
Add signal function.
A base class which provides memory management and object aggregation.
Definition: object.h:89
Smart pointer class similar to boost::intrusive_ptr.
Definition: ptr.h:77
Simulation virtual time values and global simulation resolution.
Definition: nstime.h:105
a unique identifier for an interface.
Definition: type-id.h:59
Time Seconds(double value)
Construct a Time in the indicated unit.
Definition: nstime.h:1326
Every class exported by the ns3 library is enclosed in the ns3 namespace.