From ce9caf0f3baa50d46a52d28b7afc215770b24158 Mon Sep 17 00:00:00 2001 From: Werner Almesberger Date: Sun, 9 Dec 2012 17:15:30 -0300 Subject: [PATCH] tornado/fw/sim/alg.c: tune EWMA weights; correct sample rate for simulation --- tornado/fw/sim/alg.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tornado/fw/sim/alg.c b/tornado/fw/sim/alg.c index a1c7704..7c8741b 100755 --- a/tornado/fw/sim/alg.c +++ b/tornado/fw/sim/alg.c @@ -8,7 +8,7 @@ #define G 28 /* 1 Earth gravity in accelerometer units */ #define MID 512 /* accelerometer middle value */ -#define S 1000 /* sample rate (samples/s) */ +#define S 2000 /* sample rate (samples/s) */ #define F 2 /* rotational speed in Hz */ #define R 0.46 /* radius of accelerometer orbit */ @@ -41,8 +41,8 @@ static uint16_t sample(double t) } -#define E_SHIFT 3 /* ~ 0.1 */ -#define M_SHIFT 10 /* ~ 1/S */ +#define E_SHIFT 6 /* ~ 0.06 */ +#define M_SHIFT 10 /* ~ 2/S */ static void process(unsigned v)