mirror of
https://github.com/f4exb/sdrangel.git
synced 2024-12-23 01:55:48 -05:00
Added decimation class with unsigned to signed conversion with shift. Applied to RTL-SDR
This commit is contained in:
parent
18fa3b6156
commit
c7e1526930
@ -88,7 +88,7 @@ void RTLSDRThread::run()
|
||||
}
|
||||
|
||||
// Decimate according to specified log2 (ex: log2=4 => decim=16)
|
||||
void RTLSDRThread::callback(const qint8* buf, qint32 len)
|
||||
void RTLSDRThread::callback(const quint8* buf, qint32 len)
|
||||
{
|
||||
SampleVector::iterator it = m_convertBuffer.begin();
|
||||
|
||||
@ -178,9 +178,6 @@ void RTLSDRThread::callback(const qint8* buf, qint32 len)
|
||||
void RTLSDRThread::callbackHelper(unsigned char* buf, uint32_t len, void* ctx)
|
||||
{
|
||||
RTLSDRThread* thread = (RTLSDRThread*)ctx;
|
||||
for (unsigned int i = 0; i < len; i++) {
|
||||
buf[i] = buf[i] - 127;
|
||||
}
|
||||
thread->callback((qint8 *) buf, len);
|
||||
thread->callback(buf, len);
|
||||
}
|
||||
|
||||
|
@ -24,7 +24,7 @@
|
||||
#include <rtl-sdr.h>
|
||||
|
||||
#include "dsp/samplesinkfifo.h"
|
||||
#include "dsp/decimators.h"
|
||||
#include "dsp/decimatorsu.h"
|
||||
|
||||
class RTLSDRThread : public QThread {
|
||||
Q_OBJECT
|
||||
@ -52,10 +52,10 @@ private:
|
||||
unsigned int m_log2Decim;
|
||||
int m_fcPos;
|
||||
|
||||
Decimators<qint8, SDR_SAMP_SZ, 8> m_decimators;
|
||||
DecimatorsU<quint8, SDR_SAMP_SZ, 8, 127> m_decimators;
|
||||
|
||||
void run();
|
||||
void callback(const qint8* buf, qint32 len);
|
||||
void callback(const quint8* buf, qint32 len);
|
||||
|
||||
static void callbackHelper(unsigned char* buf, uint32_t len, void* ctx);
|
||||
};
|
||||
|
@ -96,6 +96,7 @@ set(sdrbase_HEADERS
|
||||
dsp/cwkeyer.h
|
||||
dsp/cwkeyersettings.h
|
||||
dsp/decimators.h
|
||||
dsp/decimatorsu.h
|
||||
dsp/interpolators.h
|
||||
dsp/dspcommands.h
|
||||
dsp/dspengine.h
|
||||
|
1323
sdrbase/dsp/decimatorsu.h
Normal file
1323
sdrbase/dsp/decimatorsu.h
Normal file
File diff suppressed because it is too large
Load Diff
Loading…
Reference in New Issue
Block a user