diff --git a/decoder_modules/meteor_demodulator/src/main.cpp b/decoder_modules/meteor_demodulator/src/main.cpp index ddd47714..05373fcf 100644 --- a/decoder_modules/meteor_demodulator/src/main.cpp +++ b/decoder_modules/meteor_demodulator/src/main.cpp @@ -57,9 +57,12 @@ public: if (config.conf[name].contains("brokenModulation")) { brokenModulation = config.conf[name]["brokenModulation"]; } + if (config.conf[name].contains("oqpsk")) { + oqpsk = config.conf[name]["oqpsk"]; + } config.release(); - vfo = sigpath::vfoManager.createVFO(name, ImGui::WaterfallVFO::REF_CENTER, 0, 150000, INPUT_SAMPLE_RATE, 150000, 150000, true); + vfo = sigpath::vfoManager.createVFO(name, ImGui::WaterfallVFO::REF_CENTER, 0, INPUT_SAMPLE_RATE, INPUT_SAMPLE_RATE, INPUT_SAMPLE_RATE, INPUT_SAMPLE_RATE, true); demod.init(vfo->output, 72000.0f, INPUT_SAMPLE_RATE, 33, 0.6f, 0.1f, 0.005f, brokenModulation, 1e-6, 0.01); split.init(&demod.out); split.bindStream(&symSinkStream); @@ -151,6 +154,13 @@ private: config.release(true); } + if (ImGui::Checkbox(CONCAT("OQPSK##oqpsk", _this->name), &_this->oqpsk)) { + _this->demod.setOQPSK(_this->oqpsk); + config.acquire(); + config.conf[_this->name]["oqpsk"] = _this->oqpsk; + config.release(true); + } + if (!_this->folderSelect.pathIsValid() && _this->enabled) { style::beginDisabled(); } if (_this->recording) { @@ -245,7 +255,7 @@ private: uint64_t dataWritten = 0; std::ofstream recFile; bool brokenModulation = false; - + bool oqpsk = false; int8_t* writeBuffer; }; diff --git a/decoder_modules/meteor_demodulator/src/meteor_demod.h b/decoder_modules/meteor_demodulator/src/meteor_demod.h index 9cc8594f..35ebbc94 100644 --- a/decoder_modules/meteor_demodulator/src/meteor_demod.h +++ b/decoder_modules/meteor_demodulator/src/meteor_demod.h @@ -129,6 +129,12 @@ namespace dsp::demod { costas.setBrokenModulation(enabled); } + void setOQPSK(bool enabled) { + assert(base_type::_block_init); + std::lock_guard lck(base_type::ctrlMtx); + oqpsk = enabled; + } + void reset() { assert(base_type::_block_init); std::lock_guard lck(base_type::ctrlMtx); @@ -144,6 +150,18 @@ namespace dsp::demod { rrc.process(count, in, out); agc.process(count, out, out); costas.process(count, out, out); + + if (oqpsk) { + // Single sample delay + deinterleave + for (int i = 0; i < count; i++) { + float tmp = out[i].im; + out[i].im = lastI; + lastI = tmp; + } + + // TODO: Additional 1/24th sample delay + } + return recov.process(count, out, out); } @@ -166,6 +184,8 @@ namespace dsp::demod { double _samplerate; int _rrcTapCount; double _rrcBeta; + float lastI = 0.0f; + bool oqpsk = false; tap rrcTaps; filter::FIR rrc;