35 #include <sys/types.h> 90 float rfl = ((float) random()) / ((
float) RAND_MAX);
101 srate, audio_buffer_size);
113 bool exitflag =
false;
157 float * audio_tx_buffer = audio_buf;
173 audio_tx_buffer = audio_buf;
209 if(is_usb || is_lsb) {
253 if(fabs(audio_amp) > 1.0) {
254 audio_amp = (audio_amp > 0.0) ? 1.0 : -1.0;
334 debugMsg(
"TX Audio IN is NOISE.\n");
344 debugMsg(
"TX Audio filter is enabled.\n");
348 debugMsg(
"TX Audio filter is disabled.\n");
double wbfm_deviation
phase advance for 75kHz deviation
bool debug_mode
if true, print extra debug info
SoDa::SoDaBuf * modulateAM(float *audio_buf, unsigned int len, bool is_usb, bool is_lsb)
create an AM/SSB modulation envelope
Enable the TX audio bandpass filter (limit to 2.5 kHz) for SSB/AM/FM.
The Thread baseclass for all SoDa thread objects.
This is an overlap-and-save frequency domain implementation of a general FIR filter widget...
bool cw_tx_mode
if true, tx_mode is CW_L or CW_U
void debugMsg(const std::string &msg, unsigned int threshold=1)
turn transmitter on and off.
bool tx_noise_source_ena
When this is TRUE, audio modes (USB,LSB,AM,NBFM,WBFM) use a noise source for input.
T * get(unsigned int subscriber_id)
double fm_mic_gain
separate gain control for FM deviation....
int iparms[4]
integer parameters
double getAudioSampleRate() const
Set the modulation mode for the transmit chain.
float af_gain
local microphone gain.
This class handles command line parameters and built-ins.
The SoDa Exception class.
BaseBandTX(Params *params, DatMBox *tx_stream, CmdMBox *cmd_stream, AudioIfc *audio_ifc)
constructor
CmdTarget target
the thing we're touching
AudioIfc * audio_ifc
pointer to an AudioIfc object for the microphone input
unsigned int getRFBufferSize() const
void execSetCommand(Command *cmd)
handle SET commands from the command channel
On receipt of a STOP command, all threads should exit their run loop.
unsigned int tx_buffer_size
how long is the outbound RF buffer
Resampler for 48KHz to 625KHz data stream, built on rational ReSampler class.
std::complex< float > * getComplexBuf()
Return a pointer to the storage buffer of complex floats.
virtual int recv(void *buf, unsigned int len, bool block=true)=0
recv – get a buffer of data from the audio input
This is a list of all the commands that can "do something" to one or more components in the SoDa radi...
virtual bool recvBufferReady(unsigned int len)=0
recvBufferReady – is there enough space in the audio device recv buffer for a call from recv...
unsigned int getAFBufferSize() const
SoDa::OSFilter * tx_audio_filter
TX audio filter.
ModulationType
modulation selector targets take one of these values
bool tx_stream_on
if true, we are transmitting.
DatMBox * tx_stream
outbound RF stream to USRPTX transmit chain
SoDa::ReSample48to625 * interpolator
Upsample from 48KHz to 625KHz.
SoDa::SoDaBuf * modulateFM(float *audio_buf, unsigned int len, double deviation)
create a narrowband/wideband FM modulation envelope
void run()
the run method – does the work of the audio transmitter process
std::complex< float > * audio_IQ_buf
temporary storage for outbound modulation envelope
unsigned int audio_buffer_size
length (in samples) of an input audio buffer
void apply(std::complex< float > *in, std::complex< float > *out)
Perform the resampling on a complex float buffer.
double dparms[4]
double float parameters
unsigned int getComplexLen()
Return the number of complex float values in this buffer.
Overlap-and-save filter class.
void execGetCommand(Command *cmd)
execute GET commands from the command channel
double nbfm_deviation
phase advance for 2.5kHz deviation.
Generic Audio Interface Class.
unsigned int apply(std::complex< float > *inbuf, std::complex< float > *outbuf, float outgain=1.0)
run the filter on a complex input stream
CmdMBox * cmd_stream
command stream from UI and other units
float mic_gain
mic gain is adjustable, to make sure we aren't noxious.
SoDa::Command::ModulationType tx_mode
what modulation scheme? USB? LSB? CW_U?...
unsigned int cmd_subs
subscription ID for command stream
SoDa::HilbertTransformer * hilbert
The hilbert transformer to create an analytic (I/Q) signal.
bool tx_on
set by Command::TX_STATE to on or off
void execRepCommand(Command *cmd)
handle Report commands from the command channel
bool tx_audio_filter_ena
There is an audio filter in the chain, by default.
virtual void wakeIn()=0
start the input stream
float * noise_buffer
This is a buffer that holds a set of "noise" samples (uniform random) for testing the TX audio chain...
void execCommand(Command *cmd)
Execute (dispatch) a message removed from the command stream to one of the basic Command handler func...
Select the transmit chain audio input (for SSB, AM, and FM)