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

#include <BaseBandTX.hxx>

Inheritance diagram for SoDa::BaseBandTX:
SoDa::Thread SoDa::Base SoDa::Debug

Public Member Functions

void subscribeToMailBoxes (const std::vector< MailBoxBasePtr > &mailboxes)
 implement the subscription method
void run ()
 the run method – does the work of the audio transmitter process
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 BaseBandTXPtr make (ParamsPtr params, AudioIfcPtr audio_ifc)
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

 BaseBandTX (ParamsPtr params, AudioIfcPtr audio_ifc)
 constructor
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 execGetCommand (CommandPtr cmd)
 execute GET commands from the command channel
void execSetCommand (CommandPtr cmd)
 handle SET commands from the command channel
void execRepCommand (CommandPtr cmd)
 handle Report commands from the command channel
SoDa::CBufPtr modulateAM (std::vector< float > &audio_buf, bool is_usb, bool is_lsb)
 create an AM/SSB modulation envelope
SoDa::CBufPtr modulateFM (std::vector< float > &audio_buf, double deviation)
 create a narrowband/wideband FM modulation envelope

Private Attributes

double fm_phase
double nbfm_deviation
 phase advance for 2.5kHz deviation.
double wbfm_deviation
 phase advance for 75kHz deviation
double fm_mic_gain
 separate gain control for FM deviation....
CDatMBoxPtr tx_stream
 outbound RF stream to USRPTX transmit chain
CmdMBoxPtr cmd_stream
 command stream from UI and other units
CmdMBox::Subscription cmd_subs
 subscription ID for command stream
SoDa::ReSamplerPtr interpolator
 Upsample from 48KHz to 625KHz.
unsigned int audio_buffer_size
 length (in samples) of an input audio buffer
double audio_sample_rate
 wired in lots of places as 48KHz
unsigned int tx_buffer_size
 how long is the outbound RF buffer
SoDa::Command::ModulationType tx_mode
 what modulation scheme? USB? LSB? CW_U?...
bool cw_tx_mode
 if true, tx_mode is CW_L or CW_U
bool tx_on
 set by Command::TX_STATE to on or off
float af_gain
 local microphone gain.
AudioIfcPtr audio_ifc
 pointer to an AudioIfc object for the microphone input
bool tx_stream_on
 if true, we are transmitting.
std::vector< std::complex< float > > audio_IQ_buf
 temporary storage for outbound modulation envelope
std::vector< float > noise_buffer
 This is a buffer that holds a set of "noise" samples (uniform random) for testing the TX audio chain.
bool tx_noise_source_ena
 When this is TRUE, audio modes (USB,LSB,AM,NBFM,WBFM) use a noise source for input.
bool tx_audio_filter_ena
 There is an audio filter in the chain, by default.
SoDa::OSFilterPtr tx_audio_filter
 TX audio filter.
SoDa::HilbertTransformerPtr hilbert
 The hilbert transformer to create an analytic (I/Q) signal.
float mic_gain
 mic gain is adjustable, to make sure we aren't noxious.
bool debug_mode
 if true, print extra debug info
int debug_ctr

Additional Inherited Members

Static Public Attributes inherited from SoDa::Debug
static std::mutex debug_msg_mutex
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

Definition at line 60 of file BaseBandTX.hxx.

Constructor & Destructor Documentation

◆ BaseBandTX()

SoDa::BaseBandTX::BaseBandTX ( ParamsPtr params,
AudioIfcPtr audio_ifc )
protected

constructor

Parameters
paramscommand line parameter object
audio_ifcpointer to the audio output handler

References audio_ifc.

Referenced by make().

Member Function Documentation

◆ execGetCommand()

void SoDa::BaseBandTX::execGetCommand ( CommandPtr cmd)
privatevirtual

execute GET commands from the command channel

Parameters
cmdthe incoming command

Reimplemented from SoDa::Thread.

◆ execRepCommand()

void SoDa::BaseBandTX::execRepCommand ( CommandPtr cmd)
privatevirtual

handle Report commands from the command channel

Parameters
cmdthe incoming command

Reimplemented from SoDa::Thread.

◆ execSetCommand()

void SoDa::BaseBandTX::execSetCommand ( CommandPtr cmd)
privatevirtual

handle SET commands from the command channel

Parameters
cmdthe incoming command

Reimplemented from SoDa::Thread.

◆ make()

BaseBandTXPtr SoDa::BaseBandTX::make ( ParamsPtr params,
AudioIfcPtr audio_ifc )
inlinestatic

Definition at line 73 of file BaseBandTX.hxx.

References BaseBandTX(), and audio_ifc.

◆ modulateAM()

SoDa::CBufPtr SoDa::BaseBandTX::modulateAM ( std::vector< float > & audio_buf,
bool is_usb,
bool is_lsb )
private

create an AM/SSB modulation envelope

Parameters
audio_bufthe buffer of modulating audio info
is_usbif true, generate upper sideband
is_lsbif true, generate lower sideband if both is_usb and is_lsb are false, the modulator creates an IQ stream that is amplitude modulated

◆ modulateFM()

SoDa::CBufPtr SoDa::BaseBandTX::modulateFM ( std::vector< float > & audio_buf,
double deviation )
private

create a narrowband/wideband FM modulation envelope

Parameters
audio_bufthe buffer of modulating audio info
deviationthe phase shift per audio sample for a maximum amplitude (1.0) input.

Note that this modulator varies the mic gain to prevent over-deviation.

◆ run()

void SoDa::BaseBandTX::run ( )
virtual

the run method – does the work of the audio transmitter process

Reimplemented from SoDa::Thread.

◆ subscribeToMailBoxes()

void SoDa::BaseBandTX::subscribeToMailBoxes ( const std::vector< MailBoxBasePtr > & mailboxes)
virtual

implement the subscription method

Implements SoDa::Thread.

Member Data Documentation

◆ af_gain

float SoDa::BaseBandTX::af_gain
private

local microphone gain.

Definition at line 152 of file BaseBandTX.hxx.

◆ audio_buffer_size

unsigned int SoDa::BaseBandTX::audio_buffer_size
private

length (in samples) of an input audio buffer

Definition at line 143 of file BaseBandTX.hxx.

◆ audio_ifc

AudioIfcPtr SoDa::BaseBandTX::audio_ifc
private

pointer to an AudioIfc object for the microphone input

Definition at line 155 of file BaseBandTX.hxx.

Referenced by BaseBandTX(), and make().

◆ audio_IQ_buf

std::vector<std::complex<float> > SoDa::BaseBandTX::audio_IQ_buf
private

temporary storage for outbound modulation envelope

Definition at line 161 of file BaseBandTX.hxx.

◆ audio_sample_rate

double SoDa::BaseBandTX::audio_sample_rate
private

wired in lots of places as 48KHz

Definition at line 144 of file BaseBandTX.hxx.

◆ cmd_stream

CmdMBoxPtr SoDa::BaseBandTX::cmd_stream
private

command stream from UI and other units

Definition at line 136 of file BaseBandTX.hxx.

◆ cmd_subs

CmdMBox::Subscription SoDa::BaseBandTX::cmd_subs
private

subscription ID for command stream

Definition at line 137 of file BaseBandTX.hxx.

◆ cw_tx_mode

bool SoDa::BaseBandTX::cw_tx_mode
private

if true, tx_mode is CW_L or CW_U

Definition at line 148 of file BaseBandTX.hxx.

◆ debug_ctr

int SoDa::BaseBandTX::debug_ctr
private

Definition at line 196 of file BaseBandTX.hxx.

◆ debug_mode

bool SoDa::BaseBandTX::debug_mode
private

if true, print extra debug info

Definition at line 195 of file BaseBandTX.hxx.

◆ fm_mic_gain

double SoDa::BaseBandTX::fm_mic_gain
private

separate gain control for FM deviation....

Definition at line 132 of file BaseBandTX.hxx.

◆ fm_phase

double SoDa::BaseBandTX::fm_phase
private

Definition at line 129 of file BaseBandTX.hxx.

◆ hilbert

SoDa::HilbertTransformerPtr SoDa::BaseBandTX::hilbert
private

The hilbert transformer to create an analytic (I/Q) signal.

Definition at line 188 of file BaseBandTX.hxx.

◆ interpolator

SoDa::ReSamplerPtr SoDa::BaseBandTX::interpolator
private

Upsample from 48KHz to 625KHz.

Definition at line 140 of file BaseBandTX.hxx.

◆ mic_gain

float SoDa::BaseBandTX::mic_gain
private

mic gain is adjustable, to make sure we aren't noxious.

Definition at line 193 of file BaseBandTX.hxx.

◆ nbfm_deviation

double SoDa::BaseBandTX::nbfm_deviation
private

phase advance for 2.5kHz deviation.

Definition at line 130 of file BaseBandTX.hxx.

◆ noise_buffer

std::vector<float> SoDa::BaseBandTX::noise_buffer
private

This is a buffer that holds a set of "noise" samples (uniform random) for testing the TX audio chain.

Definition at line 167 of file BaseBandTX.hxx.

◆ tx_audio_filter

SoDa::OSFilterPtr SoDa::BaseBandTX::tx_audio_filter
private

TX audio filter.

Definition at line 183 of file BaseBandTX.hxx.

◆ tx_audio_filter_ena

bool SoDa::BaseBandTX::tx_audio_filter_ena
private

There is an audio filter in the chain, by default.

This is the enable.

Definition at line 178 of file BaseBandTX.hxx.

◆ tx_buffer_size

unsigned int SoDa::BaseBandTX::tx_buffer_size
private

how long is the outbound RF buffer

Definition at line 145 of file BaseBandTX.hxx.

◆ tx_mode

SoDa::Command::ModulationType SoDa::BaseBandTX::tx_mode
private

what modulation scheme? USB? LSB? CW_U?...

Definition at line 147 of file BaseBandTX.hxx.

◆ tx_noise_source_ena

bool SoDa::BaseBandTX::tx_noise_source_ena
private

When this is TRUE, audio modes (USB,LSB,AM,NBFM,WBFM) use a noise source for input.

Definition at line 173 of file BaseBandTX.hxx.

◆ tx_on

bool SoDa::BaseBandTX::tx_on
private

set by Command::TX_STATE to on or off

Definition at line 149 of file BaseBandTX.hxx.

◆ tx_stream

CDatMBoxPtr SoDa::BaseBandTX::tx_stream
private

outbound RF stream to USRPTX transmit chain

Definition at line 135 of file BaseBandTX.hxx.

◆ tx_stream_on

bool SoDa::BaseBandTX::tx_stream_on
private

if true, we are transmitting.

Definition at line 157 of file BaseBandTX.hxx.

◆ wbfm_deviation

double SoDa::BaseBandTX::wbfm_deviation
private

phase advance for 75kHz deviation

Definition at line 131 of file BaseBandTX.hxx.


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