LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Need help on Proper LabVIEW data smoothing technique

Hello,
 
I am wondering if anybody can shed the light on proper way to smooth the data collected from an analog input.  I am collecting a channel with 100 Samples to Read and at a rate of 1000 Hz.  My intention is to average the 100 samples and treat the average as one data point of one iteration of my While loop.  The next time of my While loop executes, it averages another 100 samples, and treat the average as one data point, and so on. 
 
The way I'm doing it now is as follows:
 
DAQ Express VI ----> Collector (from Signal Manipulation pallette)  ------>  Statistics (Arithmetic Means from Signal Analysis pallette)
 
----> Convert from DDT to 1-D array of waveforms.
 
But in doing so, I loose the time information of my waveforms, i.e. the data coming out from "Convert from DDT to 1-D array of waveforms" is always one data point with t=0 for each iteration of my While loop.  The t value is always 0.  This is not my original intention.  All I want is to smooth the data from my data collection by averaging the sampled data and preserve the time stamp.  How can I achieve this?  Thanks for any pointers.
 
 
0 Kudos
Message 1 of 4
(3,319 Views)
Hi,
 
The Attached VI will acquire and avg 100 samples on each iteration (using DAQmx functions )
 
Regards
 
Dev
 
 
 
Message 2 of 4
(3,318 Views)

Hi Devchander,

Thank you very much for your reply.  I've tried your attached VI and the end result is essentially the same as mine.  If you plot the resulting average values, your time stamp (x-axis) of your chart stays constant at 0 sec, i.e. you loose the time information when you average the values.  Is there anyway that we can average the value and still preserve the time information?

Regards

Peter

0 Kudos
Message 3 of 4
(3,299 Views)
Hi Peter,
 
The best option would be a moving average technique.
I am attaching some examples that do moving average with simulated signals.
 
You can implement this logic in your application
 
Regards
Dev
 
 
 
 
Download All
Message 4 of 4
(3,296 Views)