On Saturday 17 September 2005 16:43, Paul Kahler wrote: > I'm not trying to flame, but why would you be using a moving average > filter? That's the most complicated filter I've ever seen - it calls > other functions!
It calls some of the methods of the deque datatype. I'm sorry! That's the implementation my limited skills came up with. I chose 4 filters from one of my textbooks: Exponential, Double Exponential, Moving Average and Noise Spike. That's what the author of the textbook called them. Both of the exponential filters are IIR filters. > I always liked the simplicity of a low pass filter: > > output += (measurement - output) * gain; > > Using floats, doubles, or fixed point of course. You are welcome to add this filter (or any other filter that you think might be usefull) to the already existing filters. > > No need to call a function either, just in-line it where you need it. > Want fast convergence on startup? Just sweep the gain from 1.0 down to > whatever the steady state value needs to be. I bet this is nothing new - > it's probably in the code under "else if (filterType == IIRfilter)" or > something. > > So why do people use moving average filters? "The Scientist and Engineer's Guide to Digital Signal Processing" says about the moving average filter that it is the most common filter in DSP, because it's easy to understand and use. It's optimal for reducing random noise, while retaining a sharp step response. http://www.dspguide.com > Why does FGFS? The best I can think of is why not? -- Roy Vegard Ovesen _______________________________________________ Flightgear-devel mailing list [email protected] http://mail.flightgear.org/mailman/listinfo/flightgear-devel 2f585eeea02e2c79d7b1d8c4963bae2d
