29 #ifndef BASEBANDRX_HDR 30 #define BASEBANDRX_HDR 42 #include <boost/thread.hpp> 43 #include <boost/thread/thread.hpp> 44 #include <boost/thread/mutex.hpp> 45 #include <boost/thread/condition.hpp> 262 std::map<SoDa::Command::AudioFilterBW, SoDa::OSFilter *>
filter_map;
The Baseclass for all SoDa objects, and useful commonly used classes.
The Thread baseclass for all SoDa thread objects.
This is an overlap-and-save frequency domain implementation of a general FIR filter widget...
unsigned int rf_buffer_size
size of input RF buffer chunk
void demodulateSSB(std::complex< float > *drxbuf, SoDa::Command::ModulationType mod)
demodulate the input stream as an SSB signal place the resulting audio buffer on the audio output que...
SoDa::OSFilter * am_audio_filter
After AM demod, we do a second filter.
bool in_fallback
when true, the audio server has gotten ahead...
float af_gain
audio gain setting for RX mode
float * getNextAudioBuffer()
return the next queued audio buffer to pass to the audio output device
void demodulateAM(std::complex< float > *drxbuf)
demodulate the input stream as an amplitude modulated signal place the resulting audio buffer on the ...
Resampler for 625KHz to 48KHz data stream, built on rational ReSampler class.
BaseBandRX(Params *params, DatMBox *rx_stream, CmdMBox *cmd_stream, AudioIfc *audio_ifc)
the constructor
bool audio_rx_stream_enabled
if true, send pending audio buffers to output
This class handles command line parameters and built-ins.
void flushAudioBuffers()
empty the queue of pending audio buffers, we're going into TX mode.
void demodulateWBFM(SoDaBuf *rxbuf, SoDa::Command::ModulationType mod, float af_gain)
demodulate the input stream as a wideband frequency modulated signal place the resulting audio buffer...
SoDa::ReSample625to48 * wbfm_resampler
downsample the RF input to 48KS/s for WBFM unit
void demodulate(SoDaBuf *rxbuf)
apply the currently selected demodulation scheme to the input RX buffer place the resulting audio buf...
bool sidetone_stream_enabled
if true, send CW sidetone to audio output
std::queue< float * > free_buffers
a pool of free audio buffers
SoDa::OSFilter * am_pre_filter
Before AM demod, we do some (6KHz) prefilter.
double audio_sample_rate
sample rate of audio output – assumed 48KHz
SoDa::Command::AudioFilterBW af_filter_selection
currently audio filter selector
This is a list of all the commands that can "do something" to one or more components in the SoDa radi...
MedianFilter3< float > fmMedianFilter
simple 3 point median filter for FM units
boost::mutex free_lock
lock for the free_buffers pool
DatMBox * rx_stream
mailbox producing rx sample stream from USRP
CmdMBox * cmd_stream
mailbox producing command stream from user
AudioFilterBW
these are the possible audio filter bandwidths
ModulationType
modulation selector targets take one of these values
SoDa::OSFilter * fm_audio_filter
audio filter for FM (wider passband)
SoDa::Command::ModulationType rx_modulation
current receive modulation mode (USB,LSB,CW_U,CW_L,NBFM,WBFM,AM,...)
unsigned int audio_buffer_size
size of output audio buffer chunk
SoDa::HilbertTransformer * hilbert
hilbert transform object for SSB/CW widgets
void freeAudioBuffer(float *b)
add an audio buffer to the free list, we've dispatched it.
unsigned int dbg_ctr
debug counter, used to support one-time or infrequent bulletins
SoDa::OSFilter * nbfm_pre_filter
Before NBFM demod, we do some (15KHz) prefilter – rf rate.
void demodulateNBFM(std::complex< float > *drxbuf, SoDa::Command::ModulationType mod, float af_gain)
demodulate the input stream as a narrowband frequency modulated signal place the resulting audio buff...
void buildFilterMap()
build the audio filter map for selected bandwidths
boost::mutex ready_lock
lock for the ready_buffers_pool
unsigned int cmd_subs
mailbox subscription ID for command stream
double rf_sample_rate
sample rate of RF input from USRP – assumed 625KHz
void execGetCommand(Command *cmd)
execute GET commands from the command channel
int readyAudioBuffers()
return number audio buffers available
BaseBandRX – this is the audio processing chain for the recieve path.
Overlap-and-save filter class.
SoDa::OSFilter * cur_audio_filter
currently selected audio filter
std::map< SoDa::Command::AudioFilterBW, SoDa::OSFilter * > filter_map
map filter selectors to the filter objects
AudioIfc * audio_ifc
pointer to the audio interface (output) object
void execSetCommand(Command *cmd)
handle SET commands from the command channel
SoDa::ReSample625to48 * rf_resampler
downsample the RF input to 48KS/s
void pendAudioBuffer(float *b)
put an audio buffer on the "pending for output" list
Generic Audio Interface Class.
std::ofstream audio_file2
float af_sidetone_gain
audio gain setting for TX/CW mode
void repAFFilterShape()
send a report of the lower and upper edges of the IF passband based on the current filter and modulat...
bool in_catchup
when true, the audio server has fallen behind...
float * getFreeAudioBuffer()
remove a buffer from the free list, or allocate one if the free list is empty.
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.
unsigned int catchup_rand_mask
a mask to use for fast selection of a random index into an audio buffer.
std::queue< float * > ready_buffers
a list of audio buffers ready to send to the output
unsigned int rx_subs
mailbox subscription ID for rx data stream
void run()
the run method – does the work of the audio receiver process
bool audio_rx_stream_needs_start
if true, the audio output device needs a wakeup
void execRepCommand(Command *cmd)
handle Report commands from the command channel
float * sidetone_silence
a sequence of zero samples to stuff silence into the audio