From d0bea51cd44b057ebfa42939577d416f844d1ab4 Mon Sep 17 00:00:00 2001 From: Ryzerth Date: Thu, 18 Feb 2021 02:47:19 +0100 Subject: [PATCH] Fixed CW demod + fixed bug in sinks --- audio_sink/src/main.cpp | 1 + core/src/signal_path/sink.h | 2 +- radio/src/cw_demod.h | 2 +- radio/src/fm_demod.h | 2 +- 4 files changed, 4 insertions(+), 3 deletions(-) diff --git a/audio_sink/src/main.cpp b/audio_sink/src/main.cpp index 962af1b6..de4ad311 100644 --- a/audio_sink/src/main.cpp +++ b/audio_sink/src/main.cpp @@ -73,6 +73,7 @@ public: if (i == devId) { devListId = devices.size(); defaultDev = devListId; + _stream->setSampleRate(dev.sampleRates[0]); } dev.srId = 0; diff --git a/core/src/signal_path/sink.h b/core/src/signal_path/sink.h index 1edabfcf..90dc4bb7 100644 --- a/core/src/signal_path/sink.h +++ b/core/src/signal_path/sink.h @@ -79,7 +79,7 @@ public: void menuHandler() {} static SinkManager::Sink* create(SinkManager::Stream* stream, std::string streamName, void* ctx) { - stream->srChange.emit(48000); + stream->setSampleRate(48000); return new SinkManager::NullSink(stream); } diff --git a/radio/src/cw_demod.h b/radio/src/cw_demod.h index d106a0f5..77a07aca 100644 --- a/radio/src/cw_demod.h +++ b/radio/src/cw_demod.h @@ -170,7 +170,7 @@ private: const float bwMax = 500; const float bwMin = 100; - const float bbSampRate = 500; + const float bbSampRate = 6000; std::string uiPrefix; float snapInterval = 10; diff --git a/radio/src/fm_demod.h b/radio/src/fm_demod.h index ec9b889f..9af09b36 100644 --- a/radio/src/fm_demod.h +++ b/radio/src/fm_demod.h @@ -92,7 +92,7 @@ public: resamp.stop(); } audioSampRate = sampleRate; - float audioBW = std::min(audioSampRate / 2.0f, 16000.0f); + float audioBW = std::min(audioSampRate / 2.0f, bw / 2.0f); resamp.setOutSampleRate(audioSampRate); win.setSampleRate(bbSampRate * resamp.getInterpolation()); win.setCutoff(audioBW);