new stuff

This commit is contained in:
Ryzerth
2020-09-18 00:23:03 +02:00
parent c1052b1b28
commit 1ef31f0f8b
16 changed files with 873 additions and 402 deletions

View File

@@ -95,7 +95,14 @@ MOD_EXPORT void _DRAW_MENU_(RadioContext_t* ctx) {
ctx->sigPath.setDemodulator(SigPath::DEMOD_LSB, ctx->bandWidth);
API->setVFOReference(ctx->name, mod::API_t::REF_UPPER);
}
if (ImGui::RadioButton(CONCAT("RAW##_", ctx->name), ctx->demod == 7) && ctx->demod != 7) { ctx->demod = 7; };
if (ImGui::RadioButton(CONCAT("RAW##_", ctx->name), ctx->demod == 7) && ctx->demod != 7) {
ctx->demod = 7;
ctx->bandWidth = 10000;
ctx->bandWidthMin = 3000;
ctx->bandWidthMax = 10000;
ctx->sigPath.setDemodulator(SigPath::DEMOD_RAW, ctx->bandWidth);
API->setVFOReference(ctx->name, mod::API_t::REF_CENTER);
};
ImGui::Columns(1, CONCAT("EndRadioModeColumns##_", ctx->name), false);
ImGui::EndGroup();

View File

@@ -28,10 +28,13 @@ void SigPath::init(std::string vfoName, uint64_t sampleRate, int blockSize, dsp:
bandwidth = 200000;
// TODO: Set default VFO options
// TODO: ajust deemphasis for different output sample rates
// TODO: Add a mono to stereo for different modes
demod.init(input, 100000, 200000, 800);
amDemod.init(input, 50);
ssbDemod.init(input, 6000, 3000, 22);
cpx2stereo.init(input, 22);
audioResamp.init(&demod.output, 200000, 48000, 800);
deemp.init(&audioResamp.output, 800, 50e-6, 48000);
@@ -77,6 +80,9 @@ void SigPath::setDemodulator(int demId, float bandWidth) {
else if (_demod == DEMOD_DSB) {
ssbDemod.stop();
}
else if (_demod == DEMOD_RAW) {
cpx2stereo.stop();
}
else {
spdlog::error("UNIMPLEMENTED DEMODULATOR IN SigPath::setDemodulator (stop)");
}
@@ -145,6 +151,14 @@ void SigPath::setDemodulator(int demId, float bandWidth) {
deemp.bypass = true;
ssbDemod.start();
}
else if (demId == DEMOD_RAW) {
API->setVFOSampleRate(vfoName, 10000, bandwidth);
cpx2stereo.setBlockSize(API->getVFOOutputBlockSize(vfoName));
//audioResamp.setInput(&cpx2stereo.output);
audioBw = std::min<float>(bandwidth, outputSampleRate / 2.0f);
audioResamp.setInputSampleRate(10000, API->getVFOOutputBlockSize(vfoName), audioBw, audioBw);
cpx2stereo.start();
}
else {
spdlog::error("UNIMPLEMENTED DEMODULATOR IN SigPath::setDemodulator (start): {0}", demId);
}
@@ -207,6 +221,9 @@ void SigPath::setBandwidth(float bandWidth) {
ssbDemod.setBandwidth(bandwidth);
ssbDemod.start();
}
else if (_demod == DEMOD_RAW) {
// Notbing to change
}
else {
spdlog::error("UNIMPLEMENTED DEMODULATOR IN SigPath::setBandwidth");
}

View File

@@ -30,6 +30,7 @@ public:
DEMOD_USB,
DEMOD_LSB,
DEMOD_DSB,
DEMOD_RAW,
_DEMOD_COUNT
};
@@ -52,9 +53,11 @@ private:
dsp::FMDemodulator demod;
dsp::AMDemodulator amDemod;
dsp::SSBDemod ssbDemod;
dsp::ComplexToStereo cpx2stereo;
// Audio output
dsp::FloatFIRResampler audioResamp;
dsp::MonoToStereo m2s;
dsp::FIRResampler<float> audioResamp;
std::string vfoName;