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 namespace ns3
35 {
36 
37 class SatPhyTx;
38 
39 class SatInterferenceParameters : public Object
40 {
41  public:
43 
49 
54 
59 
64 
68  double m_sinr;
69 
74 
78  double m_ifPower_W;
79 
84 
100  std::vector<std::pair<double, double>> m_ifPowerPerFragment_W;
101 
107  std::vector<std::pair<double, double>> m_ifPowerInSatellitePerFragment_W;
108 
110 };
111 
119 class SatSignalParameters : public Object
120 {
121  public:
125  typedef struct
126  {
129  uint8_t sliceId;
132  uint32_t waveformId;
134  } txInfo_s;
135 
140  typedef std::vector<Ptr<Packet>> PacketsInBurst_t;
141 
147 
152 
153  Ptr<SatSignalParameters> Copy();
154 
159  static TypeId GetTypeId(void);
160 
167 
171  uint32_t m_satId;
172 
176  uint32_t m_beamId;
177 
181  uint32_t m_carrierId;
182 
187 
193 
198  double m_txPower_W;
199 
204  double m_rxPower_W;
205 
209  Ptr<SatPhyTx> m_phyTx;
210 
215 
220 
225  inline void SetInterferencePower(std::vector<std::pair<double, double>> ifPowerPerFragment)
226  {
227  m_ifParams->m_ifPowerPerFragment_W = ifPowerPerFragment;
228  m_ifParams->m_ifPower_W = SatUtils::ScalarProduct(ifPowerPerFragment);
229  }
230 
234  inline double GetInterferencePower()
235  {
236  return m_ifParams->m_ifPower_W;
237  }
238 
242  inline std::vector<std::pair<double, double>> GetInterferencePowerPerFragment()
243  {
244  return m_ifParams->m_ifPowerPerFragment_W;
245  }
246 
252  std::vector<std::pair<double, double>> ifPowerPerFragment)
253  {
254  m_ifParams->m_ifPowerInSatellitePerFragment_W = ifPowerPerFragment;
255  m_ifParams->m_ifPowerInSatellite_W = SatUtils::ScalarProduct(ifPowerPerFragment);
256  }
257 
262  {
263  return m_ifParams->m_ifPowerInSatellite_W;
264  }
265 
269  inline std::vector<std::pair<double, double>> GetInterferencePowerInSatellitePerFragment()
270  {
271  return m_ifParams->m_ifPowerInSatellitePerFragment_W;
272  }
273 
277  void SetRxPowersInSatellite(double rxPowerW,
278  double rxNoisePowerW,
279  double rxAciIfPowerW,
280  double rxExtNoisePowerW);
281 
282  inline double GetRxPowerInSatellite()
283  {
284  return m_ifParams->m_rxPowerInSatellite_W;
285  }
286 
288  {
289  return m_ifParams->m_rxNoisePowerInSatellite_W;
290  }
291 
293  {
294  return m_ifParams->m_rxAciIfPowerInSatellite_W;
295  }
296 
298  {
299  return m_ifParams->m_rxExtNoisePowerInSatellite_W;
300  }
301 
305  void SetSinr(double sinr, double additionalInterference);
306 
307  inline double GetSinr()
308  {
309  return m_ifParams->m_sinr;
310  }
311 
313  {
314  return m_ifParams->m_additionalInterference;
315  }
316 
317  inline bool HasSinrComputed()
318  {
319  return m_ifParams->m_sinrComputed;
320  }
321 
322  private:
323  Ptr<SatInterferenceParameters> m_ifParams;
324 };
325 
326 } // namespace ns3
327 
328 #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.
Actual physical layer transmission container.
Ptr< SatPhyTx > m_phyTx
The SatPhyTx instance that is making the transmission.
static TypeId GetTypeId(void)
Get the type ID.
double m_txPower_W
The TX power in Watts.
SatSignalParameters()
default constructor
Time m_duration
The duration of the packet transmission.
std::vector< std::pair< double, double > > GetInterferencePowerPerFragment()
Get interference power per packet fragment.
void SetRxPowersInSatellite(double rxPowerW, double rxNoisePowerW, double rxAciIfPowerW, double rxExtNoisePowerW)
Set various power after receiving the packet in the satellite.
uint32_t m_carrierId
The carrier for the packet transmission.
void SetInterferencePower(std::vector< std::pair< double, double >> ifPowerPerFragment)
Set interference power based on packet fragment.
double m_rxPower_W
The RX power in Watts.
std::vector< std::pair< double, double > > GetInterferencePowerInSatellitePerFragment()
Get interference power in satellite per packet fragment.
std::vector< Ptr< Packet > > PacketsInBurst_t
Buffer for transmissions.
Ptr< SatSignalParameters > Copy()
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.
void SetInterferencePowerInSatellite(std::vector< std::pair< double, double >> ifPowerPerFragment)
Set interference power in satellite based on packet fragment.
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.