A Discrete-Event Network Simulator
Home
Tutorials ▼
English
Documentation ▼
Installation
Manual
Models
Contributing
Wiki
Development ▼
API Docs
Issue Tracker
Merge Requests
API
Loading...
Searching...
No Matches
jakes-process.h
Go to the documentation of this file.
1
/*
2
* Copyright (c) 2012 Telum (www.telum.ru)
3
*
4
* SPDX-License-Identifier: GPL-2.0-only
5
*
6
* Author: Kirill Andreev <andreev@telum.ru>, Alexander Sofronov <sofronov@telum.ru>
7
*/
8
#ifndef DOPPLER_PROCESS_H
9
#define DOPPLER_PROCESS_H
10
11
#include "ns3/nstime.h"
12
#include "ns3/object.h"
13
#include "ns3/random-variable-stream.h"
14
15
#include <complex>
16
17
namespace
ns3
18
{
19
class
PropagationLossModel
;
20
class
JakesPropagationLossModel
;
21
22
/**
23
* @ingroup propagation
24
*
25
* @brief Implementation for a single path Stationary Jakes propagation loss model.
26
*
27
* The Jakes propagation loss model implemented here is
28
* described in [1].
29
*
30
* We consider one transmitter - receiver pair and calculate
31
* the complex coefficients for this case as follow:
32
* \f[ X(t)=X_c(t) + j X_s(t)\f]
33
* \f[ X_c(t) = \frac{2}{\sqrt{M}}\sum_{n=1}^{M}\cos(\psi_n)\cos(\omega_d t\cos(\alpha_n)+\phi_n)\f]
34
* \f[ X_s(t) = \frac{2}{\sqrt{M}}\sum_{n=1}^{M}\sin(\psi_n)\cos(\omega_d t\cos(\alpha_n)+\phi_n)\f]
35
* with
36
* \f[ \alpha_n = \frac{2\pi n - \pi + \theta}{4M}, n=1,2, \ldots,M\f]
37
* where \f$\theta\f$, \f$\phi\f$, and \f$\psi_n\f$ are
38
* statically independent and uniformly distributed over \f$[-\pi, \pi)\f$ for all \f$n\f$.
39
*
40
*
41
* [1] Y. R. Zheng and C. Xiao, "Simulation Models With Correct
42
* Statistical Properties for Rayleigh Fading Channel", IEEE
43
* Trans. on Communications, Vol. 51, pp 920-928, June 2003
44
*/
45
class
JakesProcess
:
public
Object
46
{
47
public
:
48
/**
49
* @brief Get the type ID.
50
* @return the object TypeId
51
*/
52
static
TypeId
GetTypeId
();
53
JakesProcess
();
54
~JakesProcess
()
override
;
55
56
/**
57
* Get the channel complex gain
58
* @return the channel complex gain
59
*/
60
std::complex<double>
GetComplexGain
()
const
;
61
/**
62
* Get the channel gain in dB
63
* @return the channel gain [dB]
64
*/
65
double
GetChannelGainDb
()
const
;
66
67
/**
68
* Set the propagation model using this class
69
* @param model the propagation model using this class
70
*/
71
void
SetPropagationLossModel
(
Ptr<const PropagationLossModel>
model);
72
73
protected
:
74
void
DoDispose
()
override
;
75
76
private
:
77
/**
78
* This class Represents a single oscillator
79
*/
80
struct
Oscillator
81
{
82
/**
83
* Initiate oscillator with complex amplitude, initial phase and rotation speed
84
* @param amplitude initial complex amplitude
85
* @param initialPhase initial phase
86
* @param omega rotation speed
87
*/
88
Oscillator
(std::complex<double> amplitude,
double
initialPhase,
double
omega);
89
/**
90
* Get the complex amplitude at a given moment
91
* @param t time instant
92
* @returns the complex amplitude
93
*/
94
std::complex<double>
GetValueAt
(
Time
t)
const
;
95
96
std::complex<double>
97
m_amplitude
;
//!< Complex number \f$Re=\cos(\psi_n), Im = i\sin(\psi_n)]\f$
98
double
m_phase
;
//!< Phase \f$\phi_n\f$ of the oscillator
99
double
m_omega
;
//!< Rotation speed of the oscillator \f$\omega_d \cos(\alpha_n)\f$
100
};
101
102
private
:
103
/**
104
* Set the number of Oscillators to use
105
* @param nOscillators the number of oscillators
106
*/
107
void
SetNOscillators
(
unsigned
int
nOscillators);
108
109
/**
110
* Set the Doppler frequency
111
* @param dopplerFrequencyHz the Doppler frequency [Hz]
112
*/
113
void
SetDopplerFrequencyHz
(
double
dopplerFrequencyHz);
114
115
/**
116
* Builds the object Oscillators
117
*/
118
void
ConstructOscillators
();
119
120
private
:
121
std::vector<Oscillator>
m_oscillators
;
//!< Vector of oscillators
122
double
m_omegaDopplerMax
;
//!< max rotation speed Doppler frequency
123
unsigned
int
m_nOscillators
;
//!< number of oscillators
124
Ptr<UniformRandomVariable>
m_uniformVariable
;
//!< random stream
125
Ptr<const JakesPropagationLossModel>
m_jakes
;
//!< pointer to the propagation loss model
126
};
127
}
// namespace ns3
128
#endif
// DOPPLER_PROCESS_H
ns3::JakesProcess::JakesProcess
JakesProcess()
Definition
jakes-process.cc:114
ns3::JakesProcess::m_uniformVariable
Ptr< UniformRandomVariable > m_uniformVariable
random stream
Definition
jakes-process.h:124
ns3::JakesProcess::SetNOscillators
void SetNOscillators(unsigned int nOscillators)
Set the number of Oscillators to use.
Definition
jakes-process.cc:77
ns3::JakesProcess::m_nOscillators
unsigned int m_nOscillators
number of oscillators
Definition
jakes-process.h:123
ns3::JakesProcess::SetDopplerFrequencyHz
void SetDopplerFrequencyHz(double dopplerFrequencyHz)
Set the Doppler frequency.
Definition
jakes-process.cc:83
ns3::JakesProcess::m_oscillators
std::vector< Oscillator > m_oscillators
Vector of oscillators.
Definition
jakes-process.h:121
ns3::JakesProcess::~JakesProcess
~JakesProcess() override
Definition
jakes-process.cc:120
ns3::JakesProcess::DoDispose
void DoDispose() override
Destructor implementation.
Definition
jakes-process.cc:126
ns3::JakesProcess::GetTypeId
static TypeId GetTypeId()
Get the type ID.
Definition
jakes-process.cc:43
ns3::JakesProcess::GetChannelGainDb
double GetChannelGainDb() const
Get the channel gain in dB.
Definition
jakes-process.cc:144
ns3::JakesProcess::m_omegaDopplerMax
double m_omegaDopplerMax
max rotation speed Doppler frequency
Definition
jakes-process.h:122
ns3::JakesProcess::GetComplexGain
std::complex< double > GetComplexGain() const
Get the channel complex gain.
Definition
jakes-process.cc:133
ns3::JakesProcess::m_jakes
Ptr< const JakesPropagationLossModel > m_jakes
pointer to the propagation loss model
Definition
jakes-process.h:125
ns3::JakesProcess::SetPropagationLossModel
void SetPropagationLossModel(Ptr< const PropagationLossModel > model)
Set the propagation model using this class.
Definition
jakes-process.cc:63
ns3::JakesProcess::ConstructOscillators
void ConstructOscillators()
Builds the object Oscillators.
Definition
jakes-process.cc:89
ns3::JakesPropagationLossModel
a Jakes narrowband propagation model.
Definition
jakes-propagation-loss-model.h:25
ns3::Object::Object
Object()
Constructor.
Definition
object.cc:96
ns3::PropagationLossModel
Models the propagation loss through a transmission medium.
Definition
propagation-loss-model.h:45
ns3::Ptr
Smart pointer class similar to boost::intrusive_ptr.
Definition
ptr.h:66
ns3::Time
Simulation virtual time values and global simulation resolution.
Definition
nstime.h:94
ns3::TypeId
a unique identifier for an interface.
Definition
type-id.h:49
ns3
Every class exported by the ns3 library is enclosed in the ns3 namespace.
ns3::JakesProcess::Oscillator::m_phase
double m_phase
Phase of the oscillator.
Definition
jakes-process.h:98
ns3::JakesProcess::Oscillator::Oscillator
Oscillator(std::complex< double > amplitude, double initialPhase, double omega)
Initiate oscillator with complex amplitude, initial phase and rotation speed.
Definition
jakes-process.cc:25
ns3::JakesProcess::Oscillator::m_omega
double m_omega
Rotation speed of the oscillator .
Definition
jakes-process.h:99
ns3::JakesProcess::Oscillator::m_amplitude
std::complex< double > m_amplitude
Complex number .
Definition
jakes-process.h:97
ns3::JakesProcess::Oscillator::GetValueAt
std::complex< double > GetValueAt(Time t) const
Get the complex amplitude at a given moment.
Definition
jakes-process.cc:35
src
propagation
model
jakes-process.h
Generated on Wed Jun 11 2025 13:15:37 for ns-3 by
1.13.2