A Discrete-Event Network Simulator
Home
Tutorials ▼
English
Documentation ▼
Installation
Manual
Models
Contributing
Wiki
Development ▼
API Docs
Issue Tracker
Merge Requests
API
Loading...
Searching...
No Matches
lr-wpan-spectrum-value-helper.h
Go to the documentation of this file.
1
/*
2
* Copyright (c) 2011 The Boeing Company
3
*
4
* This program is free software; you can redistribute it and/or modify
5
* it under the terms of the GNU General Public License version 2 as
6
* published by the Free Software Foundation;
7
*
8
* This program is distributed in the hope that it will be useful,
9
* but WITHOUT ANY WARRANTY; without even the implied warranty of
10
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11
* GNU General Public License for more details.
12
*
13
* You should have received a copy of the GNU General Public License
14
* along with this program; if not, write to the Free Software
15
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
16
*
17
* Author: Gary Pei <guangyu.pei@boeing.com>
18
*/
19
#ifndef LR_WPAN_SPECTRUM_VALUE_HELPER_H
20
#define LR_WPAN_SPECTRUM_VALUE_HELPER_H
21
22
#include <ns3/ptr.h>
23
24
namespace
ns3
25
{
26
27
class
SpectrumValue;
28
29
namespace
lrwpan
30
{
31
32
/**
33
* \ingroup lr-wpan
34
*
35
* \brief This class defines all functions to create spectrum model for LrWpan
36
*/
37
class
LrWpanSpectrumValueHelper
38
{
39
public
:
40
LrWpanSpectrumValueHelper
();
41
virtual
~LrWpanSpectrumValueHelper
();
42
43
/**
44
* \brief create spectrum value
45
* \param txPower the power transmission in dBm
46
* \param channel the channel number per IEEE802.15.4
47
* \return a Ptr to a newly created SpectrumValue instance
48
*/
49
Ptr<SpectrumValue>
CreateTxPowerSpectralDensity
(
double
txPower,
uint32_t
channel);
50
51
/**
52
* \brief create spectrum value for noise
53
* \param channel the channel number per IEEE802.15.4
54
* \return a Ptr to a newly created SpectrumValue instance
55
*/
56
Ptr<SpectrumValue>
CreateNoisePowerSpectralDensity
(
uint32_t
channel);
57
58
/**
59
* Set the noise factor added to the thermal noise.
60
* \param f A dimensionless ratio (i.e. Not in dB)
61
*/
62
void
SetNoiseFactor
(
double
f);
63
64
/**
65
* \brief total average power of the signal is the integral of the PSD using
66
* the limits of the given channel
67
* \param psd spectral density
68
* \param channel the channel number per IEEE802.15.4
69
* \return total power (using composite trap. rule to numerally integrate)
70
*/
71
static
double
TotalAvgPower
(
Ptr<const SpectrumValue>
psd,
uint32_t
channel);
72
73
private
:
74
/**
75
* A scaling factor for the noise power.
76
* It specifies how much additional noise the device
77
* contribute to the thermal noise (floor noise).
78
*/
79
double
m_noiseFactor
;
80
};
81
82
}
// namespace lrwpan
83
}
// namespace ns3
84
85
#endif
/* LR_WPAN_SPECTRUM_VALUE_HELPER_H */
ns3::Ptr
Smart pointer class similar to boost::intrusive_ptr.
Definition:
ptr.h:77
ns3::lrwpan::LrWpanSpectrumValueHelper
This class defines all functions to create spectrum model for LrWpan.
Definition:
lr-wpan-spectrum-value-helper.h:38
ns3::lrwpan::LrWpanSpectrumValueHelper::CreateNoisePowerSpectralDensity
Ptr< SpectrumValue > CreateNoisePowerSpectralDensity(uint32_t channel)
create spectrum value for noise
Definition:
lr-wpan-spectrum-value-helper.cc:109
ns3::lrwpan::LrWpanSpectrumValueHelper::~LrWpanSpectrumValueHelper
virtual ~LrWpanSpectrumValueHelper()
Definition:
lr-wpan-spectrum-value-helper.cc:70
ns3::lrwpan::LrWpanSpectrumValueHelper::TotalAvgPower
static double TotalAvgPower(Ptr< const SpectrumValue > psd, uint32_t channel)
total average power of the signal is the integral of the PSD using the limits of the given channel
Definition:
lr-wpan-spectrum-value-helper.cc:138
ns3::lrwpan::LrWpanSpectrumValueHelper::LrWpanSpectrumValueHelper
LrWpanSpectrumValueHelper()
Definition:
lr-wpan-spectrum-value-helper.cc:64
ns3::lrwpan::LrWpanSpectrumValueHelper::m_noiseFactor
double m_noiseFactor
A scaling factor for the noise power.
Definition:
lr-wpan-spectrum-value-helper.h:79
ns3::lrwpan::LrWpanSpectrumValueHelper::CreateTxPowerSpectralDensity
Ptr< SpectrumValue > CreateTxPowerSpectralDensity(double txPower, uint32_t channel)
create spectrum value
Definition:
lr-wpan-spectrum-value-helper.cc:76
ns3::lrwpan::LrWpanSpectrumValueHelper::SetNoiseFactor
void SetNoiseFactor(double f)
Set the noise factor added to the thermal noise.
Definition:
lr-wpan-spectrum-value-helper.cc:132
uint32_t
ns3
Every class exported by the ns3 library is enclosed in the ns3 namespace.
src
lr-wpan
model
lr-wpan-spectrum-value-helper.h
Generated on Tue May 28 2024 23:36:57 for ns-3 by
1.9.6