- consider signal for process gap

- decreased rho

git-svn-id: http://moon:8086/svn/software/trunk/projects/GnuRadio@373 b431acfa-c32f-4a4a-93f1-934dc6c82436
This commit is contained in:
2018-12-16 17:25:29 +00:00
parent a87d2f154e
commit a2d707cab4
+8 -6
View File
@@ -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