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

The Receive RF Path. More...

#include <USRPRX.hxx>

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

Public Member Functions

 USRPRX (Params *params, uhd::usrp::multi_usrp::sptr usrp, DatMBox *_rx_stream, DatMBox *_if_stream, CmdMBox *_cmd_stream)
 The constructor. More...
 
void run ()
 USRPRX is a thread – this is its run loop. 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 execCommand (Command *cmd)
 
void execGetCommand (Command *cmd)
 optional method to handle "GET" commands – commands that request a response More...
 
void execSetCommand (Command *cmd)
 optional method to handle "SET" commands – commands that set internal state in the object. More...
 
void execRepCommand (Command *cmd)
 optional method that reports status or the result of some action. More...
 
void startStream ()
 
void stopStream ()
 
void doMixer (SoDaBuf *inout)
 implement a complex down converter with complex multiplication More...
 
void set3rdLOFreq (double IF_tuning)
 

Private Attributes

DatMBoxrx_stream
 
DatMBoxif_stream
 
CmdMBoxcmd_stream
 
unsigned int cmd_subs
 
uhd::rx_streamer::sptr rx_bits
 
uhd::usrp::multi_usrp::sptr usrp
 
unsigned int rx_buffer_size
 
bool audio_rx_stream_enabled
 
SoDa::Command::ModulationType rx_modulation
 
UIui
 
QuadratureOscillator IF_osc
 
double current_IF_tuning
 
double rx_sample_rate
 
bool enable_spectrum_report
 
int outf [2]
 
int scount
 
std::ofstream rf_dumpfile
 
std::ofstream if_dumpfile
 

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 Receive RF Path.

SoDa_Radio_RX_Signal_Path.svg

Definition at line 46 of file USRPRX.hxx.

Constructor & Destructor Documentation

◆ USRPRX()

SoDa::USRPRX::USRPRX ( Params params,
uhd::usrp::multi_usrp::sptr  usrp,
DatMBox _rx_stream,
DatMBox _if_stream,
CmdMBox _cmd_stream 
)

The constructor.

Parameters
paramsa pointer to a params object that will tell us about sample rates and other configuration details.
usrpa pointer to the UHD USRP object that we are streaming data from.
_rx_streamdata mailbox used to pass the baseband (IF3) shifted incoming RF samples to other units
_if_streamdata mailbox used to pass the IF2 data to the spectrum units
_cmd_streamdata mailbox used to carry command, query, and report messages

Definition at line 42 of file USRPRX.cxx.

References audio_rx_stream_enabled, cmd_stream, cmd_subs, doFFTandDump(), enable_spectrum_report, SoDa::Params::getRFBufferSize(), SoDa::Params::getRXRate(), if_dumpfile, if_stream, rf_dumpfile, rx_bits, rx_buffer_size, rx_modulation, rx_sample_rate, rx_stream, scount, SoDa::MultiMBox< T >::subscribe(), ui, SoDa::Command::USB, and usrp.

Member Function Documentation

◆ doMixer()

void SoDa::USRPRX::doMixer ( SoDaBuf inout)
private

implement a complex down converter with complex multiplication

This is a complex downconverter in the manner presented in Lyons pp 457-458

Parameters
inoutthe input/output RF buffer

Definition at line 187 of file USRPRX.cxx.

References SoDa::SoDaBuf::getComplexBuf(), SoDa::SoDaBuf::getComplexMaxLen(), IF_osc, and SoDa::QuadratureOscillator::stepOscCF().

Referenced by run().

◆ execCommand()

void SoDa::USRPRX::execCommand ( Command cmd)
private

◆ execGetCommand()

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

optional method to handle "GET" commands – commands that request a response

Reimplemented from SoDa::SoDaThread.

Definition at line 280 of file USRPRX.cxx.

Referenced by execCommand().

◆ execRepCommand()

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

optional method that reports status or the result of some action.

Reimplemented from SoDa::SoDaThread.

Definition at line 285 of file USRPRX.cxx.

Referenced by execCommand().

◆ execSetCommand()

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

◆ run()

void SoDa::USRPRX::run ( )
virtual

◆ set3rdLOFreq()

void SoDa::USRPRX::set3rdLOFreq ( double  IF_tuning)
private

◆ startStream()

void SoDa::USRPRX::startStream ( )
private

Definition at line 224 of file USRPRX.cxx.

References audio_rx_stream_enabled, and usrp.

Referenced by execSetCommand().

◆ stopStream()

void SoDa::USRPRX::stopStream ( )
private

Definition at line 233 of file USRPRX.cxx.

References audio_rx_stream_enabled, and usrp.

Referenced by execSetCommand(), and run().

Member Data Documentation

◆ audio_rx_stream_enabled

bool SoDa::USRPRX::audio_rx_stream_enabled
private

Definition at line 99 of file USRPRX.hxx.

Referenced by run(), startStream(), stopStream(), and USRPRX().

◆ cmd_stream

CmdMBox* SoDa::USRPRX::cmd_stream
private

Definition at line 89 of file USRPRX.hxx.

Referenced by run(), and USRPRX().

◆ cmd_subs

unsigned int SoDa::USRPRX::cmd_subs
private

Definition at line 90 of file USRPRX.hxx.

Referenced by run(), and USRPRX().

◆ current_IF_tuning

double SoDa::USRPRX::current_IF_tuning
private

Definition at line 108 of file USRPRX.hxx.

Referenced by execSetCommand().

◆ enable_spectrum_report

bool SoDa::USRPRX::enable_spectrum_report
private

Definition at line 112 of file USRPRX.hxx.

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

◆ if_dumpfile

std::ofstream SoDa::USRPRX::if_dumpfile
private

Definition at line 119 of file USRPRX.hxx.

Referenced by USRPRX().

◆ IF_osc

QuadratureOscillator SoDa::USRPRX::IF_osc
private

Definition at line 107 of file USRPRX.hxx.

Referenced by doMixer(), and set3rdLOFreq().

◆ if_stream

DatMBox* SoDa::USRPRX::if_stream
private

Definition at line 88 of file USRPRX.hxx.

Referenced by run(), and USRPRX().

◆ outf

int SoDa::USRPRX::outf[2]
private

Definition at line 115 of file USRPRX.hxx.

◆ rf_dumpfile

std::ofstream SoDa::USRPRX::rf_dumpfile
private

Definition at line 118 of file USRPRX.hxx.

Referenced by USRPRX().

◆ rx_bits

uhd::rx_streamer::sptr SoDa::USRPRX::rx_bits
private

Definition at line 93 of file USRPRX.hxx.

Referenced by run(), and USRPRX().

◆ rx_buffer_size

unsigned int SoDa::USRPRX::rx_buffer_size
private

Definition at line 96 of file USRPRX.hxx.

Referenced by run(), and USRPRX().

◆ rx_modulation

SoDa::Command::ModulationType SoDa::USRPRX::rx_modulation
private

Definition at line 101 of file USRPRX.hxx.

Referenced by execSetCommand(), and USRPRX().

◆ rx_sample_rate

double SoDa::USRPRX::rx_sample_rate
private

Definition at line 109 of file USRPRX.hxx.

Referenced by set3rdLOFreq(), and USRPRX().

◆ rx_stream

DatMBox* SoDa::USRPRX::rx_stream
private

Definition at line 87 of file USRPRX.hxx.

Referenced by run(), and USRPRX().

◆ scount

int SoDa::USRPRX::scount
private

Definition at line 116 of file USRPRX.hxx.

Referenced by run(), and USRPRX().

◆ ui

UI* SoDa::USRPRX::ui
private

Definition at line 104 of file USRPRX.hxx.

Referenced by USRPRX().

◆ usrp

uhd::usrp::multi_usrp::sptr SoDa::USRPRX::usrp
private

Definition at line 94 of file USRPRX.hxx.

Referenced by startStream(), stopStream(), and USRPRX().


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