From 8372bcba924640a60c4e8c7e3fc83b894e59b772 Mon Sep 17 00:00:00 2001 From: Ahmet Inan Date: Sat, 6 Dec 2014 22:23:23 +0100 Subject: [PATCH] be precise: even if we are going to square the deviation, its: x-u, not u-x --- app/src/main/rs/scanline_estimator.rsh | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/app/src/main/rs/scanline_estimator.rsh b/app/src/main/rs/scanline_estimator.rsh index 2f5b54e..361aac5 100644 --- a/app/src/main/rs/scanline_estimator.rsh +++ b/app/src/main/rs/scanline_estimator.rsh @@ -24,43 +24,43 @@ static const float ema_estimator_a = 0.7f; static float robot36_estimator(int length) { static ema_t variance = { 0.0f, ema_estimator_a }; - float deviation = robot36_scanline_length - length; + float deviation = length - robot36_scanline_length; return filter(&variance, deviation * deviation); } static float robot72_estimator(int length) { static ema_t variance = { 0.0f, ema_estimator_a }; - float deviation = robot72_scanline_length - length; + float deviation = length - robot72_scanline_length; return filter(&variance, deviation * deviation); } static float martin1_estimator(int length) { static ema_t variance = { 0.0f, ema_estimator_a }; - float deviation = martin1_scanline_length - length; + float deviation = length - martin1_scanline_length; return filter(&variance, deviation * deviation); } static float martin2_estimator(int length) { static ema_t variance = { 0.0f, ema_estimator_a }; - float deviation = martin2_scanline_length - length; + float deviation = length - martin2_scanline_length; return filter(&variance, deviation * deviation); } static float scottie1_estimator(int length) { static ema_t variance = { 0.0f, ema_estimator_a }; - float deviation = scottie1_scanline_length - length; + float deviation = length - scottie1_scanline_length; return filter(&variance, deviation * deviation); } static float scottie2_estimator(int length) { static ema_t variance = { 0.0f, ema_estimator_a }; - float deviation = scottie2_scanline_length - length; + float deviation = length - scottie2_scanline_length; return filter(&variance, deviation * deviation); } static float scottieDX_estimator(int length) { static ema_t variance = { 0.0f, ema_estimator_a }; - float deviation = scottieDX_scanline_length - length; + float deviation = length - scottieDX_scanline_length; return filter(&variance, deviation * deviation); }