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 */
src
spectrum
model
spectrum-analyzer.h
Generated on Tue Nov 13 2012 10:32:22 for ns-3 by
1.8.1.2