![]() |
SoDaRadio-12.2.0-cut_dependencies:6c82803
|
#include <BaseBandRX.hxx>
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 receiver 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 BaseBandRXPtr | make (ParamsPtr params, AudioIfcPtr audio_ifc) |
| the maker – produces a shared pointer p | |
| 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 () |
Private Member Functions | |
| BaseBandRX (ParamsPtr params, AudioIfcPtr audio_ifc) | |
| the constructor | |
| void | reportModes () |
| report all demod modes supported. | |
| void | reportAFFilters () |
| report all filters supported. | |
| 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 | |
| void | demodulateSSB (SoDa::CBufPtr drxbuf, SoDa::Command::ModulationType mod) |
| demodulate the input stream as an SSB signal place the resulting audio buffer on the audio output queue. | |
| void | demodulateAM (SoDa::CBufPtr drxbuf) |
| demodulate the input stream as an amplitude modulated signal place the resulting audio buffer on the audio output queue. | |
| void | demodulateNBFM (SoDa::CBufPtr drxbuf, SoDa::Command::ModulationType mod, float af_gain) |
| demodulate the input stream as a narrowband frequency modulated signal place the resulting audio buffer on the audio output queue. | |
| void | demodulateWBFM (SoDa::CBufPtr rxbuf, SoDa::Command::ModulationType mod, float af_gain) |
| demodulate the input stream as a wideband frequency modulated signal place the resulting audio buffer on the audio output queue. | |
| void | demodulate (SoDa::CBufPtr rxbuf) |
| apply the currently selected demodulation scheme to the input RX buffer place the resulting audio buffer on the audio output queue. | |
| void | repAFFilterShape () |
| send a report of the lower and upper edges of the IF passband based on the current filter and modulation type. | |
| void | pendAudioBuffer (SoDa::FBufPtr b) |
| put an audio buffer on the "pending for output" list | |
| void | pendNullBuffer (int count=1) |
| put an empty (zero signal) audio buffer on the pending for output list | |
| float * | getNextAudioBuffer () |
| return the next queued audio buffer to pass to the audio output device | |
| void | flushAudioBuffers () |
| empty the queue of pending audio buffers, we're going into TX mode. | |
| void | buildFilterMap () |
| build the audio filter map for selected bandwidths | |
Private Attributes | |
| unsigned int | audio_buffer_size |
| size of output audio buffer chunk | |
| unsigned int | rf_buffer_size |
| size of input RF buffer chunk | |
| double | audio_sample_rate |
| sample rate of audio output – assumed 48KHz | |
| double | rf_sample_rate |
| sample rate of RF input from USRP – assumed 625KHz | |
| bool | audio_rx_stream_enabled |
| if true, send pending audio buffers to output | |
| bool | audio_rx_stream_needs_start |
| if true, the audio output device needs a wakeup | |
| bool | sidetone_stream_enabled |
| if true, send CW sidetone to audio output | |
| SoDa::Command::ModulationType | rx_modulation |
| current receive modulation mode (USB,LSB,CW_U,CW_L,NBFM,WBFM,AM,...) | |
| CDatMBoxPtr | rx_stream |
| mailbox producing rx sample stream from USRP | |
| CmdMBoxPtr | cmd_stream |
| mailbox producing command stream from user | |
| CDatMBox::Subscription | rx_subs |
| mailbox subscription ID for rx data stream | |
| CmdMBox::Subscription | cmd_subs |
| mailbox subscription ID for command stream | |
| AudioIfcPtr | audio_ifc |
| pointer to the audio interface (output) object | |
| bool | in_catchup |
| when true, the audio server has fallen behind... | |
| bool | in_fallback |
| when true, the audio server has gotten ahead... | |
| unsigned int | catchup_rand_mask |
| a mask to use for fast selection of a random index into an audio buffer. | |
| SoDa::FBufPtr | sidetone_silence |
| a sequence of zero samples to stuff silence into the audio | |
| SoDa::ReSamplerPtr | rf_resampler |
| downsample the RF input to 48KS/s | |
| SoDa::ReSamplerPtr | wbfm_resampler |
| downsample the RF input to 48KS/s for WBFM unit | |
| SoDa::Command::AudioFilterBW | af_filter_selection |
| currently audio filter selector | |
| SoDa::OSFilterPtr | cur_audio_filter |
| currently selected audio filter | |
| SoDa::OSFilterPtr | fm_audio_filter |
| audio filter for FM (wider passband) | |
| SoDa::OSFilterPtr | am_pre_filter |
| Before AM demod, we do some (6KHz) prefilter. | |
| SoDa::OSFilterPtr | nbfm_pre_filter |
| Before NBFM demod, we do some (15KHz) prefilter – rf rate. | |
| SoDa::OSFilterPtr | am_audio_filter |
| After AM demod, we do a second filter. | |
| std::map< SoDa::Command::AudioFilterBW, SoDa::OSFilterPtr > | filter_map |
| map filter selectors to the filter objects | |
| SoDa::HilbertTransformerPtr | hilbert |
| hilbert transform object for SSB/CW widgets | |
| float | af_gain |
| audio gain setting for RX mode | |
| float | af_sidetone_gain |
| audio gain setting for TX/CW mode | |
| float * | cur_af_gain |
| pointer to the gain setting for this mode | |
| float | last_phase_samp |
| history value used to calculate dPhase/dt in FM atan based discriminator. | |
| MedianFilter3< float > | fmMedianFilter |
| simple 3 point median filter for FM units | |
| unsigned int | dbg_ctr |
| debug counter, used to support one-time or infrequent bulletins | |
| std::ofstream | dbg_out |
| bool | audio_save_enable |
| std::ofstream | audio_file |
| std::ofstream | audio_file2 |
| float | audio_level |
| float | log_audio_buffer_size |
| float | nbfm_squelch_level |
| average amplitude must be greater to trigger demod. | |
| int | nbfm_squelch_hang_count |
| if > 0 then send audio. | |
| int | nbfm_squelch_hang_time |
| continue FM audio demod for this many frames after threshold drops | |
Additional Inherited Members | |
| Static Public Attributes inherited from SoDa::Debug | |
| static std::mutex | debug_msg_mutex |
| 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 () |
| Protected Attributes inherited from SoDa::Thread | |
| std::weak_ptr< Thread > | self |
| 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 |
Definition at line 84 of file BaseBandRX.hxx.
|
private |
|
private |
build the audio filter map for selected bandwidths
|
private |
apply the currently selected demodulation scheme to the input RX buffer place the resulting audio buffer on the audio output queue.
| rxbuf | RF input buffer |
|
private |
demodulate the input stream as an amplitude modulated signal place the resulting audio buffer on the audio output queue.
| drxbuf | downsampled RF input buffer |
|
private |
demodulate the input stream as a narrowband frequency modulated signal place the resulting audio buffer on the audio output queue.
| drxbuf | downsampled RF input buffer |
| mod | modulation type – NBFM |
| af_gain | factor to goose the audio output |
References af_gain.
|
private |
demodulate the input stream as an SSB signal place the resulting audio buffer on the audio output queue.
| drxbuf | downsampled RF input buffer |
| mod | modulation type – LSB, USB, CW_U, or CW_R |
|
private |
demodulate the input stream as a wideband frequency modulated signal place the resulting audio buffer on the audio output queue.
Note the wideband FM unit takes the raw RX buffer rather than the downsampled rx buffer.
| rxbuf | RF input buffer |
| mod | modulation type – WBFM |
| af_gain | factor to goose the audio output |
References af_gain.
|
privatevirtual |
execute GET commands from the command channel
| cmd | the incoming command |
Reimplemented from SoDa::Thread.
|
privatevirtual |
handle Report commands from the command channel
| cmd | the incoming command |
Reimplemented from SoDa::Thread.
|
privatevirtual |
handle SET commands from the command channel
| cmd | the incoming command |
Reimplemented from SoDa::Thread.
|
private |
empty the queue of pending audio buffers, we're going into TX mode.
|
private |
return the next queued audio buffer to pass to the audio output device
|
inlinestatic |
the maker – produces a shared pointer p
| params | command line parameter object |
| audio_ifc | pointer to the audio output handler |
Definition at line 103 of file BaseBandRX.hxx.
References BaseBandRX(), and audio_ifc.
|
private |
put an audio buffer on the "pending for output" list
| b | pointer to an audio buffer |
|
private |
put an empty (zero signal) audio buffer on the pending for output list
| count | number of buffers to pend onto the list. |
|
private |
send a report of the lower and upper edges of the IF passband based on the current filter and modulation type.
|
private |
report all filters supported.
|
private |
report all demod modes supported.
|
virtual |
the run method – does the work of the audio receiver process
Reimplemented from SoDa::Thread.
|
virtual |
implement the subscription method
Implements SoDa::Thread.
|
private |
currently audio filter selector
Definition at line 271 of file BaseBandRX.hxx.
|
private |
audio gain setting for RX mode
Definition at line 284 of file BaseBandRX.hxx.
Referenced by demodulateNBFM(), and demodulateWBFM().
|
private |
audio gain setting for TX/CW mode
Definition at line 285 of file BaseBandRX.hxx.
|
private |
After AM demod, we do a second filter.
Definition at line 276 of file BaseBandRX.hxx.
|
private |
Before AM demod, we do some (6KHz) prefilter.
Definition at line 274 of file BaseBandRX.hxx.
|
private |
size of output audio buffer chunk
Definition at line 209 of file BaseBandRX.hxx.
|
private |
Definition at line 300 of file BaseBandRX.hxx.
|
private |
Definition at line 301 of file BaseBandRX.hxx.
|
private |
pointer to the audio interface (output) object
Definition at line 224 of file BaseBandRX.hxx.
Referenced by BaseBandRX(), and make().
|
private |
Definition at line 304 of file BaseBandRX.hxx.
|
private |
if true, send pending audio buffers to output
Definition at line 213 of file BaseBandRX.hxx.
|
private |
if true, the audio output device needs a wakeup
Definition at line 214 of file BaseBandRX.hxx.
|
private |
sample rate of audio output – assumed 48KHz
Definition at line 211 of file BaseBandRX.hxx.
|
private |
Definition at line 299 of file BaseBandRX.hxx.
|
private |
a mask to use for fast selection of a random index into an audio buffer.
Definition at line 257 of file BaseBandRX.hxx.
|
private |
mailbox producing command stream from user
Definition at line 220 of file BaseBandRX.hxx.
|
private |
mailbox subscription ID for command stream
Definition at line 222 of file BaseBandRX.hxx.
|
private |
pointer to the gain setting for this mode
Definition at line 286 of file BaseBandRX.hxx.
|
private |
currently selected audio filter
Definition at line 272 of file BaseBandRX.hxx.
|
private |
debug counter, used to support one-time or infrequent bulletins
Definition at line 295 of file BaseBandRX.hxx.
|
private |
Definition at line 296 of file BaseBandRX.hxx.
|
private |
map filter selectors to the filter objects
Definition at line 278 of file BaseBandRX.hxx.
|
private |
audio filter for FM (wider passband)
Definition at line 273 of file BaseBandRX.hxx.
|
private |
simple 3 point median filter for FM units
Definition at line 292 of file BaseBandRX.hxx.
|
private |
hilbert transform object for SSB/CW widgets
Definition at line 281 of file BaseBandRX.hxx.
|
private |
when true, the audio server has fallen behind...
Definition at line 255 of file BaseBandRX.hxx.
|
private |
when true, the audio server has gotten ahead...
Definition at line 256 of file BaseBandRX.hxx.
|
private |
history value used to calculate dPhase/dt in FM atan based discriminator.
Definition at line 289 of file BaseBandRX.hxx.
|
private |
Definition at line 305 of file BaseBandRX.hxx.
|
private |
Before NBFM demod, we do some (15KHz) prefilter – rf rate.
Definition at line 275 of file BaseBandRX.hxx.
|
private |
if > 0 then send audio.
Definition at line 308 of file BaseBandRX.hxx.
|
private |
continue FM audio demod for this many frames after threshold drops
Definition at line 309 of file BaseBandRX.hxx.
|
private |
average amplitude must be greater to trigger demod.
Definition at line 307 of file BaseBandRX.hxx.
|
private |
size of input RF buffer chunk
Definition at line 210 of file BaseBandRX.hxx.
|
private |
downsample the RF input to 48KS/s
Definition at line 262 of file BaseBandRX.hxx.
|
private |
sample rate of RF input from USRP – assumed 625KHz
Definition at line 212 of file BaseBandRX.hxx.
|
private |
current receive modulation mode (USB,LSB,CW_U,CW_L,NBFM,WBFM,AM,...)
Definition at line 217 of file BaseBandRX.hxx.
|
private |
mailbox producing rx sample stream from USRP
Definition at line 219 of file BaseBandRX.hxx.
|
private |
mailbox subscription ID for rx data stream
Definition at line 221 of file BaseBandRX.hxx.
|
private |
a sequence of zero samples to stuff silence into the audio
Definition at line 259 of file BaseBandRX.hxx.
|
private |
if true, send CW sidetone to audio output
Definition at line 215 of file BaseBandRX.hxx.
|
private |
downsample the RF input to 48KS/s for WBFM unit
Definition at line 264 of file BaseBandRX.hxx.