mirror of
https://github.com/f4exb/sdrangel.git
synced 2026-06-01 21:54:55 -04:00
AirspyHF (float): working plugin
This commit is contained in:
@@ -135,7 +135,7 @@ bool AirspyHFFInput::openDevice()
|
||||
|
||||
delete[] sampleRates;
|
||||
|
||||
airspyhf_set_sample_type(m_dev, AIRSPYHF_SAMPLE_INT16_IQ);
|
||||
airspyhf_set_sample_type(m_dev, AIRSPYHF_SAMPLE_FLOAT32_IQ);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -99,7 +99,7 @@ void AirspyHFFThread::run()
|
||||
}
|
||||
|
||||
// Decimate according to specified log2 (ex: log2=4 => decim=16)
|
||||
void AirspyHFFThread::callback(const qint16* buf, qint32 len)
|
||||
void AirspyHFFThread::callback(const float* buf, qint32 len)
|
||||
{
|
||||
SampleVector::iterator it = m_convertBuffer.begin();
|
||||
|
||||
@@ -136,7 +136,7 @@ void AirspyHFFThread::callback(const qint16* buf, qint32 len)
|
||||
|
||||
int AirspyHFFThread::rx_callback(airspyhf_transfer_t* transfer)
|
||||
{
|
||||
qint32 bytes_to_write = transfer->sample_count * sizeof(qint16);
|
||||
m_this->callback((qint16 *) transfer->samples, bytes_to_write);
|
||||
qint32 nbIAndQ = transfer->sample_count * 2;
|
||||
m_this->callback((float *) transfer->samples, nbIAndQ);
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -23,7 +23,7 @@
|
||||
#include <libairspyhf/airspyhf.h>
|
||||
|
||||
#include "dsp/samplesinkfifo.h"
|
||||
#include "dsp/decimators.h"
|
||||
#include "dsp/decimatorsf.h"
|
||||
|
||||
#define AIRSPYHFF_BLOCKSIZE (1<<17)
|
||||
|
||||
@@ -53,14 +53,10 @@ private:
|
||||
unsigned int m_log2Decim;
|
||||
static AirspyHFFThread *m_this;
|
||||
|
||||
#ifdef SDR_RX_SAMPLE_24BIT
|
||||
Decimators<qint64, qint16, SDR_RX_SAMP_SZ, 16> m_decimators;
|
||||
#else
|
||||
Decimators<qint32, qint16, SDR_RX_SAMP_SZ, 16> m_decimators;
|
||||
#endif
|
||||
DecimatorsF m_decimators;
|
||||
|
||||
void run();
|
||||
void callback(const qint16* buf, qint32 len);
|
||||
void callback(const float* buf, qint32 len);
|
||||
static int rx_callback(airspyhf_transfer_t* transfer);
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user