28 NS_OBJECT_ENSURE_REGISTERED(SatRayleighModel);
29 NS_LOG_COMPONENT_DEFINE(
"SatRayleighModel");
34 static TypeId tid = TypeId(
"ns3::SatRayleighModel")
36 .AddConstructor<SatRayleighModel>();
45 NS_LOG_FUNCTION(
this);
47 NS_FATAL_ERROR(
"SatRayleighModel - Constructor not in use");
52 uint32_t initialState)
53 : m_currentSet(initialSet),
54 m_currentState(initialState),
55 m_rayleighConf(rayleighConf)
57 NS_LOG_FUNCTION(
this);
70 NS_LOG_FUNCTION(
this);
78 NS_LOG_FUNCTION(
this);
81 SatBaseFader::DoDispose();
87 NS_LOG_FUNCTION(
this);
97 NS_LOG_FUNCTION(
this);
114 std::complex<double> amplitude = std::complex<double>(std::cos(psi), std::sin(psi)) * 2.0 /
117 m_oscillators.push_back(CreateObject<SatFadingOscillator>(amplitude, phi, omega));
124 NS_LOG_FUNCTION(
this);
126 double timeInSeconds = Now().GetSeconds();
128 std::complex<double> sumAmplitude = std::complex<double>(0, 0);
131 sumAmplitude +=
m_oscillators[i]->GetComplexValueAt(timeInSeconds);
139 NS_LOG_FUNCTION(
this);
142 double tempChannelGainDb =
143 (10 * std::log10((std::pow(complexGain.real(), 2) + std::pow(complexGain.imag(), 2)) / 2));
144 NS_LOG_INFO(
"Computed channel gain: " << tempChannelGainDb);
145 return tempChannelGainDb;
151 NS_LOG_FUNCTION(
this);
155 double tempChannelGain =
156 ((std::pow(complexGain.real(), 2) + std::pow(complexGain.imag(), 2)) / 2);
157 NS_LOG_INFO(
"Computed channel gain: " << tempChannelGain);
158 return tempChannelGain;
164 NS_LOG_FUNCTION(
this << newSet <<
" " << newState);
Base class for faders such as the Rayleigh fader.
~SatRayleighModel()
Destructor.
Ptr< SatRayleighConf > m_rayleighConf
Rayleigh configuration object.
uint32_t m_currentSet
Current parameter set.
SatRayleighModel()
Constructor.
uint32_t m_currentState
Current state.
std::vector< Ptr< SatFadingOscillator > > m_oscillators
Vector of oscillators.
void DoDispose()
Do needed dispose actions.
void UpdateParameters(uint32_t set, uint32_t state)
Function for updating the parameter set and state.
std::vector< std::vector< double > > m_rayleighParameters
Rayleigh model parameters.
double GetChannelGainDb()
Function for returning the channel gain in dB.
void Reset()
Clear used variables.
Ptr< UniformRandomVariable > m_uniformVariable
Uniform distribution random variable.
void ConstructOscillators()
Function for constructing the oscillators.
static TypeId GetTypeId(void)
NS-3 function for type id.
double GetChannelGain()
Function for returning the channel gain.
std::complex< double > GetComplexGain()
Function for calculating the oscillator complex gain.
SatArqSequenceNumber is handling the sequence numbers for the ARQ process.