From c678b40988dde8733af1813ce288942fb5bca0a5 Mon Sep 17 00:00:00 2001 From: f4exb Date: Mon, 21 Feb 2022 02:18:44 +0100 Subject: [PATCH] NCOF: fix null sample rate condition --- sdrbase/dsp/ncof.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sdrbase/dsp/ncof.cpp b/sdrbase/dsp/ncof.cpp index 4becab475..08249f4fb 100644 --- a/sdrbase/dsp/ncof.cpp +++ b/sdrbase/dsp/ncof.cpp @@ -46,8 +46,8 @@ NCOF::NCOF() void NCOF::setFreq(Real freq, Real sampleRate) { - m_phaseIncrement = (freq * TableSize) / sampleRate; - qDebug("NCOF::setFreq: freq: %f m_phaseIncrement: %f", freq, m_phaseIncrement); + m_phaseIncrement = sampleRate == 0 ? 0 : (freq * TableSize) / sampleRate; + qDebug("NCOF::setFreq: freq: %f sr: %f m_phaseIncrement: %f", freq, sampleRate, m_phaseIncrement); } float NCOF::next()