A Discrete-Event Network Simulator
API
Loading...
Searching...
No Matches
tv-spectrum-transmitter.h
Go to the documentation of this file.
1/*
2 * Copyright (c) 2014 University of Washington
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: Benjamin Cizdziel <ben.cizdziel@gmail.com>
18 */
19
20#ifndef TV_SPECTRUM_TRANSMITTER_H
21#define TV_SPECTRUM_TRANSMITTER_H
22
23#include "spectrum-channel.h"
24#include "spectrum-phy.h"
26#include "spectrum-value.h"
27
28#include <ns3/antenna-model.h>
29#include <ns3/mobility-model.h>
30#include <ns3/net-device.h>
31
32namespace ns3
33{
34
35/**
36 * \ingroup spectrum
37 *
38 * SpectrumPhy implementation that creates a customizable TV transmitter which
39 * transmits a PSD spectrum specified by user-set attributes.
40 *
41 *
42 * This PHY model supports a single antenna model instance which is
43 * used for transmission (this PHY model never receives).
44 */
46{
47 public:
48 /**
49 * types of TV transmitters: analog, digital 8-VSB, or digital COFDM
50 */
51 enum TvType
52 {
56 };
57
59 ~TvSpectrumTransmitter() override;
60
61 /**
62 * Register this type.
63 * \return The object TypeId.
64 */
65 static TypeId GetTypeId();
66
67 // inherited from SpectrumPhy
68 void SetChannel(Ptr<SpectrumChannel> c) override;
69 void SetMobility(Ptr<MobilityModel> m) override;
70 void SetDevice(Ptr<NetDevice> d) override;
71 Ptr<MobilityModel> GetMobility() const override;
72 Ptr<NetDevice> GetDevice() const override;
73 // device does not use Rx but these pure virtual methods must be implemented
75 Ptr<Object> GetAntenna() const override;
76 void StartRx(Ptr<SpectrumSignalParameters> params) override;
77
78 /**
79 * Get the spectrum channel
80 *
81 * @return a pointer to the assigned spectrum channel
82 */
84
85 /**
86 * Creates power spectral density (PSD) spectrum of the TV transmitter and
87 * sets it for transmission.
88 * Before calling this method, must set attributes and parameters that are
89 * applicable to your transmitter.
90 *
91 * 8-VSB PSD approximated from Figure 3 of the following article:
92 * Baron, Stanley. "First-Hand:Digital Television: The Digital Terrestrial
93 * Television Broadcasting (DTTB) Standard." IEEE Global History Network.
94 * <http://www.ieeeghn.org/wiki/index.php/First-Hand:Digital_Television:_The_
95 * Digital_Terrestrial_Television_Broadcasting_(DTTB)_Standard>.
96 *
97 * COFDM PSD approximated from Figure 12 (8k mode) of the following article:
98 * Kopp, Carlo. "High Definition Television." High Definition Television. Air
99 * Power Australia. <http://www.ausairpower.net/AC-1100.html>.
100 *
101 * Analog PSD approximated from Figure 4 of the following paper:
102 * Stephen Shellhammer, Ahmed Sadek, and Wenyi Zhang. "Technical Challenges
103 * for Cognitive Radio in the TV White Space Spectrum." Qualcomm Incorporated.
104 */
105 virtual void CreateTvPsd();
106
107 /**
108 * Get the power spectral density of the TV transmitter's signal
109 *
110 * @return a pointer to the PSD
111 */
113
114 /**
115 * Starts the TV Transmitter's transmission on the spectrum channel
116 */
117 virtual void Start();
118
119 /**
120 * Stops the TV Transmitter's transmission on the spectrum channel
121 */
122 virtual void Stop();
123
124 private:
125 Ptr<MobilityModel> m_mobility; //!< Pointer to mobility model object
126 Ptr<AntennaModel> m_antenna; //!< Pointer to antenna model object
127 Ptr<NetDevice> m_netDevice; //!< Pointer to net device object
128 Ptr<SpectrumChannel> m_channel; //!< Pointer to spectrum channel object
129
130 /** Sets up signal to be transmitted */
131 virtual void SetupTx();
132
133 TvType m_tvType; //!< Type of TV transmitter
134 double m_startFrequency; //!< Start frequency (in Hz) of TV transmitter's signal
135 double m_channelBandwidth; //!< Bandwidth (in Hz) of TV transmitter's signal
136 double m_basePsd; //!< Base power spectral density value (in dBm/Hz) of TV transmitter's signal
137 Ptr<SpectrumValue> m_txPsd; //!< Pointer to power spectral density of TV transmitter's signal
138 Time m_startingTime; //!< Timepoint after simulation begins that TV transmitter will begin
139 //!< transmitting
140 Time m_transmitDuration; //!< Length of time that TV transmitter will transmit for
141 bool m_active; //!< True if TV transmitter is transmitting
142};
143
144} // namespace ns3
145
146#endif /* TV_SPECTRUM_TRANSMITTER_H */
Smart pointer class similar to boost::intrusive_ptr.
Definition: ptr.h:77
Abstract base class for Spectrum-aware PHY layers.
Definition: spectrum-phy.h:46
Simulation virtual time values and global simulation resolution.
Definition: nstime.h:105
SpectrumPhy implementation that creates a customizable TV transmitter which transmits a PSD spectrum ...
Ptr< AntennaModel > m_antenna
Pointer to antenna model object.
TvType m_tvType
Type of TV transmitter.
Ptr< MobilityModel > GetMobility() const override
Get the associated MobilityModel instance.
virtual void CreateTvPsd()
Creates power spectral density (PSD) spectrum of the TV transmitter and sets it for transmission.
double m_basePsd
Base power spectral density value (in dBm/Hz) of TV transmitter's signal.
Time m_transmitDuration
Length of time that TV transmitter will transmit for.
bool m_active
True if TV transmitter is transmitting.
Ptr< NetDevice > m_netDevice
Pointer to net device object.
virtual void Start()
Starts the TV Transmitter's transmission on the spectrum channel.
void SetDevice(Ptr< NetDevice > d) override
Set the associated NetDevice instance.
void SetMobility(Ptr< MobilityModel > m) override
Set the mobility model associated with this device.
double m_channelBandwidth
Bandwidth (in Hz) of TV transmitter's signal.
double m_startFrequency
Start frequency (in Hz) of TV transmitter's signal.
Time m_startingTime
Timepoint after simulation begins that TV transmitter will begin transmitting.
virtual void Stop()
Stops the TV Transmitter's transmission on the spectrum channel.
virtual void SetupTx()
Sets up signal to be transmitted.
Ptr< const SpectrumModel > GetRxSpectrumModel() const override
Ptr< SpectrumValue > GetTxPsd() const
Get the power spectral density of the TV transmitter's signal.
TvType
types of TV transmitters: analog, digital 8-VSB, or digital COFDM
Ptr< SpectrumChannel > GetChannel() const
Get the spectrum channel.
Ptr< Object > GetAntenna() const override
Get the AntennaModel used by this SpectrumPhy instance for transmission and/or reception.
void SetChannel(Ptr< SpectrumChannel > c) override
Set the channel attached to this device.
static TypeId GetTypeId()
Register this type.
Ptr< SpectrumChannel > m_channel
Pointer to spectrum channel object.
void StartRx(Ptr< SpectrumSignalParameters > params) override
Notify the SpectrumPhy instance of an incoming signal.
Ptr< NetDevice > GetDevice() const override
Get the associated NetDevice instance.
Ptr< SpectrumValue > m_txPsd
Pointer to power spectral density of TV transmitter's signal.
Ptr< MobilityModel > m_mobility
Pointer to mobility model object.
a unique identifier for an interface.
Definition: type-id.h:59
Every class exported by the ns3 library is enclosed in the ns3 namespace.