Merge pull request #1130 from AlexandreRouma/master

Merging back master changes
This commit is contained in:
AlexandreRouma
2023-07-09 18:35:44 +02:00
committed by GitHub
18 changed files with 298 additions and 62 deletions

View File

@ -57,10 +57,13 @@ 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);
demod.init(vfo->output, 72000.0f, INPUT_SAMPLE_RATE, 33, 0.6f, 0.1f, 0.005f, brokenModulation, 1e-6, 0.01);
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, oqpsk, 1e-6, 0.01);
split.init(&demod.out);
split.bindStream(&symSinkStream);
split.bindStream(&sinkStream);
@ -99,6 +102,7 @@ public:
double bw = gui::waterfall.getBandwidth();
vfo = sigpath::vfoManager.createVFO(name, ImGui::WaterfallVFO::REF_CENTER, std::clamp<double>(0, -bw / 2.0, bw / 2.0), 150000, INPUT_SAMPLE_RATE, 150000, 150000, true);
demod.setBrokenModulation(brokenModulation);
demod.setInput(vfo->output);
demod.start();
@ -151,6 +155,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 +256,7 @@ private:
uint64_t dataWritten = 0;
std::ofstream recFile;
bool brokenModulation = false;
bool oqpsk = false;
int8_t* writeBuffer;
};

View File

@ -11,8 +11,8 @@ namespace dsp::demod {
public:
Meteor() {}
Meteor(stream<complex_t>* in, double symbolrate, double samplerate, int rrcTapCount, double rrcBeta, double agcRate, double costasBandwidth, bool brokenModulation, double omegaGain, double muGain, double omegaRelLimit = 0.01) {
init(in, symbolrate, samplerate, rrcTapCount, rrcBeta, agcRate, costasBandwidth, brokenModulation, omegaGain, muGain);
Meteor(stream<complex_t>* in, double symbolrate, double samplerate, int rrcTapCount, double rrcBeta, double agcRate, double costasBandwidth, bool brokenModulation, bool oqpsk, double omegaGain, double muGain, double omegaRelLimit = 0.01) {
init(in, symbolrate, samplerate, rrcTapCount, rrcBeta, agcRate, costasBandwidth, brokenModulation, oqpsk, omegaGain, muGain);
}
~Meteor() {
@ -21,11 +21,12 @@ namespace dsp::demod {
taps::free(rrcTaps);
}
void init(stream<complex_t>* in, double symbolrate, double samplerate, int rrcTapCount, double rrcBeta, double agcRate, double costasBandwidth, bool brokenModulation, double omegaGain, double muGain, double omegaRelLimit = 0.01) {
void init(stream<complex_t>* in, double symbolrate, double samplerate, int rrcTapCount, double rrcBeta, double agcRate, double costasBandwidth, bool brokenModulation, bool oqpsk, double omegaGain, double muGain, double omegaRelLimit = 0.01) {
_symbolrate = symbolrate;
_samplerate = samplerate;
_rrcTapCount = rrcTapCount;
_rrcBeta = rrcBeta;
_oqpsk = oqpsk;
rrcTaps = taps::rootRaisedCosine<float>(_rrcTapCount, _rrcBeta, _symbolrate, _samplerate);
rrc.init(NULL, rrcTaps);
@ -129,6 +130,12 @@ namespace dsp::demod {
costas.setBrokenModulation(enabled);
}
void setOQPSK(bool enabled) {
assert(base_type::_block_init);
std::lock_guard<std::recursive_mutex> lck(base_type::ctrlMtx);
_oqpsk = enabled;
}
void reset() {
assert(base_type::_block_init);
std::lock_guard<std::recursive_mutex> lck(base_type::ctrlMtx);
@ -144,6 +151,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 +185,8 @@ namespace dsp::demod {
double _samplerate;
int _rrcTapCount;
double _rrcBeta;
float lastI = 0.0f;
bool _oqpsk = false;
tap<float> rrcTaps;
filter::FIR<complex_t, float> rrc;