From f300b675bfc092ba6c7713c42d35ca928cae4b63 Mon Sep 17 00:00:00 2001 From: f4exb Date: Wed, 9 Dec 2015 00:02:21 +0100 Subject: [PATCH] Unset PLL lock status as soon as condition is lost --- include/dsp/phaselock.h | 2 -- sdrbase/dsp/phaselock.cpp | 17 +---------------- 2 files changed, 1 insertion(+), 18 deletions(-) diff --git a/include/dsp/phaselock.h b/include/dsp/phaselock.h index 5ec4de32d..bd2fca44d 100644 --- a/include/dsp/phaselock.h +++ b/include/dsp/phaselock.h @@ -106,8 +106,6 @@ private: Real m_pilot_level; int m_lock_delay; int m_lock_cnt; - int m_unlock_cnt; - int m_unlock_delay; int m_pilot_periods; quint64 m_pps_cnt; quint64 m_sample_cnt; diff --git a/sdrbase/dsp/phaselock.cpp b/sdrbase/dsp/phaselock.cpp index f6464def7..173e7c8f8 100644 --- a/sdrbase/dsp/phaselock.cpp +++ b/sdrbase/dsp/phaselock.cpp @@ -41,9 +41,7 @@ PhaseLock::PhaseLock(Real freq, Real bandwidth, Real minsignal) // Set valid signal threshold. m_minsignal = minsignal; m_lock_delay = int(20.0 / bandwidth); - m_unlock_delay = int(10.0 / bandwidth); m_lock_cnt = 0; - m_unlock_cnt = 0; m_pilot_level = 0; m_psin = 0.0; m_pcos = 1.0; @@ -105,9 +103,7 @@ void PhaseLock::configure(Real freq, Real bandwidth, Real minsignal) // Set valid signal threshold. m_minsignal = minsignal; m_lock_delay = int(20.0 / bandwidth); - m_unlock_delay = int(10.0 / bandwidth); m_lock_cnt = 0; - m_unlock_cnt = 0; m_pilot_level = 0; // Create 2nd order filter for I/Q representation of phase error. @@ -327,21 +323,10 @@ void PhaseLock::process(const Real& sample_in, Real *samples_out) { m_lock_cnt += 1; // n } - else - { - m_unlock_cnt = 0; - } } else { - if (m_unlock_cnt < m_unlock_delay) - { - m_unlock_cnt += 1; - } - else - { - m_lock_cnt = 0; - } + m_lock_cnt = 0; } // Drop PPS events when pilot not locked.