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 * SPDX-License-Identifier: GPL-2.0-only
5 *
6 * Author: Nicola Baldo <nbaldo@cttc.es>
7 */
8
9#ifndef LTE_INTERFERENCE_H
10#define LTE_INTERFERENCE_H
11
12#include <ns3/nstime.h>
13#include <ns3/object.h>
14#include <ns3/packet.h>
15#include <ns3/spectrum-value.h>
16
17#include <list>
18
19namespace ns3
20{
21
22class LteChunkProcessor;
23
24/**
25 * This class implements a gaussian interference model, i.e., all
26 * incoming signals are added to the total interference.
27 *
28 */
29class LteInterference : public Object
30{
31 public:
33 ~LteInterference() override;
34
35 /**
36 * \brief Get the type ID.
37 * \return the object TypeId
38 */
39 static TypeId GetTypeId();
40 void DoDispose() override;
41
42 /**
43 * \brief Add a LteChunkProcessor that will use the time-vs-frequency SINR
44 * calculated by this LteInterference instance. Note that all the
45 * added LteChunkProcessors will work in parallel.
46 *
47 * @param p
48 */
50
51 /**
52 * \brief Add a LteChunkProcessor that will use the time-vs-frequency
53 * interference calculated by this LteInterference instance. Note
54 * that all the added LteChunkProcessors will work in parallel.
55 *
56 * @param p
57 */
59
60 /**
61 * Add a LteChunkProcessor that will use the time-vs-frequency
62 * power calculated by this LteInterference instance. Note
63 * that all the added LteChunkProcessors will work in parallel.
64 *
65 * @param p
66 */
68
69 /**
70 * \brief Notify that the PHY is starting a RX attempt
71 *
72 * @param rxPsd the power spectral density of the signal being RX
73 */
74 virtual void StartRx(Ptr<const SpectrumValue> rxPsd);
75
76 /**
77 * notify that the RX attempt has ended. The receiving PHY must call
78 * this method when RX ends or RX is aborted.
79 *
80 */
81 virtual void EndRx();
82
83 /**
84 * notify that a new signal is being perceived in the medium. This
85 * method is to be called for all incoming signal, regardless of
86 * whether they're useful signals or interferers.
87 *
88 * @param spd the power spectral density of the new signal
89 * @param duration the duration of the new signal
90 */
91 virtual void AddSignal(Ptr<const SpectrumValue> spd, const Time duration);
92
93 /**
94 *
95 * @param noisePsd the Noise Power Spectral Density in power units
96 * (Watt, Pascal...) per Hz.
97 */
99
100 protected:
101 /**
102 * Conditionally evaluate chunk
103 */
104 virtual void ConditionallyEvaluateChunk();
105 /**
106 * Add signal function
107 *
108 * @param spd the power spectral density of the new signal
109 */
110 virtual void DoAddSignal(Ptr<const SpectrumValue> spd);
111 /**
112 * Subtract signal
113 *
114 * @param spd the power spectral density of the new signal
115 * @param signalId the signal ID
116 */
117 virtual void DoSubtractSignal(Ptr<const SpectrumValue> spd, uint32_t signalId);
118
119 bool m_receiving{false}; ///< are we receiving?
120
121 Ptr<SpectrumValue> m_rxSignal{nullptr}; /**< stores the power spectral density of
122 * the signal whose RX is being
123 * attempted
124 */
125
127 nullptr}; /**< stores the spectral
128 * power density of the sum of incoming signals;
129 * does not include noise, includes the SPD of the signal being RX
130 */
131
132 Ptr<const SpectrumValue> m_noise{nullptr}; ///< the noise value
133
134 Time m_lastChangeTime{Seconds(0)}; /**< the time of the last change in
135 * m_TotalPower
136 */
137
138 uint32_t m_lastSignalId{0}; ///< the last signal ID
139 uint32_t m_lastSignalIdBeforeReset{0}; ///< the last signal ID before reset
140
141 /** all the processor instances that need to be notified whenever
142 a new interference chunk is calculated */
143 std::list<Ptr<LteChunkProcessor>> m_rsPowerChunkProcessorList;
144
145 /** all the processor instances that need to be notified whenever
146 a new SINR chunk is calculated */
147 std::list<Ptr<LteChunkProcessor>> m_sinrChunkProcessorList;
148
149 /** all the processor instances that need to be notified whenever
150 a new interference chunk is calculated */
151 std::list<Ptr<LteChunkProcessor>> m_interfChunkProcessorList;
152};
153
154} // namespace ns3
155
156#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:78
Smart pointer class similar to boost::intrusive_ptr.
Simulation virtual time values and global simulation resolution.
Definition nstime.h:94
a unique identifier for an interface.
Definition type-id.h:48
Time Seconds(double value)
Construct a Time in the indicated unit.
Definition nstime.h:1308
Every class exported by the ns3 library is enclosed in the ns3 namespace.