public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Vojtech Pavlik <vojtech@suse.cz>
To: Peter Osterlund <petero2@telia.com>
Cc: Stelian Pop <stelian@popies.net>,
	Johannes Berg <johannes@sipsolutions.net>,
	Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
	Frank Arnold <frank@scirocco-5v-turbo.de>
Subject: Re: [PATCH] Apple USB Touchpad driver (new)
Date: Sun, 10 Jul 2005 14:04:25 +0200	[thread overview]
Message-ID: <20050710120425.GC3018@ucw.cz> (raw)
In-Reply-To: <m33bqnr3y9.fsf@telia.com>

On Sun, Jul 10, 2005 at 12:48:30AM +0200, Peter Osterlund wrote:
> Vojtech Pavlik <vojtech@suse.cz> writes:
> 
> > Btw, what I don't completely understand is why you need linear
> > regression, when you're not trying to detect motion or something like
> > that. Basic floating average, or even simpler filtering like the input
> > core uses for fuzz could work well enough I believe.
> 
> Indeed, this function doesn't make much sense:
> 
> +static inline int smooth_history(int x0, int x1, int x2, int x3)
> +{
> +	return x0 - ( x0 * 3 + x1 - x2 - x3 * 3 ) / 10;
> +}
> 
> In the X driver, a derivative estimate is computed from the last 4
> absolute positions, and in that case the least squares estimate is
> given by the factors [.3 .1 -.1 -.3]. However, in this case you want
> to compute an absolute position estimate from the last 4 absolute
> positions, and in this case the least squares estimate is given by the
> factors [.25 .25 .25 .25], ie a floating average. If the function is
> changed to this:
> 
> +static inline int smooth_history(int x0, int x1, int x2, int x3)
> +{
> +	return (x0 + x1 + x2 + x3) / 4;
> +}
> 
> the standard deviation of the noise will be reduced by a factor of 2
> compared to the unfiltered values. With the old smooth_history()
> function, the noise reduction will only be a factor of 1.29.
 
Using a function like

	return (x_old * 3 + x) / 4;

eliminates the need for a FIFO, and has similar (if not better)
properties to floating average, because its coefficients are
[ .25 .18 .14 .10 ... ].

Setting

	absfuzz[ABS_X] = some number;

activates the abovementioned filtering (with additional cutoff and fast
motion compensation) directly in input.c, which should eliminate a lot
of the code in the appletouch driver.

-- 
Vojtech Pavlik
SuSE Labs, SuSE CR

  reply	other threads:[~2005-07-10 12:04 UTC|newest]

Thread overview: 28+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-07-08 10:17 [PATCH] Apple USB Touchpad driver (new) Stelian Pop
2005-07-08 11:18 ` Johannes Berg
2005-07-08 12:10   ` Stelian Pop
2005-07-09 19:13     ` Vojtech Pavlik
2005-07-09 22:48       ` Peter Osterlund
2005-07-10 12:04         ` Vojtech Pavlik [this message]
2005-07-11  0:15           ` Peter Osterlund
2005-07-11 10:39             ` Stelian Pop
2005-07-11 11:00               ` Vojtech Pavlik
2005-07-11 11:08                 ` Stelian Pop
2005-07-11 11:21                   ` Vojtech Pavlik
2005-07-11 12:47                     ` Stelian Pop
2005-07-11 13:35                       ` Stelian Pop
2005-07-12  9:05                     ` Stelian Pop
2005-07-12 14:13                       ` Dmitry Torokhov
2005-07-12 14:33                         ` Stelian Pop
2005-07-12 14:47                           ` Dmitry Torokhov
2005-07-12 18:13                             ` Vojtech Pavlik
2005-07-12 19:21                               ` Stelian Pop
     [not found]               ` <20050711035244.115067ac.akpm@osdl.org>
2005-07-11 11:04                 ` Stelian Pop
2005-07-11 13:25                   ` Peter Osterlund
2005-07-11 20:44                   ` Lee Revell
2005-07-11 20:54                     ` Stelian Pop
2005-07-11 13:48               ` Peter Osterlund
2005-07-11 10:47             ` Vojtech Pavlik
2005-07-09 22:32     ` Peter Osterlund
2005-07-10 11:58       ` Vojtech Pavlik
2005-07-11 10:06       ` Stelian Pop

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20050710120425.GC3018@ucw.cz \
    --to=vojtech@suse.cz \
    --cc=frank@scirocco-5v-turbo.de \
    --cc=johannes@sipsolutions.net \
    --cc=linux-kernel@vger.kernel.org \
    --cc=petero2@telia.com \
    --cc=stelian@popies.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox