A Discrete-Event Network Simulator
Home
Tutorials ▼
English
Portuguese
Docs ▼
Wiki
Manual
Models
Develop ▼
API
Bugs
API
Main Page
Related Pages
Modules
Namespaces
Classes
Files
File List
File Members
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Properties
Friends
Macros
Groups
Pages
spectrum-analyzer.h
Go to the documentation of this file.
1
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
2
/*
3
* Copyright (c) 2009 CTTC
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: Nicola Baldo <nbaldo@cttc.es>
19
*/
20
21
#ifndef SPECTRUM_ANALYZER_H
22
#define SPECTRUM_ANALYZER_H
23
24
25
#include <ns3/spectrum-value.h>
26
#include <ns3/mobility-model.h>
27
#include <ns3/packet.h>
28
#include <ns3/nstime.h>
29
#include <ns3/net-device.h>
30
#include <ns3/spectrum-phy.h>
31
#include <ns3/spectrum-channel.h>
32
#include <string>
33
#include <fstream>
34
35
namespace
ns3 {
36
37
48
class
SpectrumAnalyzer
:
public
SpectrumPhy
49
{
50
51
public
:
52
SpectrumAnalyzer
();
53
virtual
~SpectrumAnalyzer
();
54
55
static
TypeId
GetTypeId
(
void
);
56
57
// inherited from SpectrumPhy
58
void
SetChannel
(
Ptr<SpectrumChannel>
c);
59
void
SetMobility
(
Ptr<MobilityModel>
m);
60
void
SetDevice
(
Ptr<NetDevice>
d);
61
Ptr<MobilityModel>
GetMobility
();
62
Ptr<NetDevice>
GetDevice
();
63
Ptr<const SpectrumModel>
GetRxSpectrumModel
()
const
;
64
Ptr<AntennaModel>
GetRxAntenna
();
65
void
StartRx
(
Ptr<SpectrumSignalParameters>
params);
66
67
73
void
SetRxSpectrumModel
(
Ptr<SpectrumModel>
m);
74
80
void
SetAntenna
(
Ptr<AntennaModel>
a);
81
86
virtual
void
Start
();
87
92
virtual
void
Stop
();
93
94
95
protected
:
96
void
DoDispose
();
97
98
private
:
99
Ptr<MobilityModel>
m_mobility
;
100
Ptr<AntennaModel>
m_antenna
;
101
Ptr<NetDevice>
m_netDevice
;
102
Ptr<SpectrumChannel>
m_channel
;
103
104
virtual
void
GenerateReport
();
105
106
void
AddSignal
(
Ptr<const SpectrumValue>
psd);
107
void
SubtractSignal
(
Ptr<const SpectrumValue>
psd);
108
void
UpdateEnergyReceivedSoFar
();
109
110
Ptr<SpectrumModel>
m_spectrumModel
;
111
Ptr<SpectrumValue>
m_sumPowerSpectralDensity
;
112
Ptr<SpectrumValue>
m_energySpectralDensity
;
113
double
m_noisePowerSpectralDensity
;
114
Time
m_resolution
;
115
Time
m_lastChangeTime
;
116
bool
m_active
;
117
118
TracedCallback<Ptr<const SpectrumValue>
>
m_averagePowerSpectralDensityReportTrace
;
119
120
};
121
122
123
124
125
126
127
}
128
129
130
131
132
133
#endif
/* SPECTRUM_ANALYZER_H */
ns3::Time
keep track of time values and allow control of global simulation resolution
Definition:
nstime.h:81
ns3::Ptr
smart pointer class similar to boost::intrusive_ptr
Definition:
ptr.h:59
ns3::SpectrumPhy
Definition:
spectrum-phy.h:45
ns3::SpectrumAnalyzer::m_netDevice
Ptr< NetDevice > m_netDevice
Definition:
spectrum-analyzer.h:101
ns3::SpectrumAnalyzer::StartRx
void StartRx(Ptr< SpectrumSignalParameters > params)
Definition:
spectrum-analyzer.cc:155
ns3::SpectrumAnalyzer::m_noisePowerSpectralDensity
double m_noisePowerSpectralDensity
Definition:
spectrum-analyzer.h:113
ns3::SpectrumAnalyzer::GetDevice
Ptr< NetDevice > GetDevice()
Definition:
spectrum-analyzer.cc:96
ns3::TracedCallback
forward calls to a chain of CallbackAn ns3::TracedCallback has almost exactly the same API as a norma...
Definition:
traced-callback.h:43
ns3::SpectrumAnalyzer::m_antenna
Ptr< AntennaModel > m_antenna
Definition:
spectrum-analyzer.h:100
ns3::SpectrumAnalyzer::Start
virtual void Start()
Definition:
spectrum-analyzer.cc:233
ns3::SpectrumAnalyzer::SetChannel
void SetChannel(Ptr< SpectrumChannel > c)
Definition:
spectrum-analyzer.cc:132
ns3::SpectrumAnalyzer::m_active
bool m_active
Definition:
spectrum-analyzer.h:116
ns3::SpectrumAnalyzer::m_channel
Ptr< SpectrumChannel > m_channel
Definition:
spectrum-analyzer.h:102
ns3::SpectrumAnalyzer::~SpectrumAnalyzer
virtual ~SpectrumAnalyzer()
Definition:
spectrum-analyzer.cc:51
ns3::SpectrumAnalyzer::GetTypeId
static TypeId GetTypeId(void)
Definition:
spectrum-analyzer.cc:70
ns3::SpectrumAnalyzer::Stop
virtual void Stop()
Definition:
spectrum-analyzer.cc:246
ns3::SpectrumAnalyzer::SetRxSpectrumModel
void SetRxSpectrumModel(Ptr< SpectrumModel > m)
Definition:
spectrum-analyzer.cc:219
ns3::SpectrumAnalyzer::DoDispose
void DoDispose()
Definition:
spectrum-analyzer.cc:57
ns3::SpectrumAnalyzer::SetDevice
void SetDevice(Ptr< NetDevice > d)
Definition:
spectrum-analyzer.cc:116
ns3::SpectrumAnalyzer
Definition:
spectrum-analyzer.h:48
ns3::SpectrumAnalyzer::AddSignal
void AddSignal(Ptr< const SpectrumValue > psd)
Definition:
spectrum-analyzer.cc:164
ns3::SpectrumAnalyzer::m_averagePowerSpectralDensityReportTrace
TracedCallback< Ptr< const SpectrumValue > > m_averagePowerSpectralDensityReportTrace
Definition:
spectrum-analyzer.h:118
ns3::SpectrumAnalyzer::m_sumPowerSpectralDensity
Ptr< SpectrumValue > m_sumPowerSpectralDensity
Definition:
spectrum-analyzer.h:111
ns3::SpectrumAnalyzer::m_spectrumModel
Ptr< SpectrumModel > m_spectrumModel
Definition:
spectrum-analyzer.h:110
ns3::SpectrumAnalyzer::GetMobility
Ptr< MobilityModel > GetMobility()
Definition:
spectrum-analyzer.cc:103
ns3::SpectrumAnalyzer::GenerateReport
virtual void GenerateReport()
Definition:
spectrum-analyzer.cc:195
ns3::SpectrumAnalyzer::SetMobility
void SetMobility(Ptr< MobilityModel > m)
Definition:
spectrum-analyzer.cc:124
ns3::SpectrumAnalyzer::SpectrumAnalyzer
SpectrumAnalyzer()
Definition:
spectrum-analyzer.cc:37
ns3::SpectrumAnalyzer::GetRxSpectrumModel
Ptr< const SpectrumModel > GetRxSpectrumModel() const
Definition:
spectrum-analyzer.cc:110
ns3::SpectrumAnalyzer::GetRxAntenna
Ptr< AntennaModel > GetRxAntenna()
Definition:
spectrum-analyzer.cc:140
ns3::SpectrumAnalyzer::SubtractSignal
void SubtractSignal(Ptr< const SpectrumValue > psd)
Definition:
spectrum-analyzer.cc:172
ns3::TypeId
a unique identifier for an interface.
Definition:
type-id.h:49
ns3::SpectrumAnalyzer::m_lastChangeTime
Time m_lastChangeTime
Definition:
spectrum-analyzer.h:115
ns3::SpectrumAnalyzer::m_mobility
Ptr< MobilityModel > m_mobility
Definition:
spectrum-analyzer.h:99
ns3::SpectrumAnalyzer::m_energySpectralDensity
Ptr< SpectrumValue > m_energySpectralDensity
Definition:
spectrum-analyzer.h:112
ns3::SpectrumAnalyzer::SetAntenna
void SetAntenna(Ptr< AntennaModel > a)
Definition:
spectrum-analyzer.cc:146
ns3::SpectrumAnalyzer::UpdateEnergyReceivedSoFar
void UpdateEnergyReceivedSoFar()
Definition:
spectrum-analyzer.cc:180
ns3::SpectrumAnalyzer::m_resolution
Time m_resolution
Definition:
spectrum-analyzer.h:114
src
spectrum
model
spectrum-analyzer.h
Generated on Sat Nov 16 2013 12:55:37 for ns-3 by
1.8.5