12-07-2006 10:01 AM
12-07-2006 10:24 AM
I view TC signals as very susceptible to noise glitches, so I'd want to make myself pretty insenstive to such outliers, or find a way to remove them first. An outline of the kind of thing I've done in the past:
1. Calc mean and std dev, then identify all points > 3*std dev's from mean. Remove them. (Personally, I'd make sure I used a population of >100 samples to start with). If more then, say, 5% of the population was removed, I'd acquire a new set of samples and start over with step 1.
2. On the remaining data, find the best fit straight line and evaluate the slope. If avg temp rate-of-change too large, return to step 1. If flat enough, continue.
3. Calc an average value of remaining data. With noise--susceptible data, I tend to prefer using a Median rather than a Mean. When the actual data is pretty well-behaved, the two types of average are very similar. Median are much less sensitive to glitches though.
Your filter idea could also work if you have a low enough cutoff freq and high enough attenuation rate to truly squelch the glitches. I don't think I've got the best intuition about filter choices and settings. I've gotten good results quicker with my brute-force approach, probably because I have a better intuitive feel for it. If you're good with filters, that's probably a better technical solution. I'd still recommend a best-fit line over dozens of samples as a simpler measure of average slope.
-Kevin P.