SDRAngel
4.11.5
Developer docs for <a href="https://github.com/f4exb/sdrangel">SDRangel<\a>, an Open Source Qt5 / OpenGL 3.0+ SDR and signal analyzer frontend to various hardware.
plugins
samplesource
plutosdrinput
plutosdrinputthread.h
Go to the documentation of this file.
1
// Copyright (C) 2017 Edouard Griffiths, F4EXB //
3
// //
4
// This program is free software; you can redistribute it and/or modify //
5
// it under the terms of the GNU General Public License as published by //
6
// the Free Software Foundation as version 3 of the License, or //
7
// (at your option) any later version. //
8
// //
9
// This program is distributed in the hope that it will be useful, //
10
// but WITHOUT ANY WARRANTY; without even the implied warranty of //
11
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the //
12
// GNU General Public License V3 for more details. //
13
// //
14
// You should have received a copy of the GNU General Public License //
15
// along with this program. If not, see <http://www.gnu.org/licenses/>. //
17
18
#ifndef PLUGINS_SAMPLESOURCE_PLUTOSDRINPUT_PLUTOSDRINPUTTHREAD_H_
19
#define PLUGINS_SAMPLESOURCE_PLUTOSDRINPUT_PLUTOSDRINPUTTHREAD_H_
20
21
#include <QThread>
22
#include <QMutex>
23
#include <QWaitCondition>
24
25
#include "
dsp/samplesinkfifo.h
"
26
#include "
dsp/decimators.h
"
27
#include "
plutosdr/deviceplutosdrshared.h
"
28
29
class
DevicePlutoSDRBox
;
30
31
class
PlutoSDRInputThread
:
public
QThread,
public
DevicePlutoSDRShared::ThreadInterface
32
{
33
Q_OBJECT
34
35
public
:
36
PlutoSDRInputThread
(
uint32_t
blocksize,
DevicePlutoSDRBox
* plutoBox,
SampleSinkFifo
* sampleFifo, QObject* parent = 0);
37
~PlutoSDRInputThread
();
38
39
virtual
void
startWork
();
40
virtual
void
stopWork
();
41
virtual
void
setDeviceSampleRate
(
int
sampleRate) { (void) sampleRate; }
42
virtual
bool
isRunning
() {
return
m_running
; }
43
void
setLog2Decimation
(
unsigned
int
log2_decim);
44
void
setFcPos
(
int
fcPos);
45
46
private
:
47
QMutex
m_startWaitMutex
;
48
QWaitCondition
m_startWaiter
;
49
bool
m_running
;
50
51
DevicePlutoSDRBox
*
m_plutoBox
;
52
int16_t
*
m_buf
;
53
int16_t
*
m_bufConv
;
54
uint32_t
m_blockSizeSamples
;
55
SampleVector
m_convertBuffer
;
56
SampleVector::iterator
m_convertIt
;
57
SampleSinkFifo
*
m_sampleFifo
;
58
59
unsigned
int
m_log2Decim
;
// soft decimation
60
int
m_fcPos
;
61
float
m_phasor
;
62
63
Decimators<qint32, qint16, SDR_RX_SAMP_SZ, 12>
m_decimators
;
64
65
void
run
();
66
void
convert
(
const
qint16* buf, qint32 len);
67
68
};
69
70
71
#endif
/* PLUGINS_SAMPLESOURCE_PLUTOSDRINPUT_PLUTOSDRINPUTTHREAD_H_ */
int16_t
short int16_t
Definition:
rtptypes_win.h:43
SampleVector
std::vector< Sample > SampleVector
Definition:
dsptypes.h:96
PlutoSDRInputThread::m_plutoBox
DevicePlutoSDRBox * m_plutoBox
Definition:
plutosdrinputthread.h:51
samplesinkfifo.h
PlutoSDRInputThread::setDeviceSampleRate
virtual void setDeviceSampleRate(int sampleRate)
Definition:
plutosdrinputthread.h:41
PlutoSDRInputThread::setLog2Decimation
void setLog2Decimation(unsigned int log2_decim)
Definition:
plutosdrinputthread.cpp:65
PlutoSDRInputThread::m_startWaitMutex
QMutex m_startWaitMutex
Definition:
plutosdrinputthread.h:47
DevicePlutoSDRShared::ThreadInterface
Definition:
deviceplutosdrshared.h:37
PlutoSDRInputThread::m_startWaiter
QWaitCondition m_startWaiter
Definition:
plutosdrinputthread.h:48
PlutoSDRInputThread::stopWork
virtual void stopWork()
Definition:
plutosdrinputthread.cpp:57
PlutoSDRInputThread
Definition:
plutosdrinputthread.h:31
PlutoSDRInputThread::m_decimators
Decimators< qint32, qint16, SDR_RX_SAMP_SZ, 12 > m_decimators
Definition:
plutosdrinputthread.h:63
deviceplutosdrshared.h
PlutoSDRInputThread::m_buf
int16_t * m_buf
holds I+Q values of each sample from devce
Definition:
plutosdrinputthread.h:52
PlutoSDRInputThread::convert
void convert(const qint16 *buf, qint32 len)
Definition:
plutosdrinputthread.cpp:150
uint32_t
unsigned int uint32_t
Definition:
rtptypes_win.h:46
PlutoSDRInputThread::m_fcPos
int m_fcPos
Definition:
plutosdrinputthread.h:60
PlutoSDRInputThread::m_running
bool m_running
Definition:
plutosdrinputthread.h:49
PlutoSDRInputThread::~PlutoSDRInputThread
~PlutoSDRInputThread()
Definition:
plutosdrinputthread.cpp:40
PlutoSDRInputThread::m_phasor
float m_phasor
Definition:
plutosdrinputthread.h:61
PlutoSDRInputThread::PlutoSDRInputThread
PlutoSDRInputThread(uint32_t blocksize, DevicePlutoSDRBox *plutoBox, SampleSinkFifo *sampleFifo, QObject *parent=0)
Definition:
plutosdrinputthread.cpp:24
PlutoSDRInputThread::m_log2Decim
unsigned int m_log2Decim
Definition:
plutosdrinputthread.h:59
PlutoSDRInputThread::m_convertBuffer
SampleVector m_convertBuffer
vector of (I,Q) samples used for decimation and scaling conversion
Definition:
plutosdrinputthread.h:55
PlutoSDRInputThread::startWork
virtual void startWork()
Definition:
plutosdrinputthread.cpp:46
PlutoSDRInputThread::isRunning
virtual bool isRunning()
Definition:
plutosdrinputthread.h:42
decimators.h
PlutoSDRInputThread::run
void run()
Definition:
plutosdrinputthread.cpp:75
PlutoSDRInputThread::m_sampleFifo
SampleSinkFifo * m_sampleFifo
DSP sample FIFO (I,Q)
Definition:
plutosdrinputthread.h:57
PlutoSDRInputThread::m_convertIt
SampleVector::iterator m_convertIt
Definition:
plutosdrinputthread.h:56
PlutoSDRInputThread::m_blockSizeSamples
uint32_t m_blockSizeSamples
buffer sizes in number of (I,Q) samples
Definition:
plutosdrinputthread.h:54
PlutoSDRInputThread::setFcPos
void setFcPos(int fcPos)
Definition:
plutosdrinputthread.cpp:70
Decimators< qint32, qint16, SDR_RX_SAMP_SZ, 12 >
DevicePlutoSDRBox
Definition:
deviceplutosdrbox.h:33
SampleSinkFifo
Definition:
samplesinkfifo.h:28
PlutoSDRInputThread::m_bufConv
int16_t * m_bufConv
holds I+Q values of each sample converted to host format via iio_channel_convert
Definition:
plutosdrinputthread.h:53
Generated on Fri Aug 2 2019 17:56:32 for SDRAngel by
1.8.13