Quinn-Curtis Forums
Quinn-Curtis Forums
Home | Profile | Register | Active Topics | Members | Search | FAQ
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 Tools for Microsoft .Net
 Real-Time Graphics Tools for .Net (VB and C#)
 Data Smoothing of noisy sensor data
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

quinncurtis

1586 Posts

Posted - 02 Aug 2011 :  08:58:38  Show Profile  Reply with Quote
Question from a customer:

We need to plot many parameters on a vertically scrolling graph. Most of these parameters are raw sensor data with a lot of noise. So I was wondering if the chart has any filtering capabilities (particularly moving average filter)? I couldn't locate any information pertaining to this in the manual. Or should it be done on the dataset by code?

quinncurtis

1586 Posts

Posted - 02 Aug 2011 :  09:03:38  Show Profile  Reply with Quote
We do have some moving average routines built into SimpleDataset class, they are for use in the plotting of data after it is all collected, not while it is being collected in real-time. Real-Time smoothing is usually application dependent, and makes assumptions about the whether or not the data is equally spaced.

For noisy sensor data sample at a regular interval, we would only recommend exponential smoothing: http://en.wikipedia.org/wiki/Exponential_smoothing.

From the Wikipedia link above:
Exponential smoothing is commonly applied to financial market and economic data, but it can be used with any discrete set of repeated measurements. The raw data sequence is often represented by {xt}, and the output of the exponential smoothing algorithm is commonly written as {st}, which may be regarded as a best estimate of what the next value of x will be.

See the Wikipedia article for a mathematical description of the formula.

It is extremely simple to implement, before you update the RTProcessVar dataset. You need only to define a smoothing constant in the range (0 - 1.0). The closer the smoothing value is to 1.0, the less smoothing you get.

Implemented using our software, it looks something like:


' currentTemperature1 is the RTProcessVar object used to store the smoothed data
currentTemperature1 = New RTProcessVar("Temp 1", New ChartAttribute(Color.Green, 1.0, DashStyle.Solid, Color.Green))
.
.
.

Dim smoothingConstant As Double = 0.3

' The newly acquired sensor data is stored in newSensorValue
' Calculate the smoothed data value, using the smoothingConstant times the new sensor value, plus (1 - smoothingConstant)
' times the previous smoothed value.

Dim smoothedvalue As Double = (newSensorValue* smoothingConstant) + currentTemperature1.CurrentValue * (1 - smoothingConstant)

' Add the smoothed data to the currentTemperature1 RTProcessVar
currentTemperature1.SetCurrentValue(smoothedvalue)


Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
Quinn-Curtis Forums © 2000-2018 Quinn-Curtis, Inc. Go To Top Of Page
Powered By: Snitz Forums 2000 Version 3.4.07