Unset PLL lock status as soon as condition is lost

This commit is contained in:
f4exb 2015-12-09 00:02:21 +01:00
parent cdf51b99e9
commit f300b675bf
2 changed files with 1 additions and 18 deletions

View File

@ -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;

View File

@ -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.