author | Nicola Baldo <nbaldo@cttc.es> |
Mon, 04 Feb 2013 18:47:25 +0100 | |
changeset 9653 | 382d27da8905 |
parent 9562 | 691b97de80ed |
child 10892 | 3e86fac77082 |
permissions | -rw-r--r-- |
7886 | 1 |
/* -*- Mode: C++; c-file-style: "gnu"; indent-tabs-mode:nil; -*- */ |
2 |
/* |
|
3 |
* Copyright (c) 2009 CTTC |
|
4 |
* |
|
5 |
* This program is free software; you can redistribute it and/or modify |
|
6 |
* it under the terms of the GNU General Public License version 2 as |
|
7 |
* published by the Free Software Foundation; |
|
8 |
* |
|
9 |
* This program is distributed in the hope that it will be useful, |
|
10 |
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
|
11 |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|
12 |
* GNU General Public License for more details. |
|
13 |
* |
|
14 |
* You should have received a copy of the GNU General Public License |
|
15 |
* along with this program; if not, write to the Free Software |
|
16 |
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
|
17 |
* |
|
18 |
* Author: Nicola Baldo <nbaldo@cttc.es> |
|
19 |
*/ |
|
20 |
||
21 |
||
22 |
#ifndef LTE_INTERFERENCE_H |
|
23 |
#define LTE_INTERFERENCE_H |
|
24 |
||
25 |
#include <ns3/object.h> |
|
26 |
#include <ns3/packet.h> |
|
27 |
#include <ns3/nstime.h> |
|
28 |
#include <ns3/spectrum-value.h> |
|
29 |
||
30 |
#include <list> |
|
31 |
||
32 |
namespace ns3 { |
|
33 |
||
34 |
||
35 |
||
36 |
||
37 |
class LteSinrChunkProcessor; |
|
38 |
||
39 |
||
40 |
||
41 |
/** |
|
42 |
* This class implements a gaussian interference model, i.e., all |
|
43 |
* incoming signals are added to the total interference. |
|
44 |
* |
|
45 |
*/ |
|
7924
3a44452d0dad
made LteInterference an Object and fixed more disposals
Nicola Baldo <nbaldo@cttc.es>
parents:
7886
diff
changeset
|
46 |
class LteInterference : public Object |
7886 | 47 |
{ |
48 |
public: |
|
49 |
LteInterference (); |
|
7929 | 50 |
virtual ~LteInterference (); |
7886 | 51 |
|
7924
3a44452d0dad
made LteInterference an Object and fixed more disposals
Nicola Baldo <nbaldo@cttc.es>
parents:
7886
diff
changeset
|
52 |
// inherited from Object |
3a44452d0dad
made LteInterference an Object and fixed more disposals
Nicola Baldo <nbaldo@cttc.es>
parents:
7886
diff
changeset
|
53 |
static TypeId GetTypeId (void); |
3a44452d0dad
made LteInterference an Object and fixed more disposals
Nicola Baldo <nbaldo@cttc.es>
parents:
7886
diff
changeset
|
54 |
virtual void DoDispose (); |
3a44452d0dad
made LteInterference an Object and fixed more disposals
Nicola Baldo <nbaldo@cttc.es>
parents:
7886
diff
changeset
|
55 |
|
7886 | 56 |
/** |
57 |
* Add a LteSinrChunkProcessor that will use the time-vs-frequency SINR |
|
58 |
* calculated by this LteInterference instance. Note that all the |
|
59 |
* added LteSinrChunkProcessors will work in parallel. |
|
60 |
* |
|
61 |
* @param p |
|
62 |
*/ |
|
63 |
void AddSinrChunkProcessor (Ptr<LteSinrChunkProcessor> p); |
|
64 |
||
65 |
/** |
|
9357
d52b94f66fe7
Add trace sources for DL RSRP/RSRQ (dummy values, TBD), UL SRS and interference power traces
Marco Miozzo <marco.miozzo@cttc.es>
parents:
7929
diff
changeset
|
66 |
* Add a LteSinrChunkProcessor that will use the time-vs-frequency |
d52b94f66fe7
Add trace sources for DL RSRP/RSRQ (dummy values, TBD), UL SRS and interference power traces
Marco Miozzo <marco.miozzo@cttc.es>
parents:
7929
diff
changeset
|
67 |
* interference calculated by this LteInterference instance. Note |
d52b94f66fe7
Add trace sources for DL RSRP/RSRQ (dummy values, TBD), UL SRS and interference power traces
Marco Miozzo <marco.miozzo@cttc.es>
parents:
7929
diff
changeset
|
68 |
* that all the added LteSinrChunkProcessors will work in parallel. |
d52b94f66fe7
Add trace sources for DL RSRP/RSRQ (dummy values, TBD), UL SRS and interference power traces
Marco Miozzo <marco.miozzo@cttc.es>
parents:
7929
diff
changeset
|
69 |
* |
d52b94f66fe7
Add trace sources for DL RSRP/RSRQ (dummy values, TBD), UL SRS and interference power traces
Marco Miozzo <marco.miozzo@cttc.es>
parents:
7929
diff
changeset
|
70 |
* @param p |
d52b94f66fe7
Add trace sources for DL RSRP/RSRQ (dummy values, TBD), UL SRS and interference power traces
Marco Miozzo <marco.miozzo@cttc.es>
parents:
7929
diff
changeset
|
71 |
*/ |
d52b94f66fe7
Add trace sources for DL RSRP/RSRQ (dummy values, TBD), UL SRS and interference power traces
Marco Miozzo <marco.miozzo@cttc.es>
parents:
7929
diff
changeset
|
72 |
void AddInterferenceChunkProcessor (Ptr<LteSinrChunkProcessor> p); |
d52b94f66fe7
Add trace sources for DL RSRP/RSRQ (dummy values, TBD), UL SRS and interference power traces
Marco Miozzo <marco.miozzo@cttc.es>
parents:
7929
diff
changeset
|
73 |
|
d52b94f66fe7
Add trace sources for DL RSRP/RSRQ (dummy values, TBD), UL SRS and interference power traces
Marco Miozzo <marco.miozzo@cttc.es>
parents:
7929
diff
changeset
|
74 |
/** |
9389
4bd2725add01
Update RSRP and RSRQ evaluation (RSRQ as average SINR)
Marco Miozzo <marco.miozzo@cttc.es>
parents:
9357
diff
changeset
|
75 |
* Add a LteSinrChunkProcessor that will use the time-vs-frequency |
4bd2725add01
Update RSRP and RSRQ evaluation (RSRQ as average SINR)
Marco Miozzo <marco.miozzo@cttc.es>
parents:
9357
diff
changeset
|
76 |
* power calculated by this LteInterference instance. Note |
4bd2725add01
Update RSRP and RSRQ evaluation (RSRQ as average SINR)
Marco Miozzo <marco.miozzo@cttc.es>
parents:
9357
diff
changeset
|
77 |
* that all the added LteSinrChunkProcessors will work in parallel. |
4bd2725add01
Update RSRP and RSRQ evaluation (RSRQ as average SINR)
Marco Miozzo <marco.miozzo@cttc.es>
parents:
9357
diff
changeset
|
78 |
* |
4bd2725add01
Update RSRP and RSRQ evaluation (RSRQ as average SINR)
Marco Miozzo <marco.miozzo@cttc.es>
parents:
9357
diff
changeset
|
79 |
* @param p |
4bd2725add01
Update RSRP and RSRQ evaluation (RSRQ as average SINR)
Marco Miozzo <marco.miozzo@cttc.es>
parents:
9357
diff
changeset
|
80 |
*/ |
4bd2725add01
Update RSRP and RSRQ evaluation (RSRQ as average SINR)
Marco Miozzo <marco.miozzo@cttc.es>
parents:
9357
diff
changeset
|
81 |
void AddRsPowerChunkProcessor (Ptr<LteSinrChunkProcessor> p); |
4bd2725add01
Update RSRP and RSRQ evaluation (RSRQ as average SINR)
Marco Miozzo <marco.miozzo@cttc.es>
parents:
9357
diff
changeset
|
82 |
|
4bd2725add01
Update RSRP and RSRQ evaluation (RSRQ as average SINR)
Marco Miozzo <marco.miozzo@cttc.es>
parents:
9357
diff
changeset
|
83 |
/** |
7886 | 84 |
* notify that the PHY is starting a RX attempt |
85 |
* |
|
86 |
* @param rxPsd the power spectral density of the signal being RX |
|
87 |
*/ |
|
88 |
void StartRx (Ptr<const SpectrumValue> rxPsd); |
|
89 |
||
90 |
||
91 |
/** |
|
92 |
* notify that the RX attempt has ended. The receiving PHY must call |
|
93 |
* this method when RX ends or RX is aborted. |
|
94 |
* |
|
95 |
*/ |
|
96 |
void EndRx (); |
|
97 |
||
98 |
||
99 |
/** |
|
100 |
* notify that a new signal is being perceived in the medium. This |
|
101 |
* method is to be called for all incoming signal, regardless of |
|
102 |
* wether they're useful signals or interferers. |
|
103 |
* |
|
104 |
* @param spd the power spectral density of the new signal |
|
105 |
* @param duration the duration of the new signal |
|
106 |
*/ |
|
107 |
void AddSignal (Ptr<const SpectrumValue> spd, const Time duration); |
|
108 |
||
109 |
||
110 |
/** |
|
111 |
* |
|
112 |
* @param noisePsd the Noise Power Spectral Density in power units |
|
113 |
* (Watt, Pascal...) per Hz. |
|
114 |
*/ |
|
115 |
void SetNoisePowerSpectralDensity (Ptr<const SpectrumValue> noisePsd); |
|
116 |
||
117 |
private: |
|
118 |
void ConditionallyEvaluateChunk (); |
|
119 |
void DoAddSignal (Ptr<const SpectrumValue> spd); |
|
9406 | 120 |
void DoSubtractSignal (Ptr<const SpectrumValue> spd, uint32_t signalId); |
7886 | 121 |
|
122 |
||
123 |
||
124 |
bool m_receiving; |
|
125 |
||
7927
c8d380a263ec
fixed uplink RX and interference calculation
Nicola Baldo <nbaldo@cttc.es>
parents:
7924
diff
changeset
|
126 |
Ptr<SpectrumValue> m_rxSignal; /**< stores the power spectral density of |
7886 | 127 |
* the signal whose RX is being |
128 |
* attempted |
|
129 |
*/ |
|
130 |
||
131 |
Ptr<SpectrumValue> m_allSignals; /**< stores the spectral |
|
132 |
* power density of the sum of incoming signals; |
|
133 |
* does not include noise, includes the SPD of the signal being RX |
|
134 |
*/ |
|
135 |
||
136 |
Ptr<const SpectrumValue> m_noise; |
|
137 |
||
138 |
Time m_lastChangeTime; /**< the time of the last change in |
|
139 |
m_TotalPower */ |
|
140 |
||
9406 | 141 |
uint32_t m_lastSignalId; |
142 |
uint32_t m_lastSignalIdBeforeReset; |
|
143 |
||
7886 | 144 |
/** all the processor instances that need to be notified whenever |
9389
4bd2725add01
Update RSRP and RSRQ evaluation (RSRQ as average SINR)
Marco Miozzo <marco.miozzo@cttc.es>
parents:
9357
diff
changeset
|
145 |
a new interference chunk is calculated */ |
4bd2725add01
Update RSRP and RSRQ evaluation (RSRQ as average SINR)
Marco Miozzo <marco.miozzo@cttc.es>
parents:
9357
diff
changeset
|
146 |
std::list<Ptr<LteSinrChunkProcessor> > m_rsPowerChunkProcessorList; |
4bd2725add01
Update RSRP and RSRQ evaluation (RSRQ as average SINR)
Marco Miozzo <marco.miozzo@cttc.es>
parents:
9357
diff
changeset
|
147 |
|
4bd2725add01
Update RSRP and RSRQ evaluation (RSRQ as average SINR)
Marco Miozzo <marco.miozzo@cttc.es>
parents:
9357
diff
changeset
|
148 |
/** all the processor instances that need to be notified whenever |
7886 | 149 |
a new SINR chunk is calculated */ |
9357
d52b94f66fe7
Add trace sources for DL RSRP/RSRQ (dummy values, TBD), UL SRS and interference power traces
Marco Miozzo <marco.miozzo@cttc.es>
parents:
7929
diff
changeset
|
150 |
std::list<Ptr<LteSinrChunkProcessor> > m_sinrChunkProcessorList; |
d52b94f66fe7
Add trace sources for DL RSRP/RSRQ (dummy values, TBD), UL SRS and interference power traces
Marco Miozzo <marco.miozzo@cttc.es>
parents:
7929
diff
changeset
|
151 |
|
d52b94f66fe7
Add trace sources for DL RSRP/RSRQ (dummy values, TBD), UL SRS and interference power traces
Marco Miozzo <marco.miozzo@cttc.es>
parents:
7929
diff
changeset
|
152 |
/** all the processor instances that need to be notified whenever |
d52b94f66fe7
Add trace sources for DL RSRP/RSRQ (dummy values, TBD), UL SRS and interference power traces
Marco Miozzo <marco.miozzo@cttc.es>
parents:
7929
diff
changeset
|
153 |
a new interference chunk is calculated */ |
d52b94f66fe7
Add trace sources for DL RSRP/RSRQ (dummy values, TBD), UL SRS and interference power traces
Marco Miozzo <marco.miozzo@cttc.es>
parents:
7929
diff
changeset
|
154 |
std::list<Ptr<LteSinrChunkProcessor> > m_interfChunkProcessorList; |
7886 | 155 |
|
156 |
||
157 |
}; |
|
158 |
||
159 |
||
160 |
||
161 |
} // namespace ns3 |
|
162 |
||
163 |
||
164 |
||
165 |
||
166 |
||
167 |
#endif /* LTE_INTERFERENCE_H */ |