LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Averaging Multiple Signals

Hello Everyone, I am currently working with real-time SSEP biomedical signals which are received via electrodes, transmitted using Xbee after processing through amplifiers and filters, and then read by LABVIEW using VISA functions. The data points are in hexadecimal converted into voltage value (time-domain).
The averaging process of the signal consists of averaging multiple trails of the same signal a specific number of times (e.g. 1000 times). Each trial is a complete SSEP signal, this is called one epoch, consisting of a specific number of sample points [e.g 200 points].
Example:
Averaging process = Sum (Mth data sample point of Nth trail) / Number of total Trails
I am attaching a sample image explaining the average process. [trail = epoch]
I was hoping someone could help me figure out a way how to store each trial separately (building arrays for 1000 trials might not be feasible?) and then average with all the other trials (epochs).

0 Kudos
Message 1 of 6
(3,703 Views)

A 200x1000 array doesn't seem that bad, as long as you initialize the size beforehand.  Do you really need to keep all of the epochs until the end?  Maybe as you acquire them, you can perform a running sum?

Randall Pursley
0 Kudos
Message 2 of 6
(3,662 Views)

I am fairy new to LabView. How do you initialize and write the real-time streaming data into the array ? 
To answer your question, yes I need to keep the data average it then show it on a graph and also write it the unaveraged array points into a spreadsheet as well. 

0 Kudos
Message 3 of 6
(3,632 Views)

correct if i am wrong what i understand is that you want to first store your data in 2D array . in rows you save mth samples and the number of col represent the no. of trials.

 

now you want to sum each trail samples and then divide it by no. of trails like if you have 100 samples in trail and you have 6 trails so that would be

     sum (sample values of trail 1) /total no. of trials  = sum (100 samples values)/6

 

if my understanding is correct then i will attach the vi which i have made. it is doing the above mentioned work

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

Tirmizi,

 

Your understanding is probably not correct. The summation is not over all the points in one trial but the first points of all trials are summed. Then the second points of all the trials are summed separately. After going through all the data the result is an "average" trial. The concept is that the signal to be analyzed is the same in every trial while the noise is uncorrelated between trials. So the average enhances the signal and reduces the noise.

 

Typically the data would be acquired as a 1D array representing the samples for one trial (200 points in the OP). Then the trials would be accumulated into a 2D array by replacing rows for each trial. After the acquisition the averaging could be done very easily by autoindexing and adding.

 

The attached VI shows a simple example.

 

Lynn

Message 5 of 6
(3,585 Views)
thanks for clarification
0 Kudos
Message 6 of 6
(3,578 Views)