GMM
2009-01-15 by David VanHorn
I'm playing with an idea to make sense of analog sensors. This is borrowed from a technique for background supression in video cameras. Having trouble figuring an economical way to do the means and standard deviations. Take a single analog input, sampled at some appropriate rate. Allocate N (call it five for now..) slots for mean and standard deviation, and "strength". When a new sample arrives, for each of five means, test wether the sample falls within two standard deviations of a mean. If so, then "strengthen" that mean, and recalculate it's standard deviation. If not, then kill the "weakest" mean, and start a new one with this samples value as the mean, and some appropriate guess at standard deviation. I've got code that buffers 50 samples on two inputs, and calculates mean and standard deviation, and "alarms" when either of the input falls outside 2sd, but the thing is computationally intensive, and I'm told that the video guys do NOT keep N frames of data (which makes sense, as it would get enormous FAST). Rather they have some method of figuring a mean and standard deviation without history data... Does that make any sense? How could I implement a function like that? -- "The very powerful and the very stupid have one thing in common. Instead of altering their views to fit the facts, they alter the facts to fit their views... which can be very uncomfortable if you happen to be one of the facts that needs altering." Doctor Who, Face of Evil