Googles appar
Huvudmeny

Post a Comment On: cbloom rants

"05-22-09 - Fast Means"

3 Comments -

1 – 3 of 3
Blogger ryg said...

Variant 4: Use an IIR lowpass filter.

The general form of an IIR filter is out(t) = a_0 * in(t-0) + a_1 * in(t-1) + ... + a_m * in(t-m) + b_1 * out(t-1) + ... + b_n * out(t-n); Variant 1 is a very simple (and bad) special case of this, but the points is that there's tons of know-how on designing good lowpass filters (=moving averages) that have a frequency response close to 1 in the passband (=the values you want to average over are summed with equal weight) and sharp cutoff (=the weights from "old" samples rapidly decrease past a certain point). IIR filter design is a fairly basic topic in DSP and control theory, so there's actually lots of usable introductory material around. A nice no-nonsense introduction to filter design is "Yehars digital signal processing tutorial for the braindead".

May 22, 2009 at 4:48 PM

Blogger cbloom said...

I dunno, my experience with signal processing filters has not been positive. I understand the basic theory, but turning it into something actually useful just seems like black magic.

May 22, 2009 at 5:42 PM

Blogger cbloom said...

I mean I'd love to have some little code to get a moving average with proper filter code, especially if it has parameters I can tweak to control how wide the filter is and how sharp the cutoff and all that. But every page I find on the net is like "you take the fourier transform..." ugh.

May 22, 2009 at 6:15 PM

You can use some HTML tags, such as <b>, <i>, <a>

This blog does not allow anonymous comments.

Comment moderation has been enabled. All comments must be approved by the blog author.

You will be asked to sign in after submitting your comment.