A Discrete-Event Network Simulator
API
Loading...
Searching...
No Matches
three-gpp-ntn-channel-example.cc File Reference

This example is a modified version of "three-gpp-channel-example", to include the 3GPP NTN channel model. More...

#include "ns3/channel-condition-model.h"
#include "ns3/constant-position-mobility-model.h"
#include "ns3/core-module.h"
#include "ns3/geocentric-constant-position-mobility-model.h"
#include "ns3/isotropic-antenna-model.h"
#include "ns3/mobility-model.h"
#include "ns3/net-device.h"
#include "ns3/node-container.h"
#include "ns3/node.h"
#include "ns3/parabolic-antenna-model.h"
#include "ns3/simple-net-device.h"
#include "ns3/spectrum-signal-parameters.h"
#include "ns3/three-gpp-channel-model.h"
#include "ns3/three-gpp-propagation-loss-model.h"
#include "ns3/three-gpp-spectrum-propagation-loss-model.h"
#include "ns3/uniform-planar-array.h"
#include <ns3/antenna-model.h>
#include <fstream>
+ Include dependency graph for three-gpp-ntn-channel-example.cc:

Go to the source code of this file.

Classes

struct  ComputeSnrParams
 A structure that holds the parameters for the ComputeSnr function. More...
 

Functions

static void ComputeSnr (ComputeSnrParams &params)
 Compute the average SNR.
 
Ptr< SpectrumValueCreateNoisePowerSpectralDensity (double fcHz, double noiseFigureDb, double bwHz, double rbWidthHz)
 Create the noise PSD for the.
 
Ptr< SpectrumValueCreateTxPowerSpectralDensity (double fcHz, double pwrDbm, double bwHz, double rbWidthHz)
 Create the PSD for the TX.
 
static void DoBeamforming (Ptr< NetDevice > thisDevice, Ptr< PhasedArrayModel > thisAntenna, Ptr< NetDevice > otherDevice)
 Perform the beamforming using the DFT beamforming method.
 

Variables

static Ptr< ThreeGppPropagationLossModelm_propagationLossModel
 the PropagationLossModel object
 
static Ptr< ThreeGppSpectrumPropagationLossModelm_spectrumLossModel
 the SpectrumPropagationLossModel object
 

Detailed Description

This example is a modified version of "three-gpp-channel-example", to include the 3GPP NTN channel model.

Specifically, most changes (which are also highlighted throughout the code) impact the main method, and comprise:

  • the configuration of ad-hoc propagation and channel condition models;
  • the use of GeocentricConstantPositionMobilityModel for the nodes mobility. The pre-configured parameters are the one provided by 3GPP in TR 38.821, more specifically scenario 10 in down-link mode. Two static nodes, one on the ground and one in orbit, communicate with each other. The carrier frequency is set at 20GHz with 400MHz bandwidth. The result is the SNR of the signal and the path loss, saved in the ntn-snr-trace.txt file.

Definition in file three-gpp-ntn-channel-example.cc.

Function Documentation

◆ ComputeSnr()

static void ComputeSnr ( ComputeSnrParams params)
static

Compute the average SNR.

Parameters
paramsA structure that holds the parameters that are needed to perform calculations in ComputeSnr

Definition at line 258 of file three-gpp-ntn-channel-example.cc.

References ns3::PropagationLossModel::CalcRxPower(), ns3::PhasedArraySpectrumPropagationLossModel::CalcRxPowerSpectralDensity(), CreateNoisePowerSpectralDensity(), CreateTxPowerSpectralDensity(), ns3::Time::GetSeconds(), m_propagationLossModel, m_spectrumLossModel, ns3::Simulator::Now(), NS_ASSERT_MSG, NS_LOG_DEBUG, and ns3::Sum().

+ Here is the call graph for this function:

◆ CreateNoisePowerSpectralDensity()

Ptr< SpectrumValue > CreateNoisePowerSpectralDensity ( double  fcHz,
double  noiseFigureDb,
double  bwHz,
double  rbWidthHz 
)

Create the noise PSD for the.

Parameters
fcHzthe carrier frequency in Hz
noiseFigureDbthe noise figure in dB
bwHzthe bandwidth in Hz
rbWidthHzthe Resource Block (RB) width in Hz
Returns
the pointer to the noise PSD

Definition at line 117 of file three-gpp-ntn-channel-example.cc.

References ns3::BandInfo::fc, ns3::BandInfo::fh, and ns3::BandInfo::fl.

Referenced by ComputeSnr().

+ Here is the caller graph for this function:

◆ CreateTxPowerSpectralDensity()

Ptr< SpectrumValue > CreateTxPowerSpectralDensity ( double  fcHz,
double  pwrDbm,
double  bwHz,
double  rbWidthHz 
)

Create the PSD for the TX.

Parameters
fcHzthe carrier frequency in Hz
pwrDbmthe transmission power in dBm
bwHzthe bandwidth in Hz
rbWidthHzthe Resource Block (RB) width in Hz
Returns
the pointer to the PSD

Definition at line 74 of file three-gpp-ntn-channel-example.cc.

References ns3::BandInfo::fc, ns3::BandInfo::fh, and ns3::BandInfo::fl.

Referenced by ComputeSnr().

+ Here is the caller graph for this function:

◆ DoBeamforming()

static void DoBeamforming ( Ptr< NetDevice thisDevice,
Ptr< PhasedArrayModel thisAntenna,
Ptr< NetDevice otherDevice 
)
static

Perform the beamforming using the DFT beamforming method.

Parameters
thisDevicethe device performing the beamforming
thisAntennathe antenna object associated to thisDevice
otherDevicethe device towards which point the beam

Definition at line 213 of file three-gpp-ntn-channel-example.cc.

References ns3::Angles::GetAzimuth(), and ns3::Angles::GetInclination().

+ Here is the call graph for this function:

Variable Documentation

◆ m_propagationLossModel

Ptr<ThreeGppPropagationLossModel> m_propagationLossModel
static

the PropagationLossModel object

Definition at line 59 of file three-gpp-ntn-channel-example.cc.

Referenced by ComputeSnr().

◆ m_spectrumLossModel

Ptr<ThreeGppSpectrumPropagationLossModel> m_spectrumLossModel
static

the SpectrumPropagationLossModel object

Definition at line 61 of file three-gpp-ntn-channel-example.cc.

Referenced by ComputeSnr().