From de1460aa9438f6a466a5fe4455ed968033d4ecdb Mon Sep 17 00:00:00 2001 From: tvoid Date: Tue, 15 Apr 2008 15:09:00 -0600 Subject: added m&m to burst_cf doubles to floats --- gsm-tvoid/src/lib/mm_f.cc | 55 +++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 55 insertions(+) create mode 100644 gsm-tvoid/src/lib/mm_f.cc (limited to 'gsm-tvoid/src/lib/mm_f.cc') diff --git a/gsm-tvoid/src/lib/mm_f.cc b/gsm-tvoid/src/lib/mm_f.cc new file mode 100644 index 0000000..4637149 --- /dev/null +++ b/gsm-tvoid/src/lib/mm_f.cc @@ -0,0 +1,55 @@ + +#include "mm_f.h" + +mm_f::mm_f(float omega): + d_omega(omega), + d_mu(0.5), + d_x_1(0.0), + d_a_1(0.0), + d_gain_mu(0.01), + d_gain_omega(0.25 * d_gain_mu * d_gain_mu) +{} + + +float mm_f::slicer(float x) +{ + return x < 0 ? -1.0 : 1.0; +} + +float mm_f::update(float x_0, float a_0) +{ + d_mm = (d_a_1 * x_0) - (a_0 * d_x_1); + + //limit d_mm + if (d_mm > 1.0) d_mm = 1.0; + else if (d_mm < -1.0) d_mm = -1.0; + + //error feedback + d_omega = d_omega + d_gain_omega * d_mm; + + //limit omega +/* + if (d_omega > d_max_omega) + d_omega = d_max_omega; + else if (d_omega < d_min_omega) + d_omega = d_min_omega; +*/ + //update mu + d_mu = d_mu + d_omega + d_gain_mu * d_mm; + //process mu / ii advances after burst processing for burst timing + + //update delay taps + d_x_1 = x_0; + d_a_1 = a_0; + + return d_mu; +} + + +float mm_f::update(float x_0) +{ + return update(x_0, slicer(x_0) ); +} + + + -- cgit v1.2.3