A Discrete-Event Network Simulator
API
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 
32 namespace ns3
33 {
34 
46 {
47  public:
51  enum TvType
52  {
56  };
57 
59  ~TvSpectrumTransmitter() override;
60 
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;
77 
84 
105  virtual void CreateTvPsd();
106 
113 
117  virtual void Start();
118 
122  virtual void Stop();
123 
124  private:
129 
131  virtual void SetupTx();
132 
136  double m_basePsd;
141  bool m_active;
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.
params
Fit Fluctuating Two Ray model to the 3GPP TR 38.901 using the Anderson-Darling goodness-of-fit ##.