SoDaRadio-12.2.0-cut_dependencies:6c82803
Loading...
Searching...
No Matches
SoDa::USRPRX Class Reference

The Receive RF Path. More...

#include <USRPRX.hxx>

Inheritance diagram for SoDa::USRPRX:
SoDa::RadioRX SoDa::Thread SoDa::Base SoDa::Debug

Public Member Functions

void setNCOFreq (double freq)
 Set the last LO (convert to baseband) frequency for the NCO.
bool downConvert ()
 A receiver must accept input data from the rx_stream and beat it against its NCO to produce output on its if_stream.
void startStream ()
 flush the input rx data stream and set the stream_processing flag to on.
void stopStream ()
 we never stop a USRP stream until the radio shuts down
void closeStream ()
 stop and close down the USRP input stream
bool streamEnabled ()
 test the processing stream flag
void enableIFStreamer (bool enable)
 Enable IF streamer - This passes the incoming RF sample buffer onto the IF stream where it can be consumed by the periodogram widget or anybody else.
Public Member Functions inherited from SoDa::RadioRX
 RadioRX (ParamsPtr params)
 Constructor Build a RadioRX thread.
void run () final
 start the thread
virtual void init ()
 perform initialization.
Public Member Functions inherited from SoDa::Thread
void registerThread (SoDa::ThreadPtr me)
void operator() ()
void start ()
 Execute the thread's run loop.
void join ()
 more properly "Wait for this thread to exit its run loop".
void execCommand (CommandPtr cmd)
 Execute (dispatch) a message removed from the command stream to one of the basic Command handler functions.
virtual void shutDown ()
 optional method that performs cleanup – may not delete.
void sleep_ms (unsigned int milliseconds)
void sleep_us (unsigned int microseconds)
uint32_t getID ()
 Get the process/thread ID for this thread – helps with figuring out who caused a segfault.
Public Member Functions inherited from SoDa::Base
 Base (const std::string &oname)
 The constructor – pass a name for the object.
void registerSelf (BasePtr ptr)
std::string & getObjName ()
 get the name of this object
BasePtr findSoDaObject (const std::string &oname)
 find a SoDa Object by name.
double getTime ()
 Get a time stamp in nS resolution that monotonically increases and that is very inexpensive (typically < 100nS).
BasePtr getSelfPtr ()
 get a pointer to myself.
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 SoDa::Format &fmt, unsigned int threshold=1)
void debugMsg (const char *msg, unsigned int threshold=1)
void setDebugLevel (unsigned int v)
unsigned int getDebugLevel ()

Static Public Member Functions

static USRPRXPtr make (ParamsPtr params, uhd::usrp::multi_usrp::sptr _usrp)
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 ()

Protected Member Functions

 USRPRX (ParamsPtr params, uhd::usrp::multi_usrp::sptr usrp)
 The constructor.
Protected Member Functions inherited from SoDa::RadioRX
virtual void execGetCommand (CommandPtr cmd) final
 Parse an incoming GET command and dispatch.
virtual void execSetCommand (CommandPtr cmd) final
 Parse an incoming SET command and dispatch.
virtual void execRepCommand (CommandPtr cmd) final
 Parse an incoming REPort command and dispatch.
double getTime ()
 get the number of seconds since the "Epoch"
virtual void subscribeToMailBoxes (const std::vector< MailBoxBasePtr > &mailboxes) final
 SoDa Threads must subscribe to at least the control mailbox.
Protected Member Functions inherited from SoDa::Thread
 Thread (const std::string &oname, const std::string &version=std::string("12.2.0"))
 make the thread object.
Protected Member Functions inherited from SoDa::Debug
std::string curDateTime ()

Private Member Functions

void doMixer (SoDa::CBufPtr inout)
 implement a complex down converter with complex multiplication
void actualStartStream ()
 The USRP never stops the RX streamer once it starts.

Private Attributes

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
std::weak_ptr< USRPRXself
bool needs_resample
SoDa::ReSamplerPtr hw_resampler
std::vector< std::complex< float > > hw_cf
 raw samples at hw rate
std::vector< std::complex< float > > rs_out
 decimated output at 625 kS/s
std::vector< std::complex< float > > accu
 accumulator → rf_buf_size chunks
unsigned int hw_buf_size
 samples per recv at hw rate
unsigned int rs_out_size
 resampler output block size
unsigned int rf_buf_size
 publish chunk (30000 samples at 625 kS/s)

Additional Inherited Members

Static Public Attributes inherited from SoDa::Debug
static std::mutex debug_msg_mutex
Protected Attributes inherited from SoDa::RadioRX
ParamsPtr params
CDatMBoxPtr rx_stream
CDatMBoxPtr if_stream
CmdMBoxPtr cmd_stream
CmdMBox::Subscription cmd_subs
double current_IF_tuning
 current IF NCO frequency
Protected Attributes inherited from SoDa::Thread
std::weak_ptr< Threadself
 A pointer to ourself.
Protected Attributes inherited from SoDa::Debug
std::string unit_name
 the name of the unit reporting status
unsigned int debug_level
 the debug level (threshold) for messages
Static Protected Attributes inherited from SoDa::Debug
static unsigned int default_debug_level
static unsigned int global_debug_level

Detailed Description

The Receive RF Path.

Definition at line 57 of file USRPRX.hxx.

Constructor & Destructor Documentation

◆ USRPRX()

SoDa::USRPRX::USRPRX ( ParamsPtr params,
uhd::usrp::multi_usrp::sptr usrp )
protected

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.

References SoDa::RadioRX::params, and usrp.

Referenced by make().

Member Function Documentation

◆ actualStartStream()

void SoDa::USRPRX::actualStartStream ( )
private

The USRP never stops the RX streamer once it starts.

◆ closeStream()

void SoDa::USRPRX::closeStream ( )

stop and close down the USRP input stream

◆ doMixer()

void SoDa::USRPRX::doMixer ( SoDa::CBufPtr 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

◆ downConvert()

bool SoDa::USRPRX::downConvert ( )
virtual

A receiver must accept input data from the rx_stream and beat it against its NCO to produce output on its if_stream.

If the stream_processing flag is off, any rx_input data will be dumped.

Returns
true if the receiver had input data ready to convert, false otherwise.

Implements SoDa::RadioRX.

◆ enableIFStreamer()

void SoDa::USRPRX::enableIFStreamer ( bool enable)
virtual

Enable IF streamer - This passes the incoming RF sample buffer onto the IF stream where it can be consumed by the periodogram widget or anybody else.

Parameters
enableif true, send RF sample buffer onto if_stream, otherwise, don't.

Implements SoDa::RadioRX.

◆ make()

USRPRXPtr SoDa::USRPRX::make ( ParamsPtr params,
uhd::usrp::multi_usrp::sptr _usrp )
inlinestatic

Definition at line 68 of file USRPRX.hxx.

References USRPRX(), and SoDa::RadioRX::params.

◆ setNCOFreq()

void SoDa::USRPRX::setNCOFreq ( double freq)
virtual

Set the last LO (convert to baseband) frequency for the NCO.

This is called in response to a SET RX_IF_FREQ message from the RadioControl thread.

Parameters
freqLO3 frequency

Implements SoDa::RadioRX.

◆ startStream()

void SoDa::USRPRX::startStream ( )
virtual

flush the input rx data stream and set the stream_processing flag to on.

Implements SoDa::RadioRX.

◆ stopStream()

void SoDa::USRPRX::stopStream ( )
virtual

we never stop a USRP stream until the radio shuts down

Implements SoDa::RadioRX.

◆ streamEnabled()

bool SoDa::USRPRX::streamEnabled ( )
virtual

test the processing stream flag

Returns
true if rx data should be down converted

Implements SoDa::RadioRX.

Member Data Documentation

◆ accu

std::vector<std::complex<float> > SoDa::USRPRX::accu
private

accumulator → rf_buf_size chunks

Definition at line 175 of file USRPRX.hxx.

◆ audio_rx_stream_enabled

bool SoDa::USRPRX::audio_rx_stream_enabled
private

Definition at line 146 of file USRPRX.hxx.

◆ current_IF_tuning

double SoDa::USRPRX::current_IF_tuning
private

Definition at line 155 of file USRPRX.hxx.

◆ enable_spectrum_report

bool SoDa::USRPRX::enable_spectrum_report
private

Definition at line 159 of file USRPRX.hxx.

◆ hw_buf_size

unsigned int SoDa::USRPRX::hw_buf_size
private

samples per recv at hw rate

Definition at line 176 of file USRPRX.hxx.

◆ hw_cf

std::vector<std::complex<float> > SoDa::USRPRX::hw_cf
private

raw samples at hw rate

Definition at line 173 of file USRPRX.hxx.

◆ hw_resampler

SoDa::ReSamplerPtr SoDa::USRPRX::hw_resampler
private

Definition at line 172 of file USRPRX.hxx.

◆ if_dumpfile

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

Definition at line 166 of file USRPRX.hxx.

◆ IF_osc

QuadratureOscillator SoDa::USRPRX::IF_osc
private

Definition at line 154 of file USRPRX.hxx.

◆ needs_resample

bool SoDa::USRPRX::needs_resample
private

Definition at line 171 of file USRPRX.hxx.

◆ outf

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

Definition at line 162 of file USRPRX.hxx.

◆ rf_buf_size

unsigned int SoDa::USRPRX::rf_buf_size
private

publish chunk (30000 samples at 625 kS/s)

Definition at line 178 of file USRPRX.hxx.

◆ rf_dumpfile

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

Definition at line 165 of file USRPRX.hxx.

◆ rs_out

std::vector<std::complex<float> > SoDa::USRPRX::rs_out
private

decimated output at 625 kS/s

Definition at line 174 of file USRPRX.hxx.

◆ rs_out_size

unsigned int SoDa::USRPRX::rs_out_size
private

resampler output block size

Definition at line 177 of file USRPRX.hxx.

◆ rx_bits

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

Definition at line 140 of file USRPRX.hxx.

◆ rx_buffer_size

unsigned int SoDa::USRPRX::rx_buffer_size
private

Definition at line 143 of file USRPRX.hxx.

◆ rx_modulation

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

Definition at line 148 of file USRPRX.hxx.

◆ rx_sample_rate

double SoDa::USRPRX::rx_sample_rate
private

Definition at line 156 of file USRPRX.hxx.

◆ scount

int SoDa::USRPRX::scount
private

Definition at line 163 of file USRPRX.hxx.

◆ self

std::weak_ptr<USRPRX> SoDa::USRPRX::self
private

Definition at line 168 of file USRPRX.hxx.

◆ ui

UI* SoDa::USRPRX::ui
private

Definition at line 151 of file USRPRX.hxx.

◆ usrp

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

Definition at line 141 of file USRPRX.hxx.

Referenced by USRPRX().


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