Signal Conditioning

cancel
Showing results for 
Search instead for 
Did you mean: 

how to calculate moving average of the waveform data

Dear all,

I am  a newbie in the labview. I am using C-DAQ NI9237 for data acquisition from 2 wheatstone full bridge . So i have a program written read two signals from two channels . After that i have filtered using two filters. First using low pass filter with cutoff at 100 Hz and after that the waveform data is passed through bandstop filter with 58 and 62 cutoff. Since i have fluctuations in my data. I want to take moving average to smooth out my data that is in the form of waveform.

 Well i could find one of the examples of moving average in NI site but it was an example using data as  arrays only . But in my case,  its the waveform signal i have as data instead of array .The Ni moving average example is exactly  what i intend to do to my filtered waveform signal.  Also note that i did find a filter too do smoothing from express vi . But what i want to try is to modify my program to do moving average similar to the National instruments moving average example.

 

I have attached my VI as well as NI moving average example.  Can anyone help me ?

 

Thanks. Any good suggestions will be highly appreciated.

 

Note: Attachment 

1. Is my own vi or program written to read two channels at the same time .

 

2. NI instruments moving average example.

 

 

Sachet

 

Download All
0 Kudos
Message 1 of 6
(4,540 Views)

Just to clarify what you are having an issue with, you want to put the two codes that you have attached here together?

0 Kudos
Message 2 of 6
(4,511 Views)

Yes, thats correct.

0 Kudos
Message 3 of 6
(4,509 Views)

Do you want to only display the data or store it to a file as well?

0 Kudos
Message 4 of 6
(4,475 Views)

Both actually. Thanks.

0 Kudos
Message 5 of 6
(4,472 Views)

You should take the inner workings of the moving average out of the while loop and make it into a subVI to conserve space. You should thenput the initializations for the moving average on the outside of the while loop of your main VI and pass them into the subVI. You should also create an input terminal so you can pass new data into the subVI to be averaged.

0 Kudos
Message 6 of 6
(4,453 Views)