We closed this forum 18 June 2010. It has served us well since 2005 as the ALPHA forum did before it from 2002 to 2005. New discussions are ongoing at the new URL http://forum.processing.org. You'll need to sign up and get a new user account. We're sorry about that inconvenience, but we think it's better in the long run. The content on this forum will remain online.
IndexProgramming Questions & HelpPrograms › Smoothing Data
Page Index Toggle Pages: 1
Smoothing Data ? (Read 575 times)
Smoothing Data ?
Oct 27th, 2008, 12:21pm
 
Can anyone tell me an easy solution for smoothing data for a graph? I am reading in temperatures from 2 temp sensors (DS18B20) and the temperatures are read everyu 30 seconds. When plotted on a graph the trace is very rough as the temperature goes up and down by approx 0.5 degrees from time to time (I am presuming it is noise somewhere).

What is a good way of smoothing the data out to give a smoother and more accurate trace on the graph please?
Re: Smoothing Data ?
Reply #1 - Oct 27th, 2008, 3:55pm
 
OK I think I am able to answer my own question. I am going to use a 'moving average' of the data by averaging a set of 5 data points to include the 2 before and after the point in the array, e.g. :-

([D-2] [D-1] [D] [D+1] [D+2]) / 5


On some test data this smoothed the graph nicely.
Page Index Toggle Pages: 1