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