mirror of
https://github.com/cjcliffe/CubicSDR.git
synced 2024-11-23 12:18:37 -05:00
Modem demodulations returning bitstreams
This commit is contained in:
parent
0a0e7db242
commit
2ca6786be7
@ -546,10 +546,17 @@ void AppFrame::OnIdle(wxIdleEvent& event) {
|
||||
} else {
|
||||
DemodulatorMgr *mgr = &wxGetApp().getDemodMgr();
|
||||
|
||||
int dSelection = demodModeSelectoradv->getSelection();
|
||||
int dSelection = demodModeSelector->getSelection();
|
||||
int dSelectionadv = demodModeSelectoradv->getSelection();
|
||||
if (dSelection != -1 && dSelection != mgr->getLastDemodulatorType()) {
|
||||
mgr->setLastDemodulatorType(dSelection);
|
||||
demodModeSelectoradv->setSelection(-1);
|
||||
}
|
||||
else if(dSelectionadv != -1 && dSelectionadv != mgr->getLastDemodulatorType()) {
|
||||
mgr->setLastDemodulatorType(dSelectionadv);
|
||||
demodModeSelector->setSelection(-1);
|
||||
}
|
||||
|
||||
demodGainMeter->setLevel(mgr->getLastGain());
|
||||
if (demodSignalMeter->inputChanged()) {
|
||||
mgr->setLastSquelchLevel(demodSignalMeter->getInputValue());
|
||||
|
@ -177,6 +177,8 @@ void DemodulatorThread::threadMain() {
|
||||
freqdem_demodulate_block(demodFM, &agcData[0], bufSize, &demodOutputData[0]);
|
||||
} else {
|
||||
float p;
|
||||
unsigned int bitstream;
|
||||
int temp;
|
||||
switch (demodulatorType.load()) {
|
||||
case DEMOD_TYPE_LSB:
|
||||
for (int i = 0; i < bufSize; i++) { // Reject upper band
|
||||
@ -196,6 +198,63 @@ void DemodulatorThread::threadMain() {
|
||||
ampmodem_demodulate(demodAM, inp->data[i], &demodOutputData[i]);
|
||||
}
|
||||
break;
|
||||
case DEMOD_TYPE_ASK:
|
||||
for (int i = 0; i < bufSize; i++) {
|
||||
modem_demodulate(demodASK, inp->data[i], &bitstream);
|
||||
std::cout << bitstream << std::endl;
|
||||
}
|
||||
break;
|
||||
case DEMOD_TYPE_BPSK:
|
||||
for (int i = 0; i < bufSize; i++) {
|
||||
modem_demodulate(demodBPSK, inp->data[i], &bitstream);
|
||||
std::cout << bitstream << std::endl;
|
||||
}
|
||||
break;
|
||||
case DEMOD_TYPE_DPSK:
|
||||
for (int i = 0; i < bufSize; i++) {
|
||||
modem_demodulate(demodDPSK, inp->data[i], &bitstream);
|
||||
std::cout << bitstream << std::endl;
|
||||
}
|
||||
break;
|
||||
case DEMOD_TYPE_PSK:
|
||||
for (int i = 0; i < bufSize; i++) {
|
||||
modem_demodulate(demodPSK, inp->data[i], &bitstream);
|
||||
std::cout << bitstream << std::endl;
|
||||
}
|
||||
break;
|
||||
case DEMOD_TYPE_OOK:
|
||||
for (int i = 0; i < bufSize; i++) {
|
||||
modem_demodulate(demodOOK, inp->data[i], &bitstream);
|
||||
std::cout << bitstream << std::endl;
|
||||
}
|
||||
break;
|
||||
case DEMOD_TYPE_SQAM:
|
||||
for (int i = 0; i < bufSize; i++) {
|
||||
modem_demodulate(demodSQAM, inp->data[i], &bitstream);
|
||||
std::cout << bitstream << std::endl;
|
||||
}
|
||||
break;
|
||||
case DEMOD_TYPE_ST:
|
||||
for (int i = 0; i < bufSize; i++) {
|
||||
modem_demodulate(demodST, inp->data[i], &bitstream);
|
||||
std::cout << bitstream << std::endl;
|
||||
}
|
||||
break;
|
||||
case DEMOD_TYPE_QAM:
|
||||
for (int i = 0; i < bufSize; i++) {
|
||||
modem_demodulate(demodQAM, inp->data[i], &bitstream);
|
||||
std::cout << bitstream << std::endl;
|
||||
}
|
||||
break;
|
||||
case DEMOD_TYPE_QPSK:
|
||||
for (int i = 0; i < bufSize; i++) {
|
||||
modem_demodulate(demodQPSK, inp->data[i], &bitstream);
|
||||
// std::cout << bitstream << std::endl;
|
||||
}
|
||||
if(modem_get_demodulator_evm(demodQPSK) <= 0.8f) {
|
||||
std::cout << "Lock!" << std::endl;
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
amOutputCeilMA = amOutputCeilMA + (amOutputCeil - amOutputCeilMA) * 0.025;
|
||||
|
Loading…
Reference in New Issue
Block a user