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