From a2d707cab4af2bda0316d68d1c617c3d9b6161f2 Mon Sep 17 00:00:00 2001 From: Jens Ahrensfeld Date: Sun, 16 Dec 2018 17:25:29 +0000 Subject: [PATCH] - consider signal for process gap - decreased rho git-svn-id: http://moon:8086/svn/software/trunk/projects/GnuRadio@373 b431acfa-c32f-4a4a-93f1-934dc6c82436 --- gr-jay/lib/garage_impl.cc | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/gr-jay/lib/garage_impl.cc b/gr-jay/lib/garage_impl.cc index f105183..0a302de 100644 --- a/gr-jay/lib/garage_impl.cc +++ b/gr-jay/lib/garage_impl.cc @@ -105,7 +105,7 @@ void garage_impl::forecast (int noutput_items, gr_vector_int &ninput_items_requi int garage_impl::general_work (int noutput_items, gr_vector_int &ninput_items, gr_vector_const_void_star &input_items, gr_vector_void_star &output_items) { - float rho = 1e-5; + float rho = 1e-4; const float *in = (const float *) input_items[0]; float *out = (float *) output_items[0]; int outCount = 0; @@ -142,6 +142,8 @@ int garage_impl::general_work (int noutput_items, gr_vector_int &ninput_items, g m_vmin = m_vmin + rho*(m_v_thr - m_vmin); m_vmax = m_vmax + rho*(m_v_thr - m_vmax); + bool isSignal = (m_v_thr >= loopThreshold); + // Detect bit change int bitChg = 0; if (m_bit == 1) @@ -161,21 +163,21 @@ int garage_impl::general_work (int noutput_items, gr_vector_int &ninput_items, g } } - bitProcessGap(bitChg); + bitProcessGap(bitChg && isSignal); // Calc error err = 0; - if (bitChg and (m_v_thr >= loopThreshold)) + if (bitChg && isSignal) { err = -(m_count - (int)(m_samplesPerSym/2)); } - + float vcorr = k_leadLag*k_lead*err + m_lag_accu; - + // Lag part of loop filter m_lag_accu += k_leadLag*k_lag*err; m_lag_accu *= (1.f - k_leak); - + m_baudRate = (float)m_sampleRate/((1+vcorr)*m_samplesPerSym); // Sample bit at baud rate = fs/numSamplesPerSym