diff --git a/synchronization.c b/synchronization.c index ce37bc0..61ec962 100755 --- a/synchronization.c +++ b/synchronization.c @@ -91,7 +91,6 @@ void LeadLagSetState(lead_lag_filter_t *pObj, radio_float_t state) void STRGardnerInit(str_t *pObj) { memset(pObj->d, 0, sizeof(pObj->d)); - pObj->alternate_impl = 0; } radio_float_t STRGardnerProcess(str_t *pObj, cpx_t x) @@ -101,20 +100,9 @@ radio_float_t STRGardnerProcess(str_t *pObj, cpx_t x) pD = pObj->d; - if (pObj->alternate_impl) - { - t.real = (x.real - pD[1].real) * pD[0].real; - t.imag = (x.imag - pD[1].imag) * pD[0].imag; - - radio_float_t sign = (t.real*t.imag) < 0 ? -1.0 : 1.0; - Vd = sqrt(fabs(t.real) * fabs(t.imag)) * sign; - } - else - { - t.real = (pD[1].real - x.real) * pD[0].real; - t.imag = (pD[1].imag - x.imag) * pD[0].imag; - Vd = (t.real + t.imag); - } + t.real = (pD[1].real - x.real) * pD[0].real; + t.imag = (pD[1].imag - x.imag) * pD[0].imag; + Vd = (t.real + t.imag); // Adjust delay line pD[1] = pD[0]; diff --git a/synchronization.h b/synchronization.h index 34d8b6d..0cc1655 100755 --- a/synchronization.h +++ b/synchronization.h @@ -32,7 +32,6 @@ typedef struct _lead_lag_coeff_t typedef struct _str_t { cpx_t d[2]; - int alternate_impl; } str_t;