Quinn-Curtis Forums
Quinn-Curtis Forums
Home | Profile | Register | Active Topics | Members | Search | FAQ
 All Forums
 Tools for Microsoft .Net
 Real-Time Graphics Tools for .Net (VB and C#)
 Data Smoothing of noisy sensor data

Note: You must be registered in order to post a reply.
To register, click here. Registration is FREE!

Screensize:
UserName:
Password:
Format Mode:
Format: BoldItalicizedUnderlineStrikethrough Align LeftCenteredAlign Right Horizontal Rule Insert HyperlinkInsert EmailInsert Image Insert CodeInsert QuoteInsert List
   
Message:

* HTML is OFF
* Forum Code is ON
Smilies
Smile [:)] Big Smile [:D] Cool [8D] Blush [:I]
Tongue [:P] Evil [):] Wink [;)] Clown [:o)]
Black Eye [B)] Eight Ball [8] Frown [:(] Shy [8)]
Shocked [:0] Angry [:(!] Dead [xx(] Sleepy [|)]
Kisses [:X] Approve [^] Disapprove [V] Question [?]

 
   

T O P I C    R E V I E W
quinncurtis Posted - 02 Aug 2011 : 08:58:38
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?
1   L A T E S T    R E P L I E S    (Newest First)
quinncurtis Posted - 02 Aug 2011 : 09:03:38
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)



Quinn-Curtis Forums © 2000-2018 Quinn-Curtis, Inc. Go To Top Of Page
Powered By: Snitz Forums 2000 Version 3.4.07