|
SoDaRadio-5.0.3-master:8901fb5
|
The Transmit RF Path. More...
#include <USRPTX.hxx>
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... | |
| SoDaBase * | findSoDaObject (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... | |
| DatMBox * | tx_stream |
| transmit audio stream More... | |
| DatMBox * | cw_env_stream |
| envelope stream from text-to-CW converter (CW unit) More... | |
| CmdMBox * | cmd_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 |
The Transmit RF Path.
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.
| 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.
| params | block describing intial setup of the radio |
| _usrp | libuhd handle for the USRP radio |
| _tx_stream | audio transmit stream to be used in modulator |
| _cw_env_stream | envelope stream from text-to-CW converter |
| _cmd_stream | command 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.
|
private |
given a keying envelope, impose it on the CW tone
| out | the output IQ buffer, CW_osc amplitude modulated by the envelope parameter |
| envelope | float array of keyed waveform amplitudes |
| env_len | length of envelope array |
Definition at line 211 of file USRPTX.cxx.
References cw_env_amplitude, CW_osc, and SoDa::QuadratureOscillator::stepOscCF().
Referenced by run().
|
privatevirtual |
execute GET commands from the command channel
| cmd | the 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.
|
privatevirtual |
handle Report commands from the command channel
| cmd | the 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.
|
privatevirtual |
handle SET commands from the command channel
| cmd | the incoming command |
Reimplemented from SoDa::SoDaThread.
Definition at line 258 of file USRPTX.cxx.
References beacon_mode, cmd_stream, SoDa::Command::CW_L, CW_tone_freq, SoDa::Command::CW_U, SoDa::Debug::debugMsg(), SoDa::Command::iparms, LO_enabled, SoDa::MultiMBox< T >::put(), SoDa::Command::REP, setCWFreq(), SoDa::Command::target, transmitSwitch(), SoDa::Command::TVRT_LO_DISABLE, SoDa::Command::TVRT_LO_ENABLE, SoDa::Command::TX_BEACON, SoDa::Command::TX_CW_EMPTY, tx_enabled, SoDa::Command::TX_MODE, tx_modulation, SoDa::Command::TX_STATE, and waiting_to_run_dry.
|
private |
setup transmit streamer.
Definition at line 252 of file USRPTX.cxx.
References stream_args, tx_bits, and usrp.
Referenced by run().
|
virtual |
USRPTX run loop: handle commands, and modulate the tx carrier.
Implements SoDa::SoDaThread.
Definition at line 113 of file USRPTX.cxx.
References beacon_env, beacon_mode, cmd_stream, cmd_subs, const_buf, cw_buf, cw_env_stream, SoDa::Command::CW_L, cw_subs, SoDa::Command::CW_U, SoDa::Debug::debugMsg(), doCW(), SoDa::SoDaThread::execCommand(), SoDa::MultiMBox< T >::free(), SoDa::MultiMBox< T >::get(), SoDa::SoDaBuf::getComplexBuf(), SoDa::SoDaBuf::getComplexLen(), SoDa::SoDaBuf::getFloatBuf(), getTXStreamer(), LO_capable, LO_configured, LO_enabled, md, SoDa::MultiMBox< T >::put(), SoDa::Command::REP, SoDa::Command::STOP, SoDa::Command::target, tx_bits, tx_buffer_size, SoDa::Command::TX_CW_EMPTY, tx_enabled, tx_modulation, tx_stream, tx_subs, waiting_to_run_dry, zero_buf, and zero_env.
|
private |
set the CW tone frequency to generate an IQ stream
| usb | if true, put the tone above the nominal carrier |
| freq | frequency 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().
|
private |
start/stop transmit stream
| tx_on | if 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().
|
private |
steady constant amplitude envelope
Definition at line 136 of file USRPTX.hxx.
|
private |
if true, we're transmitting a steady carrier
Definition at line 137 of file USRPTX.hxx.
Referenced by execSetCommand(), run(), and USRPTX().
|
private |
command stream
Definition at line 128 of file USRPTX.hxx.
Referenced by execGetCommand(), execSetCommand(), run(), and USRPTX().
|
private |
subscription handle for command stream
Definition at line 123 of file USRPTX.hxx.
|
private |
envelope for dead silence
Definition at line 159 of file USRPTX.hxx.
|
private |
CW modulated envelope to send to USRP.
Definition at line 141 of file USRPTX.hxx.
|
private |
used to set CW output envelope, constant at 0.7
Definition at line 146 of file USRPTX.hxx.
|
private |
envelope stream from text-to-CW converter (CW unit)
Definition at line 127 of file USRPTX.hxx.
|
private |
CW tone IQ oscillator.
Definition at line 134 of file USRPTX.hxx.
Referenced by doCW(), and setCWFreq().
|
private |
subscription handle for cw envelope stream (from CW unit)
Definition at line 124 of file USRPTX.hxx.
|
private |
Definition at line 133 of file USRPTX.hxx.
Referenced by execSetCommand(), and USRPTX().
|
private |
if true, this hardware model supports LO config
Definition at line 157 of file USRPTX.hxx.
|
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().
|
private |
if true, we're in local transverter mode
Definition at line 155 of file USRPTX.hxx.
Referenced by execSetCommand(), run(), transmitSwitch(), and USRPTX().
|
private |
metadata describing USRP transmit buffer
Definition at line 152 of file USRPTX.hxx.
Referenced by run(), and transmitSwitch().
|
private |
Definition at line 150 of file USRPTX.hxx.
Referenced by getTXStreamer(), and USRPTX().
|
private |
USRP (UHD) transmit stream handle.
Definition at line 151 of file USRPTX.hxx.
Referenced by getTXStreamer(), run(), and transmitSwitch().
|
private |
size of buffer going to USRP
Definition at line 145 of file USRPTX.hxx.
|
private |
if true, we're transmitting.
Definition at line 130 of file USRPTX.hxx.
Referenced by execGetCommand(), execSetCommand(), run(), transmitSwitch(), and USRPTX().
|
private |
type of transmit modulation (CW_U,CW_L,USB,LSB...)
Definition at line 131 of file USRPTX.hxx.
Referenced by execSetCommand(), and run().
|
private |
sample rate for buffer going to USRP (UHD)
Definition at line 144 of file USRPTX.hxx.
Referenced by setCWFreq(), and USRPTX().
|
private |
transmit audio stream
Definition at line 126 of file USRPTX.hxx.
Referenced by run(), transmitSwitch(), and USRPTX().
|
private |
subscription handle for transmit audio stream (from BaseBandTX)
Definition at line 122 of file USRPTX.hxx.
Referenced by run(), transmitSwitch(), and USRPTX().
|
private |
|
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().
|
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().
|
private |
envelope for dead silence
Definition at line 139 of file USRPTX.hxx.
1.8.13