31 NS_OBJECT_ENSURE_REGISTERED(SatRayleighModel);
32 NS_LOG_COMPONENT_DEFINE(
"SatRayleighModel");
37 static TypeId tid = TypeId(
"ns3::SatRayleighModel")
39 .AddConstructor<SatRayleighModel>();
48 NS_LOG_FUNCTION(
this);
50 NS_FATAL_ERROR(
"SatRayleighModel - Constructor not in use");
55 uint32_t initialState)
56 : m_currentSet(initialSet),
57 m_currentState(initialState),
58 m_rayleighConf(rayleighConf)
60 NS_LOG_FUNCTION(
this);
73 NS_LOG_FUNCTION(
this);
81 NS_LOG_FUNCTION(
this);
84 SatBaseFader::DoDispose();
90 NS_LOG_FUNCTION(
this);
100 NS_LOG_FUNCTION(
this);
117 std::complex<double> amplitude = std::complex<double>(std::cos(psi), std::sin(psi)) * 2.0 /
120 m_oscillators.push_back(CreateObject<SatFadingOscillator>(amplitude, phi, omega));
127 NS_LOG_FUNCTION(
this);
129 double timeInSeconds = Now().GetSeconds();
131 std::complex<double> sumAmplitude = std::complex<double>(0, 0);
134 sumAmplitude +=
m_oscillators[i]->GetComplexValueAt(timeInSeconds);
142 NS_LOG_FUNCTION(
this);
145 double tempChannelGainDb =
146 (10 * std::log10((std::pow(complexGain.real(), 2) + std::pow(complexGain.imag(), 2)) / 2));
147 NS_LOG_INFO(
"Computed channel gain: " << tempChannelGainDb);
148 return tempChannelGainDb;
154 NS_LOG_FUNCTION(
this);
158 double tempChannelGain =
159 ((std::pow(complexGain.real(), 2) + std::pow(complexGain.imag(), 2)) / 2);
160 NS_LOG_INFO(
"Computed channel gain: " << tempChannelGain);
161 return tempChannelGain;
167 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.