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
microwave-oven-spectrum-value-helper.cc
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
#include "ns3/log.h"
22
#include "
microwave-oven-spectrum-value-helper.h
"
23
24
NS_LOG_COMPONENT_DEFINE
(
"MicrowaveOvenSpectrumValue"
);
25
26
namespace
ns3 {
27
28
29
Ptr<SpectrumModel>
g_MicrowaveOvenSpectrumModel5Mhz
;
30
Ptr<SpectrumModel>
g_MicrowaveOvenSpectrumModel6Mhz
;
31
32
33
class
MicrowaveOvenSpectrumModel5MhzInitializer
34
{
35
public
:
36
MicrowaveOvenSpectrumModel5MhzInitializer
()
37
{
38
NS_LOG_FUNCTION
(
this
);
39
Bands
bands;
40
for
(
double
fl = 2400e6; fl < 2499e6; fl += 5e6)
41
{
42
BandInfo
bi;
43
bi.
fl
= fl;
44
bi.
fc
= fl + 5e6;
45
bi.
fh
= fl + 10e6;
46
bands.push_back (bi);
47
}
48
NS_LOG_LOGIC
(
"bands.size () :"
<< bands.size ());
49
g_MicrowaveOvenSpectrumModel5Mhz
= Create<SpectrumModel> (bands);
50
}
51
}
g_MicrowaveOvenSpectrumModel5MhzInitializerInstance
;
52
53
54
55
class
MicrowaveOvenSpectrumModel6MhzInitializer
56
{
57
public
:
58
MicrowaveOvenSpectrumModel6MhzInitializer
()
59
{
60
NS_LOG_FUNCTION
(
this
);
61
Bands
bands;
62
for
(
double
fl = 2360e6; fl < 2479e6; fl += 6e6)
63
{
64
BandInfo
bi;
65
bi.
fl
= fl;
66
bi.
fc
= fl + 6e6;
67
bi.
fh
= fl + 12e6;
68
bands.push_back (bi);
69
}
70
NS_LOG_LOGIC
(
"bands.size () :"
<< bands.size ());
71
g_MicrowaveOvenSpectrumModel6Mhz
= Create<SpectrumModel> (bands);
72
}
73
}
g_MicrowaveOvenSpectrumModel6MhzInitializerInstance
;
74
75
76
77
78
79
Ptr<SpectrumValue>
80
MicrowaveOvenSpectrumValueHelper::CreatePowerSpectralDensityMwo1
()
81
{
82
Ptr<SpectrumValue>
psd = Create <SpectrumValue> (
g_MicrowaveOvenSpectrumModel6Mhz
);
83
84
// values from this paper:
85
// Tanim M. Taher, Matthew J. Misurac, Joseph L. LoCicero, and Donald R. Ucci,
86
// "MICROWAVE OVEN SIGNAL MODELING", in Proc. of IEEE WCNC, 2008,
87
// see Figure 3, "Experimental PSD of MWO #1"
88
// the figure has a resolution of 12 MHz per division; we use a
89
// SpectrumModel with a per-subband bandwidth of 6MHz, so we have
90
// two samples per division. The values used here are an approximation
91
// of what appears in the figure.
92
93
(*psd)[0] = -67.5;
94
(*psd)[1] = -67.5;
95
(*psd)[2] = -67.5;
96
(*psd)[3] = -67.5;
97
(*psd)[4] = -67.5;
98
(*psd)[5] = -66;
99
(*psd)[6] = -64;
100
(*psd)[7] = -63;
101
(*psd)[8] = -62.5;
102
(*psd)[9] = -63;
103
(*psd)[10] = -62.5;
104
(*psd)[11] = -62.5;
105
(*psd)[12] = -58;
106
(*psd)[13] = -53.5;
107
(*psd)[14] = -44;
108
(*psd)[15] = -38;
109
(*psd)[16] = -45;
110
(*psd)[17] = -65;
111
(*psd)[18] = -67.5;
112
(*psd)[19] = -67.5;
113
114
// convert to W/Hz
115
(*psd) =
Pow
(10.0, ((*psd) - 30) / 10.0);
116
117
return
psd;
118
}
119
120
121
122
Ptr<SpectrumValue>
123
MicrowaveOvenSpectrumValueHelper::CreatePowerSpectralDensityMwo2
()
124
{
125
// values from this paper:
126
// Tanim M. Taher, Matthew J. Misurac, Joseph L. LoCicero, and Donald R. Ucci,
127
// "MICROWAVE OVEN SIGNAL MODELING", in Proc. of IEEE WCNC, 2008,
128
// see Figure 9, "Experimental PSD of actual MWO #2"
129
// the figure has a resolution of 10 MHz per division; we use a
130
// SpectrumModel with a per-subband bandwidth of 5MHz, so we have
131
// two samples per division. The values used here are an approximation
132
// of what appears in the figure.
133
134
Ptr<SpectrumValue>
psd = Create <SpectrumValue> (
g_MicrowaveOvenSpectrumModel5Mhz
);
135
136
(*psd)[0] = -68;
137
(*psd)[1] = -68;
138
(*psd)[2] = -68;
139
(*psd)[3] = -68;
140
(*psd)[4] = -65;
141
(*psd)[5] = -62;
142
(*psd)[6] = -56;
143
(*psd)[7] = -55;
144
(*psd)[8] = -47;
145
(*psd)[9] = -40;
146
(*psd)[10] = -37;
147
(*psd)[11] = -33;
148
(*psd)[12] = -45;
149
(*psd)[13] = -67;
150
(*psd)[14] = -68;
151
(*psd)[15] = -68;
152
(*psd)[16] = -68;
153
(*psd)[17] = -68;
154
(*psd)[18] = -68;
155
(*psd)[19] = -68;
156
157
// convert to W/Hz
158
(*psd) =
Pow
(10.0, ((*psd) - 30) / 10.0);
159
160
return
psd;
161
}
162
163
164
165
}
// namespace ns3
ns3::Ptr
smart pointer class similar to boost::intrusive_ptr
Definition:
ptr.h:59
NS_LOG_FUNCTION
#define NS_LOG_FUNCTION(parameters)
Definition:
log.h:345
ns3::g_MicrowaveOvenSpectrumModel6Mhz
Ptr< SpectrumModel > g_MicrowaveOvenSpectrumModel6Mhz
Definition:
microwave-oven-spectrum-value-helper.cc:30
ns3::MicrowaveOvenSpectrumValueHelper::CreatePowerSpectralDensityMwo1
static Ptr< SpectrumValue > CreatePowerSpectralDensityMwo1()
Definition:
microwave-oven-spectrum-value-helper.cc:80
ns3::MicrowaveOvenSpectrumModel6MhzInitializer
Definition:
microwave-oven-spectrum-value-helper.cc:55
ns3::MicrowaveOvenSpectrumValueHelper::CreatePowerSpectralDensityMwo2
static Ptr< SpectrumValue > CreatePowerSpectralDensityMwo2()
Definition:
microwave-oven-spectrum-value-helper.cc:123
ns3::Bands
std::vector< BandInfo > Bands
Definition:
spectrum-model.h:53
NS_LOG_COMPONENT_DEFINE
NS_LOG_COMPONENT_DEFINE("MicrowaveOvenSpectrumValue")
ns3::BandInfo::fc
double fc
center frequency
Definition:
spectrum-model.h:48
ns3::Pow
SpectrumValue Pow(double lhs, const SpectrumValue &rhs)
Definition:
spectrum-value.cc:555
microwave-oven-spectrum-value-helper.h
NS_LOG_LOGIC
#define NS_LOG_LOGIC(msg)
Definition:
log.h:368
ns3::BandInfo::fl
double fl
lower limit of subband
Definition:
spectrum-model.h:47
ns3::MicrowaveOvenSpectrumModel5MhzInitializer
Definition:
microwave-oven-spectrum-value-helper.cc:33
ns3::BandInfo::fh
double fh
upper limit of subband
Definition:
spectrum-model.h:49
ns3::BandInfo
The building block of a SpectrumModel.
Definition:
spectrum-model.h:45
ns3::MicrowaveOvenSpectrumModel6MhzInitializer::MicrowaveOvenSpectrumModel6MhzInitializer
MicrowaveOvenSpectrumModel6MhzInitializer()
Definition:
microwave-oven-spectrum-value-helper.cc:58
ns3::g_MicrowaveOvenSpectrumModel6MhzInitializerInstance
class ns3::MicrowaveOvenSpectrumModel6MhzInitializer g_MicrowaveOvenSpectrumModel6MhzInitializerInstance
ns3::g_MicrowaveOvenSpectrumModel5Mhz
Ptr< SpectrumModel > g_MicrowaveOvenSpectrumModel5Mhz
Definition:
microwave-oven-spectrum-value-helper.cc:29
ns3::MicrowaveOvenSpectrumModel5MhzInitializer::MicrowaveOvenSpectrumModel5MhzInitializer
MicrowaveOvenSpectrumModel5MhzInitializer()
Definition:
microwave-oven-spectrum-value-helper.cc:36
ns3::g_MicrowaveOvenSpectrumModel5MhzInitializerInstance
class ns3::MicrowaveOvenSpectrumModel5MhzInitializer g_MicrowaveOvenSpectrumModel5MhzInitializerInstance
src
spectrum
model
microwave-oven-spectrum-value-helper.cc
Generated on Sat Apr 19 2014 14:07:08 for ns-3 by
1.8.6