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 
38 namespace ns3
39 {
40 
41 class SatPhyTx;
42 
43 class SatInterferenceParameters : public Object
44 {
45  public:
47 
53 
58 
63 
68 
72  double m_sinr;
73 
78 
82  double m_ifPower_W;
83 
88 
104  std::vector<std::pair<double, double>> m_ifPowerPerFragment_W;
105 
111  std::vector<std::pair<double, double>> m_ifPowerInSatellitePerFragment_W;
112 
114 };
115 
123 class SatSignalParameters : public Object
124 {
125  public:
129  typedef struct
130  {
133  uint8_t sliceId;
136  uint32_t waveformId;
138  } txInfo_s;
139 
144  typedef std::vector<Ptr<Packet>> PacketsInBurst_t;
145 
151 
156 
157  Ptr<SatSignalParameters> Copy();
158 
163  static TypeId GetTypeId(void);
164 
171 
175  uint32_t m_satId;
176 
180  uint32_t m_beamId;
181 
185  uint32_t m_carrierId;
186 
191 
197 
202  double m_txPower_W;
203 
208  double m_rxPower_W;
209 
213  Ptr<SatPhyTx> m_phyTx;
214 
219 
224 
229  inline void SetInterferencePower(std::vector<std::pair<double, double>> ifPowerPerFragment)
230  {
231  m_ifParams->m_ifPowerPerFragment_W = ifPowerPerFragment;
232  m_ifParams->m_ifPower_W = SatUtils::ScalarProduct(ifPowerPerFragment);
233  }
234 
238  inline double GetInterferencePower()
239  {
240  return m_ifParams->m_ifPower_W;
241  }
242 
246  inline std::vector<std::pair<double, double>> GetInterferencePowerPerFragment()
247  {
248  return m_ifParams->m_ifPowerPerFragment_W;
249  }
250 
256  std::vector<std::pair<double, double>> ifPowerPerFragment)
257  {
258  m_ifParams->m_ifPowerInSatellitePerFragment_W = ifPowerPerFragment;
259  m_ifParams->m_ifPowerInSatellite_W = SatUtils::ScalarProduct(ifPowerPerFragment);
260  }
261 
266  {
267  return m_ifParams->m_ifPowerInSatellite_W;
268  }
269 
273  inline std::vector<std::pair<double, double>> GetInterferencePowerInSatellitePerFragment()
274  {
275  return m_ifParams->m_ifPowerInSatellitePerFragment_W;
276  }
277 
281  void SetRxPowersInSatellite(double rxPowerW,
282  double rxNoisePowerW,
283  double rxAciIfPowerW,
284  double rxExtNoisePowerW);
285 
286  inline double GetRxPowerInSatellite()
287  {
288  return m_ifParams->m_rxPowerInSatellite_W;
289  }
290 
292  {
293  return m_ifParams->m_rxNoisePowerInSatellite_W;
294  }
295 
297  {
298  return m_ifParams->m_rxAciIfPowerInSatellite_W;
299  }
300 
302  {
303  return m_ifParams->m_rxExtNoisePowerInSatellite_W;
304  }
305 
309  void SetSinr(double sinr, double additionalInterference);
310 
311  inline double GetSinr()
312  {
313  return m_ifParams->m_sinr;
314  }
315 
317  {
318  return m_ifParams->m_additionalInterference;
319  }
320 
321  inline bool HasSinrComputed()
322  {
323  return m_ifParams->m_sinrComputed;
324  }
325 
326  private:
327  Ptr<SatInterferenceParameters> m_ifParams;
328 };
329 
330 } // namespace ns3
331 
332 #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.