diff --git a/frequencydemod.cpp b/frequencydemod.cpp index de95ccd..17bdf6b 100644 --- a/frequencydemod.cpp +++ b/frequencydemod.cpp @@ -30,7 +30,7 @@ void FrequencyDemod::work(void *input, void *output, int count, size_t sampleid) { auto in = static_cast*>(input); auto out = static_cast(output); - freqdem fdem = freqdem_create(0.05f); + freqdem fdem = freqdem_create(relativeBandwidth() / 2.0); for (int i = 0; i < count; i++) { freqdem_demodulate(fdem, in[i], &out[i]); } diff --git a/samplebuffer.h b/samplebuffer.h index e3eafff..047e498 100644 --- a/samplebuffer.h +++ b/samplebuffer.h @@ -45,6 +45,6 @@ public: }; float relativeBandwidth() { - return 1; + return src->relativeBandwidth(); } }; diff --git a/spectrogramplot.cpp b/spectrogramplot.cpp index 9b43762..975c69b 100644 --- a/spectrogramplot.cpp +++ b/spectrogramplot.cpp @@ -343,7 +343,7 @@ void SpectrogramPlot::tunerMoved() { tunerTransform->setFrequency(getTunerPhaseInc()); tunerTransform->setTaps(getTunerTaps()); - tunerTransform->setRelativeBandwith(tuner.deviation() * 2.0 / getStride()); + tunerTransform->setRelativeBandwith(tuner.deviation() * 2.0 / height()); // TODO: for invalidating traceplot cache, this shouldn't really go here QPixmapCache::clear();