A Discrete-Event Network Simulator
API
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
jakes-process.h
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:
58  static TypeId GetTypeId (void);
59  JakesProcess ();
60  virtual ~JakesProcess();
61  virtual void DoDispose ();
62  std::complex<double> GetComplexGain () const;
64  double GetChannelGainDb () const;
65  void SetPropagationLossModel (Ptr<const PropagationLossModel>);
66 private:
68  struct Oscillator
69  {
71  Oscillator (std::complex<double> amplitude, double initialPhase, double omega);
72  // Get the complex amplitude at moment \param t
73  std::complex<double> GetValueAt (Time t) const;
75  std::complex<double> m_amplitude;
77  double m_phase;
79  double m_omega;
80  };
81 private:
82  void SetNOscillators (unsigned int nOscillators);
83  void SetDopplerFrequencyHz (double dopplerFrequencyHz);
84  void ConstructOscillators ();
85 private:
87  std::vector<Oscillator> m_oscillators;
90  double m_omegaDopplerMax;
91  unsigned int m_nOscillators;
92  Ptr<UniformRandomVariable> m_uniformVariable;
95 };
96 } // namespace ns3
97 #endif // DOPPLER_PROCESS_H
keep track of time unit.
Definition: nstime.h:149
smart pointer class similar to boost::intrusive_ptr
Definition: ptr.h:59
virtual void DoDispose()
Represents a single oscillator.
Definition: jakes-process.h:68
Oscillator(std::complex< double > amplitude, double initialPhase, double omega)
Initiate oscillator with complex amplitude, initial phase and rotation speed.
double GetChannelGainDb() const
Get Channel gain [dB].
void ConstructOscillators()
a base class which provides memory management and object aggregation
Definition: object.h:63
std::complex< double > m_amplitude
Complex number.
Definition: jakes-process.h:75
a unique identifier for an interface.
Definition: type-id.h:44
Implementation for a single path Stationary Jakes propagation loss model.
Definition: jakes-process.h:55