From 3adaef0094f36664ae069c20c2f8f0f8e90abf0c Mon Sep 17 00:00:00 2001 From: Jens Ahrensfeld Date: Thu, 16 Jun 2022 08:37:30 +0000 Subject: [PATCH] - STR: removed alternate impl git-svn-id: http://moon:8086/svn/software/trunk/libsrc/radio@992 b431acfa-c32f-4a4a-93f1-934dc6c82436 --- synchronization.c | 18 +++--------------- synchronization.h | 1 - 2 files changed, 3 insertions(+), 16 deletions(-) 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;