50#include <SoDa/ReSampler.hxx>
71 auto ret = std::shared_ptr<RTLSDRRX>(
new RTLSDRRX(dev_in,
params));
73 ret->registerThread(ret);
88 void doMixer(std::vector<std::complex<float>> & buf);
93 static constexpr float HW_RATE = 2048000.0f;
114 std::vector<std::complex<float>>
rs_in;
116 std::vector<std::complex<float>>
accu;
Shared RAII wrapper for an rtlsdr_dev_t handle.
Thread class that provides the common IF receive functions for any supported radio (USRP/Adalm/Pluto/...
sin/cos oscillator to drive TX signal chain
unsigned int diag_resamp_runs
total resampler invocations
bool if_streaming_enabled
void startStream() override
flush the input rx data stream and set the stream_processing flag to on.
std::atomic< unsigned int > diag_reads
async callback invocations
std::vector< std::complex< float > > rs_in
exact-size input to resampler (rs_in_size)
std::thread async_rx_thread
static constexpr unsigned int READ_BYTES
unsigned int rf_buf_size
publish chunk size (30000 samples at 625 kSPS)
void doMixer(std::vector< std::complex< float > > &buf)
std::weak_ptr< RTLSDRRX > self
static constexpr float HW_RATE
void stopStream() override
flush the input rx data stream and set the stream_processing flag to off
double rx_sample_rate
625 kSPS — used for IF NCO phase increment
std::vector< std::complex< float > > rs_out
resampler output (rs_out_size)
void init() override
perform initialization.
static void asyncCallback(unsigned char *buf, uint32_t len, void *ctx)
static constexpr unsigned int RAW_ACCU_MAX
QuadratureOscillator IF_osc
std::vector< std::complex< float > > raw_accu
IQ accumulator filled by async callback.
unsigned int rs_out_size
resampler output size (at 625 kSPS)
bool downConvert() override
A receiver must accept input data from the rx_stream and beat it against its NCO to produce output on...
std::mutex raw_accu_mutex
std::atomic< bool > streaming
SoDa::ReSamplerPtr hw_resampler
2.048 MSPS → 625 kSPS
bool streamEnabled() override
test the processing stream flag
unsigned int diag_published
total rf_buf_size blocks published
unsigned int rs_in_size
exact resampler input size (at 2.048 MSPS)
void setNCOFreq(double freq) override
Methods that ALL radios must implement.
static RTLSDRRXPtr make(RTLSDRDevPtr dev_in, ParamsPtr params)
RTLSDRRX(RTLSDRDevPtr dev_in, ParamsPtr params)
void enableIFStreamer(bool enable) override
Enable IF streamer - This passes the incoming RF sample buffer onto the IF stream where it can be con...
std::vector< std::complex< float > > accu
accumulates resampled IQ for rf_buf_size publish
RadioRX(ParamsPtr params)
Constructor Build a RadioRX thread.
std::shared_ptr< RTLSDRDev > RTLSDRDevPtr
std::shared_ptr< Params > ParamsPtr
std::shared_ptr< RTLSDRRX > RTLSDRRXPtr