Skip to content

Commit 1c081ca

Browse files
added OQPSK mode to the meteor demodulator
1 parent 5acdab0 commit 1c081ca

File tree

2 files changed

+32
-2
lines changed

2 files changed

+32
-2
lines changed

decoder_modules/meteor_demodulator/src/main.cpp

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,9 +57,12 @@ class MeteorDemodulatorModule : public ModuleManager::Instance {
5757
if (config.conf[name].contains("brokenModulation")) {
5858
brokenModulation = config.conf[name]["brokenModulation"];
5959
}
60+
if (config.conf[name].contains("oqpsk")) {
61+
oqpsk = config.conf[name]["oqpsk"];
62+
}
6063
config.release();
6164

62-
vfo = sigpath::vfoManager.createVFO(name, ImGui::WaterfallVFO::REF_CENTER, 0, 150000, INPUT_SAMPLE_RATE, 150000, 150000, true);
65+
vfo = sigpath::vfoManager.createVFO(name, ImGui::WaterfallVFO::REF_CENTER, 0, INPUT_SAMPLE_RATE, INPUT_SAMPLE_RATE, INPUT_SAMPLE_RATE, INPUT_SAMPLE_RATE, true);
6366
demod.init(vfo->output, 72000.0f, INPUT_SAMPLE_RATE, 33, 0.6f, 0.1f, 0.005f, brokenModulation, 1e-6, 0.01);
6467
split.init(&demod.out);
6568
split.bindStream(&symSinkStream);
@@ -151,6 +154,13 @@ class MeteorDemodulatorModule : public ModuleManager::Instance {
151154
config.release(true);
152155
}
153156

157+
if (ImGui::Checkbox(CONCAT("OQPSK##oqpsk", _this->name), &_this->oqpsk)) {
158+
_this->demod.setOQPSK(_this->oqpsk);
159+
config.acquire();
160+
config.conf[_this->name]["oqpsk"] = _this->oqpsk;
161+
config.release(true);
162+
}
163+
154164
if (!_this->folderSelect.pathIsValid() && _this->enabled) { style::beginDisabled(); }
155165

156166
if (_this->recording) {
@@ -245,7 +255,7 @@ class MeteorDemodulatorModule : public ModuleManager::Instance {
245255
uint64_t dataWritten = 0;
246256
std::ofstream recFile;
247257
bool brokenModulation = false;
248-
258+
bool oqpsk = false;
249259
int8_t* writeBuffer;
250260
};
251261

decoder_modules/meteor_demodulator/src/meteor_demod.h

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -129,6 +129,12 @@ namespace dsp::demod {
129129
costas.setBrokenModulation(enabled);
130130
}
131131

132+
void setOQPSK(bool enabled) {
133+
assert(base_type::_block_init);
134+
std::lock_guard<std::recursive_mutex> lck(base_type::ctrlMtx);
135+
oqpsk = enabled;
136+
}
137+
132138
void reset() {
133139
assert(base_type::_block_init);
134140
std::lock_guard<std::recursive_mutex> lck(base_type::ctrlMtx);
@@ -144,6 +150,18 @@ namespace dsp::demod {
144150
rrc.process(count, in, out);
145151
agc.process(count, out, out);
146152
costas.process(count, out, out);
153+
154+
if (oqpsk) {
155+
// Single sample delay + deinterleave
156+
for (int i = 0; i < count; i++) {
157+
float tmp = out[i].im;
158+
out[i].im = lastI;
159+
lastI = tmp;
160+
}
161+
162+
// TODO: Additional 1/24th sample delay
163+
}
164+
147165
return recov.process(count, out, out);
148166
}
149167

@@ -166,6 +184,8 @@ namespace dsp::demod {
166184
double _samplerate;
167185
int _rrcTapCount;
168186
double _rrcBeta;
187+
float lastI = 0.0f;
188+
bool oqpsk = false;
169189

170190
tap<float> rrcTaps;
171191
filter::FIR<complex_t, float> rrc;

0 commit comments

Comments
 (0)