SoDaRadio-5.0.3-master:8901fb5
Public Member Functions | Private Member Functions | Private Attributes | List of all members
SoDa::USRPTX Class Reference

The Transmit RF Path. More...

#include <USRPTX.hxx>

Inheritance diagram for SoDa::USRPTX:
SoDa::SoDaThread SoDa::SoDaBase SoDa::Debug

Public Member Functions

 USRPTX (Params *params, uhd::usrp::multi_usrp::sptr _usrp, DatMBox *_tx_stream, DatMBox *_cw_env_stream, CmdMBox *_cmd_stream)
 Constructor for RF Transmit/modulator process. More...
 
void run ()
 USRPTX run loop: handle commands, and modulate the tx carrier. More...
 
- Public Member Functions inherited from SoDa::SoDaThread
 SoDaThread (const std::string &oname)
 
void start ()
 Execute the threads run loop. More...
 
void join ()
 more properly "Wait for this thread to exit its run loop". More...
 
bool waitForJoin (unsigned int m)
 wait for the thread to stop running, or the specified time to pass. More...
 
void execCommand (Command *cmd)
 Execute (dispatch) a message removed from the command stream to one of the basic Command handler functions. More...
 
- Public Member Functions inherited from SoDa::SoDaBase
 SoDaBase (const std::string &oname)
 The constructor – pass a name for the object. More...
 
std::string & getObjName ()
 get the name of this object More...
 
SoDaBasefindSoDaObject (const std::string &oname)
 find a SoDa Object by name. More...
 
double getTime ()
 Get a time stamp in nS resolution that monotonically increases and that is very inexpensive (typically < 100nS). More...
 
- Public Member Functions inherited from SoDa::Debug
 Debug (std::string _unit_name=std::string("UNKNOWN"))
 
 Debug (const char *_unit_name_cstr)
 
 Debug (unsigned int _debug_level, std::string _unit_name=std::string("UNKNOWN"))
 
 Debug (unsigned int _debug_level, const char *_unit_name_cstr)
 
void debugMsg (const std::string &msg, unsigned int threshold=1)
 
void debugMsg (const boost::format &fmt, unsigned int threshold=1)
 
void debugMsg (const char *msg, unsigned int threshold=1)
 
void setDebugLevel (unsigned int v)
 
unsigned int getDebugLevel ()
 

Private Member Functions

void transmitSwitch (bool tx_on)
 start/stop transmit stream More...
 
void getTXStreamer ()
 setup transmit streamer. More...
 
void execGetCommand (Command *cmd)
 execute GET commands from the command channel More...
 
void execSetCommand (Command *cmd)
 handle SET commands from the command channel More...
 
void execRepCommand (Command *cmd)
 handle Report commands from the command channel More...
 
void setCWFreq (bool usb, double freq)
 set the CW tone frequency to generate an IQ stream More...
 
void doCW (std::complex< float > *out, float *envelope, unsigned int env_len)
 given a keying envelope, impose it on the CW tone More...
 

Private Attributes

uhd::usrp::multi_usrp::sptr usrp
 the radio. More...
 
unsigned int tx_subs
 subscription handle for transmit audio stream (from BaseBandTX) More...
 
unsigned int cmd_subs
 subscription handle for command stream More...
 
unsigned int cw_subs
 subscription handle for cw envelope stream (from CW unit) More...
 
DatMBoxtx_stream
 transmit audio stream More...
 
DatMBoxcw_env_stream
 envelope stream from text-to-CW converter (CW unit) More...
 
CmdMBoxcmd_stream
 command stream More...
 
bool tx_enabled
 if true, we're transmitting. More...
 
SoDa::Command::ModulationType tx_modulation
 type of transmit modulation (CW_U,CW_L,USB,LSB...) More...
 
double CW_tone_freq
 
QuadratureOscillator CW_osc
 CW tone IQ oscillator. More...
 
float * beacon_env
 steady constant amplitude envelope More...
 
bool beacon_mode
 if true, we're transmitting a steady carrier More...
 
float * zero_env
 envelope for dead silence More...
 
std::complex< float > * cw_buf
 CW modulated envelope to send to USRP. More...
 
std::complex< float > * zero_buf
 zero signal envelope to fill in end of transmit stream More...
 
double tx_sample_rate
 sample rate for buffer going to USRP (UHD) More...
 
unsigned int tx_buffer_size
 size of buffer going to USRP More...
 
float cw_env_amplitude
 used to set CW output envelope, constant at 0.7 More...
 
bool waiting_to_run_dry
 When set, we should send out a report when we run out of CW buffer. More...
 
uhd::stream_args_t * stream_args
 
uhd::tx_streamer::sptr tx_bits
 USRP (UHD) transmit stream handle. More...
 
uhd::tx_metadata_t md
 metadata describing USRP transmit buffer More...
 
bool LO_enabled
 if true, we're in local transverter mode More...
 
bool LO_configured
 if true, the LO has had its gain/freq set. More...
 
bool LO_capable
 if true, this hardware model supports LO config More...
 
std::complex< float > * const_buf
 envelope for dead silence More...
 

Additional Inherited Members

- Static Public Member Functions inherited from SoDa::Debug
static void setDefaultLevel (unsigned int v)
 
static unsigned int getDefaultLevel ()
 
static void setGlobalLevel (unsigned int v)
 
static unsigned int getGlobalLevel ()
 
- Static Public Attributes inherited from SoDa::Debug
static boost::mutex debug_msg_mutex
 
- Protected Member Functions inherited from SoDa::Debug
std::string curDateTime ()
 
- Protected Attributes inherited from SoDa::Debug
std::string unit_name
 the name of the unit reporting status More...
 
unsigned int debug_level
 the debug level (threshold) for messages More...
 
- Static Protected Attributes inherited from SoDa::Debug
static unsigned int default_debug_level = 0
 
static unsigned int global_debug_level = 0
 

Detailed Description

The Transmit RF Path.

SoDa_Radio_TX_Signal_Path.svg

In SSB/AM/FM modes, the USRPTX unit accepts an I/Q audio stream from the BaseBandTX unit and forwards it to the USRP. In CW mode, the USRPTX unit impresses a CW envelope (received from the CW unit) onto a carrier and passes this to the USRP.

Definition at line 51 of file USRPTX.hxx.

Constructor & Destructor Documentation

◆ USRPTX()

SoDa::USRPTX::USRPTX ( Params params,
uhd::usrp::multi_usrp::sptr  _usrp,
DatMBox _tx_stream,
DatMBox _cw_env_stream,
CmdMBox _cmd_stream 
)

Constructor for RF Transmit/modulator process.

Parameters
paramsblock describing intial setup of the radio
_usrplibuhd handle for the USRP radio
_tx_streamaudio transmit stream to be used in modulator
_cw_env_streamenvelope stream from text-to-CW converter
_cmd_streamcommand stream

Definition at line 39 of file USRPTX.cxx.

References beacon_env, beacon_mode, cmd_stream, cmd_subs, const_buf, cw_buf, cw_env_amplitude, cw_env_stream, cw_subs, CW_tone_freq, SoDa::Debug::debugMsg(), SoDa::Params::getRFBufferSize(), SoDa::Params::getTXRate(), LO_capable, LO_configured, LO_enabled, setCWFreq(), stream_args, SoDa::MultiMBox< T >::subscribe(), tx_buffer_size, tx_enabled, tx_sample_rate, tx_stream, tx_subs, usrp, waiting_to_run_dry, zero_buf, and zero_env.

Member Function Documentation

◆ doCW()

void SoDa::USRPTX::doCW ( std::complex< float > *  out,
float *  envelope,
unsigned int  env_len 
)
private

given a keying envelope, impose it on the CW tone

Parameters
outthe output IQ buffer, CW_osc amplitude modulated by the envelope parameter
envelopefloat array of keyed waveform amplitudes
env_lenlength of envelope array

Definition at line 211 of file USRPTX.cxx.

References cw_env_amplitude, CW_osc, and SoDa::QuadratureOscillator::stepOscCF().

Referenced by run().

◆ execGetCommand()

void SoDa::USRPTX::execGetCommand ( Command cmd)
privatevirtual

execute GET commands from the command channel

Parameters
cmdthe incoming command

Reimplemented from SoDa::SoDaThread.

Definition at line 298 of file USRPTX.cxx.

References cmd_stream, SoDa::MultiMBox< T >::put(), SoDa::Command::REP, SoDa::Command::target, tx_enabled, and SoDa::Command::TX_STATE.

◆ execRepCommand()

void SoDa::USRPTX::execRepCommand ( Command cmd)
privatevirtual

handle Report commands from the command channel

Parameters
cmdthe incoming command

Reimplemented from SoDa::SoDaThread.

Definition at line 309 of file USRPTX.cxx.

References SoDa::Debug::debugMsg(), LO_configured, SoDa::Command::target, and SoDa::Command::TVRT_LO_CONFIG.

◆ execSetCommand()

void SoDa::USRPTX::execSetCommand ( Command cmd)
privatevirtual

◆ getTXStreamer()

void SoDa::USRPTX::getTXStreamer ( )
private

setup transmit streamer.

Definition at line 252 of file USRPTX.cxx.

References stream_args, tx_bits, and usrp.

Referenced by run().

◆ run()

void SoDa::USRPTX::run ( )
virtual

◆ setCWFreq()

void SoDa::USRPTX::setCWFreq ( bool  usb,
double  freq 
)
private

set the CW tone frequency to generate an IQ stream

Parameters
usbif true, put the tone above the nominal carrier
freqfrequency of the CW tone (offset from zero beat)

Definition at line 222 of file USRPTX.cxx.

References CW_osc, SoDa::QuadratureOscillator::setPhaseIncr(), and tx_sample_rate.

Referenced by execSetCommand(), and USRPTX().

◆ transmitSwitch()

void SoDa::USRPTX::transmitSwitch ( bool  tx_on)
private

start/stop transmit stream

Parameters
tx_onif true, go into transmit mode

Definition at line 229 of file USRPTX.cxx.

References SoDa::MultiMBox< T >::flush(), LO_enabled, md, tx_bits, tx_enabled, tx_stream, tx_subs, waiting_to_run_dry, and zero_buf.

Referenced by execSetCommand().

Member Data Documentation

◆ beacon_env

float* SoDa::USRPTX::beacon_env
private

steady constant amplitude envelope

Definition at line 136 of file USRPTX.hxx.

Referenced by run(), and USRPTX().

◆ beacon_mode

bool SoDa::USRPTX::beacon_mode
private

if true, we're transmitting a steady carrier

Definition at line 137 of file USRPTX.hxx.

Referenced by execSetCommand(), run(), and USRPTX().

◆ cmd_stream

CmdMBox* SoDa::USRPTX::cmd_stream
private

command stream

Definition at line 128 of file USRPTX.hxx.

Referenced by execGetCommand(), execSetCommand(), run(), and USRPTX().

◆ cmd_subs

unsigned int SoDa::USRPTX::cmd_subs
private

subscription handle for command stream

Definition at line 123 of file USRPTX.hxx.

Referenced by run(), and USRPTX().

◆ const_buf

std::complex<float>* SoDa::USRPTX::const_buf
private

envelope for dead silence

Definition at line 159 of file USRPTX.hxx.

Referenced by run(), and USRPTX().

◆ cw_buf

std::complex<float>* SoDa::USRPTX::cw_buf
private

CW modulated envelope to send to USRP.

Definition at line 141 of file USRPTX.hxx.

Referenced by run(), and USRPTX().

◆ cw_env_amplitude

float SoDa::USRPTX::cw_env_amplitude
private

used to set CW output envelope, constant at 0.7

Definition at line 146 of file USRPTX.hxx.

Referenced by doCW(), and USRPTX().

◆ cw_env_stream

DatMBox* SoDa::USRPTX::cw_env_stream
private

envelope stream from text-to-CW converter (CW unit)

Definition at line 127 of file USRPTX.hxx.

Referenced by run(), and USRPTX().

◆ CW_osc

QuadratureOscillator SoDa::USRPTX::CW_osc
private

CW tone IQ oscillator.

Definition at line 134 of file USRPTX.hxx.

Referenced by doCW(), and setCWFreq().

◆ cw_subs

unsigned int SoDa::USRPTX::cw_subs
private

subscription handle for cw envelope stream (from CW unit)

Definition at line 124 of file USRPTX.hxx.

Referenced by run(), and USRPTX().

◆ CW_tone_freq

double SoDa::USRPTX::CW_tone_freq
private

Definition at line 133 of file USRPTX.hxx.

Referenced by execSetCommand(), and USRPTX().

◆ LO_capable

bool SoDa::USRPTX::LO_capable
private

if true, this hardware model supports LO config

Definition at line 157 of file USRPTX.hxx.

Referenced by run(), and USRPTX().

◆ LO_configured

bool SoDa::USRPTX::LO_configured
private

if true, the LO has had its gain/freq set.

Definition at line 156 of file USRPTX.hxx.

Referenced by execRepCommand(), run(), and USRPTX().

◆ LO_enabled

bool SoDa::USRPTX::LO_enabled
private

if true, we're in local transverter mode

Definition at line 155 of file USRPTX.hxx.

Referenced by execSetCommand(), run(), transmitSwitch(), and USRPTX().

◆ md

uhd::tx_metadata_t SoDa::USRPTX::md
private

metadata describing USRP transmit buffer

Definition at line 152 of file USRPTX.hxx.

Referenced by run(), and transmitSwitch().

◆ stream_args

uhd::stream_args_t* SoDa::USRPTX::stream_args
private

Definition at line 150 of file USRPTX.hxx.

Referenced by getTXStreamer(), and USRPTX().

◆ tx_bits

uhd::tx_streamer::sptr SoDa::USRPTX::tx_bits
private

USRP (UHD) transmit stream handle.

Definition at line 151 of file USRPTX.hxx.

Referenced by getTXStreamer(), run(), and transmitSwitch().

◆ tx_buffer_size

unsigned int SoDa::USRPTX::tx_buffer_size
private

size of buffer going to USRP

Definition at line 145 of file USRPTX.hxx.

Referenced by run(), and USRPTX().

◆ tx_enabled

bool SoDa::USRPTX::tx_enabled
private

if true, we're transmitting.

Definition at line 130 of file USRPTX.hxx.

Referenced by execGetCommand(), execSetCommand(), run(), transmitSwitch(), and USRPTX().

◆ tx_modulation

SoDa::Command::ModulationType SoDa::USRPTX::tx_modulation
private

type of transmit modulation (CW_U,CW_L,USB,LSB...)

Definition at line 131 of file USRPTX.hxx.

Referenced by execSetCommand(), and run().

◆ tx_sample_rate

double SoDa::USRPTX::tx_sample_rate
private

sample rate for buffer going to USRP (UHD)

Definition at line 144 of file USRPTX.hxx.

Referenced by setCWFreq(), and USRPTX().

◆ tx_stream

DatMBox* SoDa::USRPTX::tx_stream
private

transmit audio stream

Definition at line 126 of file USRPTX.hxx.

Referenced by run(), transmitSwitch(), and USRPTX().

◆ tx_subs

unsigned int SoDa::USRPTX::tx_subs
private

subscription handle for transmit audio stream (from BaseBandTX)

Definition at line 122 of file USRPTX.hxx.

Referenced by run(), transmitSwitch(), and USRPTX().

◆ usrp

uhd::usrp::multi_usrp::sptr SoDa::USRPTX::usrp
private

the radio.

Definition at line 73 of file USRPTX.hxx.

Referenced by getTXStreamer(), and USRPTX().

◆ waiting_to_run_dry

bool SoDa::USRPTX::waiting_to_run_dry
private

When set, we should send out a report when we run out of CW buffer.

Definition at line 148 of file USRPTX.hxx.

Referenced by execSetCommand(), run(), transmitSwitch(), and USRPTX().

◆ zero_buf

std::complex<float>* SoDa::USRPTX::zero_buf
private

zero signal envelope to fill in end of transmit stream

Definition at line 142 of file USRPTX.hxx.

Referenced by run(), transmitSwitch(), and USRPTX().

◆ zero_env

float* SoDa::USRPTX::zero_env
private

envelope for dead silence

Definition at line 139 of file USRPTX.hxx.

Referenced by run(), and USRPTX().


The documentation for this class was generated from the following files: