Fixed RDS not enabled when in mono even if RDS checkbox checked

This commit is contained in:
AlexandreRouma 2022-07-07 00:45:15 +02:00
parent b5857e2078
commit 06210ae825
2 changed files with 27 additions and 3 deletions

View File

@ -188,6 +188,31 @@ namespace dsp::demod {
convert::LRToStereo::process(count, l, r, out); convert::LRToStereo::process(count, l, r, out);
} }
else { else {
// Process RDS if needed. Note: find a way to not have to copy half the code from the stereo demod
if (_rdsOut) {
// Convert to complex
rtoc.process(count, demod.out.writeBuf, rtoc.out.writeBuf);
// Filter out pilot and run through PLL
pilotFir.process(count, rtoc.out.writeBuf, pilotFir.out.writeBuf);
pilotPLL.process(count, pilotFir.out.writeBuf, pilotPLL.out.writeBuf);
// Delay
lprDelay.process(count, demod.out.writeBuf, demod.out.writeBuf);
lmrDelay.process(count, rtoc.out.writeBuf, rtoc.out.writeBuf);
// conjugate PLL output to down convert twice the L-R signal
math::Conjugate::process(count, pilotPLL.out.writeBuf, pilotPLL.out.writeBuf);
math::Multiply<dsp::complex_t>::process(count, rtoc.out.writeBuf, pilotPLL.out.writeBuf, rtoc.out.writeBuf);
math::Multiply<dsp::complex_t>::process(count, rtoc.out.writeBuf, pilotPLL.out.writeBuf, rtoc.out.writeBuf);
// Since the PLL output is no longer needed after this, use it as the output
math::Multiply<dsp::complex_t>::process(count, rtoc.out.writeBuf, pilotPLL.out.writeBuf, pilotPLL.out.writeBuf);
convert::ComplexToReal::process(count, pilotPLL.out.writeBuf, rdsout);
volk_32f_s32f_multiply_32f(rdsout, rdsout, 100.0, count);
rdsOutCount = rdsResamp.process(count, rdsout, rdsout);
}
// Filter if needed // Filter if needed
if (_lowPass) { if (_lowPass) {
alFir.process(count, demod.out.writeBuf, demod.out.writeBuf); alFir.process(count, demod.out.writeBuf, demod.out.writeBuf);

View File

@ -3,8 +3,7 @@
#include <gui/gui.h> #include <gui/gui.h>
#include <signal_path/signal_path.h> #include <signal_path/signal_path.h>
#include <signal_path/sink.h> #include <signal_path/sink.h>
#include <dsp/audio.h> #include <dsp/buffer/packer.h>
#include <dsp/processing.h>
#include <spdlog/spdlog.h> #include <spdlog/spdlog.h>
#include <config.h> #include <config.h>
#include <utils/optionlist.h> #include <utils/optionlist.h>
@ -125,7 +124,7 @@ private:
AAudioStream *stream = NULL; AAudioStream *stream = NULL;
SinkManager::Stream* _stream; SinkManager::Stream* _stream;
dsp::Packer<dsp::stereo_t> packer; dsp::buffer::Packer<dsp::stereo_t> packer;
std::string _streamName; std::string _streamName;
double sampleRate; double sampleRate;