A Discrete-Event Network Simulator
API
jakes-process.h
Go to the documentation of this file.
1 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
2 /*
3  * Copyright (c) 2012 Telum (www.telum.ru)
4  *
5  * This program is free software; you can redistribute it and/or modify
6  * it under the terms of the GNU General Public License version 2 as
7  * published by the Free Software Foundation;
8  *
9  * This program is distributed in the hope that it will be useful,
10  * but WITHOUT ANY WARRANTY; without even the implied warranty of
11  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12  * GNU General Public License for more details.
13  *
14  * You should have received a copy of the GNU General Public License
15  * along with this program; if not, write to the Free Software
16  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
17  *
18  * Author: Kirill Andreev <andreev@telum.ru>, Alexander Sofronov <sofronov@telum.ru>
19  */
20 #ifndef DOPPLER_PROCESS_H
21 #define DOPPLER_PROCESS_H
22 
23 #include "ns3/object.h"
24 #include "ns3/nstime.h"
25 #include "ns3/random-variable-stream.h"
26 #include <complex>
27 
28 namespace ns3
29 {
30 class PropagationLossModel;
31 class JakesPropagationLossModel;
55 class JakesProcess : public Object
56 {
57 public:
62  static TypeId GetTypeId (void);
63  JakesProcess ();
64  virtual ~JakesProcess();
65  virtual void DoDispose ();
66 
71  std::complex<double> GetComplexGain () const;
76  double GetChannelGainDb () const;
77 
83 private:
87  struct Oscillator
88  {
95  Oscillator (std::complex<double> amplitude, double initialPhase, double omega);
101  std::complex<double> GetValueAt (Time t) const;
102 
103  std::complex<double> m_amplitude;
104  double m_phase;
105  double m_omega;
106  };
107 private:
108 
113  void SetNOscillators (unsigned int nOscillators);
114 
119  void SetDopplerFrequencyHz (double dopplerFrequencyHz);
120 
124  void ConstructOscillators ();
125 private:
126  std::vector<Oscillator> m_oscillators;
128  unsigned int m_nOscillators;
131 };
132 } // namespace ns3
133 #endif // DOPPLER_PROCESS_H
Ptr< UniformRandomVariable > m_uniformVariable
random stream
Simulation virtual time values and global simulation resolution.
Definition: nstime.h:102
virtual ~JakesProcess()
Smart pointer class similar to boost::intrusive_ptr.
Definition: ptr.h:73
void SetPropagationLossModel(Ptr< const PropagationLossModel > model)
Set the propagation model using this class.
std::vector< Oscillator > m_oscillators
Vector of oscillators.
virtual void DoDispose()
Destructor implementation.
This class Represents a single oscillator.
Definition: jakes-process.h:87
Oscillator(std::complex< double > amplitude, double initialPhase, double omega)
Initiate oscillator with complex amplitude, initial phase and rotation speed.
double GetChannelGainDb() const
Get the channel gain in dB.
double m_omegaDopplerMax
max rotation speed Doppler frequency
double m_omega
Rotation speed of the oscillator .
std::complex< double > GetComplexGain() const
Get the channel complex gain.
Every class exported by the ns3 library is enclosed in the ns3 namespace.
void SetDopplerFrequencyHz(double dopplerFrequencyHz)
Set the Doppler frequency.
unsigned int m_nOscillators
number of oscillators
static TypeId GetTypeId(void)
Get the type ID.
std::complex< double > GetValueAt(Time t) const
Get the complex amplitude at a given moment.
void ConstructOscillators()
A base class which provides memory management and object aggregation.
Definition: object.h:87
Ptr< const JakesPropagationLossModel > m_jakes
pointer to the propagation loss model
std::complex< double > m_amplitude
Complex number .
a unique identifier for an interface.
Definition: type-id.h:58
double m_phase
Phase of the oscillator.
void SetNOscillators(unsigned int nOscillators)
Set the number of Oscillators to use.
Implementation for a single path Stationary Jakes propagation loss model.
Definition: jakes-process.h:55