mirror of
https://github.com/cjcliffe/CubicSDR.git
synced 2024-11-26 21:58:37 -05:00
Add modemkit to demod chain
This commit is contained in:
parent
73ca52aee1
commit
39c42c2b82
@ -7,24 +7,6 @@
|
||||
#include <atomic>
|
||||
#include <mutex>
|
||||
|
||||
//#define DEMOD_TYPE_NULL 0
|
||||
//#define DEMOD_TYPE_FM 1
|
||||
//#define DEMOD_TYPE_AM 2
|
||||
//#define DEMOD_TYPE_LSB 3
|
||||
//#define DEMOD_TYPE_USB 4
|
||||
//#define DEMOD_TYPE_DSB 5
|
||||
//#define DEMOD_TYPE_ASK 6
|
||||
//#define DEMOD_TYPE_APSK 7
|
||||
//#define DEMOD_TYPE_BPSK 8
|
||||
//#define DEMOD_TYPE_DPSK 9
|
||||
//#define DEMOD_TYPE_PSK 10
|
||||
//#define DEMOD_TYPE_OOK 11
|
||||
//#define DEMOD_TYPE_ST 12
|
||||
//#define DEMOD_TYPE_SQAM 13
|
||||
//#define DEMOD_TYPE_QAM 14
|
||||
//#define DEMOD_TYPE_QPSK 15
|
||||
//#define DEMOD_TYPE_RAW 16
|
||||
|
||||
#include "IOThread.h"
|
||||
|
||||
class DemodulatorThread;
|
||||
@ -93,14 +75,18 @@ public:
|
||||
}
|
||||
};
|
||||
|
||||
class Modem;
|
||||
class ModemKit;
|
||||
|
||||
class DemodulatorThreadPostIQData: public ReferenceCounter {
|
||||
public:
|
||||
std::vector<liquid_float_complex> data;
|
||||
long long sampleRate;
|
||||
Modem *modem;
|
||||
ModemKit *modemKit;
|
||||
|
||||
DemodulatorThreadPostIQData() :
|
||||
sampleRate(0) {
|
||||
sampleRate(0), modem(nullptr), modemKit(nullptr) {
|
||||
|
||||
}
|
||||
|
||||
|
@ -99,9 +99,6 @@ private:
|
||||
|
||||
void checkBandwidth();
|
||||
|
||||
Modem *currentModem;
|
||||
ModemKit *currentModemKit;
|
||||
|
||||
std::atomic<std::string *> label; //
|
||||
std::atomic_bool terminated; //
|
||||
std::atomic_bool demodTerminated; //
|
||||
|
@ -8,7 +8,7 @@
|
||||
#include "DemodulatorPreThread.h"
|
||||
#include "CubicSDR.h"
|
||||
|
||||
DemodulatorPreThread::DemodulatorPreThread() : IOThread(), iqResampler(NULL), iqResampleRatio(1), iqInputQueue(NULL), iqOutputQueue(NULL), threadQueueNotify(NULL), commandQueue(NULL)
|
||||
DemodulatorPreThread::DemodulatorPreThread() : IOThread(), iqResampler(NULL), iqResampleRatio(1), iqInputQueue(NULL), iqOutputQueue(NULL), threadQueueNotify(NULL), commandQueue(NULL), cModem(nullptr), cModemKit(nullptr)
|
||||
{
|
||||
initialized.store(false);
|
||||
|
||||
@ -251,6 +251,8 @@ void DemodulatorPreThread::run() {
|
||||
// resamp->firStereoLeft = firStereoLeft;
|
||||
// resamp->firStereoRight = firStereoRight;
|
||||
// resamp->iirStereoPilot = iirStereoPilot;
|
||||
resamp->modem = cModem;
|
||||
resamp->modemKit = cModemKit;
|
||||
resamp->sampleRate = params.bandwidth;
|
||||
|
||||
iqOutputQueue->push(resamp);
|
||||
@ -294,6 +296,14 @@ void DemodulatorPreThread::run() {
|
||||
// params.audioSampleRate = result.audioSampleRate;
|
||||
// }
|
||||
|
||||
if (result.modem != nullptr) {
|
||||
cModem = result.modem;
|
||||
}
|
||||
|
||||
if (result.modemKit != nullptr) {
|
||||
cModemKit = result.modemKit;
|
||||
}
|
||||
|
||||
if (result.bandwidth) {
|
||||
params.bandwidth = result.bandwidth;
|
||||
}
|
||||
|
@ -37,6 +37,9 @@ protected:
|
||||
double iqResampleRatio;
|
||||
std::vector<liquid_float_complex> resampledData;
|
||||
|
||||
Modem *cModem;
|
||||
ModemKit *cModemKit;
|
||||
|
||||
// msresamp_rrrf audioResampler;
|
||||
// msresamp_rrrf stereoResampler;
|
||||
// double audioResampleRatio;
|
||||
|
@ -5,6 +5,7 @@
|
||||
|
||||
#include "DemodDefs.h"
|
||||
#include "AudioThread.h"
|
||||
#include "Modem.h"
|
||||
|
||||
typedef ThreadQueue<AudioThreadInput *> DemodulatorThreadOutputQueue;
|
||||
|
||||
@ -154,6 +155,9 @@ protected:
|
||||
void updateDemodulatorCons(int Cons);
|
||||
void updateDemodulatorLock(modem demod, float sensitivity);
|
||||
|
||||
Modem *cModem;
|
||||
ModemKit *cModemKit;
|
||||
|
||||
DemodulatorThreadPostInputQueue* iqInputQueue;
|
||||
AudioThreadInputQueue *audioOutputQueue;
|
||||
DemodulatorThreadOutputQueue* audioVisOutputQueue;
|
||||
|
@ -34,6 +34,7 @@ public:
|
||||
|
||||
long long sampleRate;
|
||||
unsigned int bandwidth;
|
||||
Modem *modem;
|
||||
ModemKit *modemKit;
|
||||
};
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user