Loading...
Searching...
No Matches
satellite-signal-parameters.h
Go to the documentation of this file.
1/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
2/*
3 * Copyright (c) 2013 Magister Solutions Ltd.
4 * Copyright (c) 2018 CNES
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License version 2 as
8 * published by the Free Software Foundation;
9 *
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
14 *
15 * You should have received a copy of the GNU General Public License
16 * along with this program; if not, write to the Free Software
17 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
18 *
19 * Author: Jani Puttonen <jani.puttonen@magister.fi>
20 * Author: Mathias Ettinger <mettinger@toulouse.viveris.fr>
21 */
22
23#ifndef SATELLITE_SIGNAL_PARAMETERS_H
24#define SATELLITE_SIGNAL_PARAMETERS_H
25
26#include "satellite-enums.h"
27#include "satellite-utils.h"
28
29#include "ns3/nstime.h"
30#include "ns3/object.h"
31#include "ns3/packet.h"
32#include "ns3/ptr.h"
33
34#include <stdint.h>
35#include <utility>
36#include <vector>
37
38namespace ns3
39{
40
41class SatPhyTx;
42
43class SatInterferenceParameters : public Object
44{
45 public:
50 static TypeId GetTypeId(void);
51
53
59
64
69
74
78 double m_sinr;
79
84
89
94
110 std::vector<std::pair<double, double>> m_ifPowerPerFragment_W;
111
117 std::vector<std::pair<double, double>> m_ifPowerInSatellitePerFragment_W;
118
120};
121
129class SatSignalParameters : public Object
130{
131 public:
145
150 typedef std::vector<Ptr<Packet>> PacketsInBurst_t;
151
157
162
163 Ptr<SatSignalParameters> Copy();
164
169 static TypeId GetTypeId(void);
170
175
177
181 uint32_t m_satId;
182
186 uint32_t m_beamId;
187
191 uint32_t m_carrierId;
192
197
203
209
215
219 Ptr<SatPhyTx> m_phyTx;
220
225
230
235 inline void SetInterferencePower(std::vector<std::pair<double, double>> ifPowerPerFragment)
236 {
237 m_ifParams->m_ifPowerPerFragment_W = ifPowerPerFragment;
238 m_ifParams->m_ifPower_W = SatUtils::ScalarProduct(ifPowerPerFragment);
239 }
240
244 inline double GetInterferencePower()
245 {
246 return m_ifParams->m_ifPower_W;
247 }
248
252 inline std::vector<std::pair<double, double>> GetInterferencePowerPerFragment()
253 {
254 return m_ifParams->m_ifPowerPerFragment_W;
255 }
256
262 std::vector<std::pair<double, double>> ifPowerPerFragment)
263 {
264 m_ifParams->m_ifPowerInSatellitePerFragment_W = ifPowerPerFragment;
265 m_ifParams->m_ifPowerInSatellite_W = SatUtils::ScalarProduct(ifPowerPerFragment);
266 }
267
272 {
273 return m_ifParams->m_ifPowerInSatellite_W;
274 }
275
279 inline std::vector<std::pair<double, double>> GetInterferencePowerInSatellitePerFragment()
280 {
281 return m_ifParams->m_ifPowerInSatellitePerFragment_W;
282 }
283
287 void SetRxPowersInSatellite(double rxPowerW,
288 double rxNoisePowerW,
289 double rxAciIfPowerW,
290 double rxExtNoisePowerW);
291
292 inline double GetRxPowerInSatellite()
293 {
294 return m_ifParams->m_rxPowerInSatellite_W;
295 }
296
298 {
299 return m_ifParams->m_rxNoisePowerInSatellite_W;
300 }
301
303 {
304 return m_ifParams->m_rxAciIfPowerInSatellite_W;
305 }
306
308 {
309 return m_ifParams->m_rxExtNoisePowerInSatellite_W;
310 }
311
315 void SetSinr(double sinr, double additionalInterference);
316
317 inline double GetSinr()
318 {
319 return m_ifParams->m_sinr;
320 }
321
323 {
324 return m_ifParams->m_additionalInterference;
325 }
326
327 inline bool HasSinrComputed()
328 {
329 return m_ifParams->m_sinrComputed;
330 }
331
332 private:
333 Ptr<SatInterferenceParameters> m_ifParams;
334};
335
336} // namespace ns3
337
338#endif /* SATELLITE_SIGNAL_PARAMETERS_H */
SatBbFrameType_t
BB frame type used in DVB-S2 FWD link.
SatModcod_t
Modulation scheme and coding rate for DVB-S2.
ChannelType_t
Types of channel.
PacketType_t
Packet types.
std::vector< std::pair< double, double > > m_ifPowerInSatellitePerFragment_W
Interference power in the satellite (I) per packet fragment.
double m_ifPower_W
Interference power (I).
double m_ifPowerInSatellite_W
Interference power in the satellite (I).
double m_rxNoisePowerInSatellite_W
Rx noise power in satellite.
double m_rxAciIfPowerInSatellite_W
ACI interference power in satellite.
std::vector< std::pair< double, double > > m_ifPowerPerFragment_W
Interference power (I) per packet fragment.
double m_rxExtNoisePowerInSatellite_W
RX external noise power in satellite.
double m_additionalInterference
Callback for SINR calculation.
double m_rxPowerInSatellite_W
The RX power in the satellite in Watts.
static TypeId GetTypeId(void)
Get the type ID.
The SatellitePhyTx models the physical layer transmitter of satellite system.
Ptr< SatPhyTx > m_phyTx
The SatPhyTx instance that is making the transmission.
void SetInterferencePowerInSatellite(std::vector< std::pair< double, double > > ifPowerPerFragment)
Set interference power in satellite based on packet fragment.
static TypeId GetTypeId(void)
Get the type ID.
double m_txPower_W
The TX power in Watts.
Time m_duration
The duration of the packet transmission.
void SetRxPowersInSatellite(double rxPowerW, double rxNoisePowerW, double rxAciIfPowerW, double rxExtNoisePowerW)
Set various power after receiving the packet in the satellite.
void SetInterferencePower(std::vector< std::pair< double, double > > ifPowerPerFragment)
Set interference power based on packet fragment.
uint32_t m_carrierId
The carrier for the packet transmission.
std::vector< std::pair< double, double > > GetInterferencePowerPerFragment()
Get interference power per packet fragment.
double m_rxPower_W
The RX power in Watts.
std::vector< Ptr< Packet > > PacketsInBurst_t
Buffer for transmissions.
Ptr< SatSignalParameters > Copy()
std::vector< std::pair< double, double > > GetInterferencePowerInSatellitePerFragment()
Get interference power in satellite per packet fragment.
uint32_t m_satId
The sat for the packet transmission.
uint32_t m_beamId
The beam for the packet transmission.
PacketsInBurst_t m_packetsInBurst
The packets being transmitted with this signal i.e.
double m_carrierFreq_hz
The carrier center frequency for the packet transmission.
double GetInterferencePower()
Get interference power (I).
void SetSinr(double sinr, double additionalInterference)
Set computed SINR.
Ptr< SatInterferenceParameters > m_ifParams
double GetInterferencePowerInSatellite()
Get interference power in satellite (I).
txInfo_s m_txInfo
Transmission information including packet type, modcod and waveform ID.
SatEnums::ChannelType_t m_channelType
The SatChannel instance received the packet.
static double ScalarProduct(const std::vector< std::pair< double, double > > &vector)
Scalar product.
SatArqSequenceNumber is handling the sequence numbers for the ARQ process.
Struct for storing the packet specific Tx information.