Add modemkit to demod chain

This commit is contained in:
Charles J. Cliffe 2015-11-17 19:32:47 -05:00
parent 73ca52aee1
commit 39c42c2b82
6 changed files with 24 additions and 23 deletions

View File

@ -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) {
}

View File

@ -98,9 +98,6 @@ protected:
private:
void checkBandwidth();
Modem *currentModem;
ModemKit *currentModemKit;
std::atomic<std::string *> label; //
std::atomic_bool terminated; //

View File

@ -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;
}

View File

@ -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;

View File

@ -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;

View File

@ -34,6 +34,7 @@ public:
long long sampleRate;
unsigned int bandwidth;
Modem *modem;
ModemKit *modemKit;
};