LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Assistance Needed: Averaging N Amount of Waveforms

Solved!
Go to solution

Hi,

 

Firstly, I apologies for re-posting this subject, but I haven't had the help I needed the last time I asked, probably because I didn't state clearly what my problem was. So here goes....

 

What I need is for some genius here to show me how to average N amount of waveforms. I am measuring fluctuations in current over a specific time window (this depends on the amount of samples and of course the sampling rate I use).

 

Currently, I'm recording N amount of waveforms (time series), but what I want to do is to only record one averaged waveform, e.g. n1+n2+n3/N (N=3).

 

I gave this a go using a for loop but it didn't give me the results I want (I know what is wrong with it but don't know how to produce the averaged waveform).

 

In summary to be as clear as I can be,

 

1) I'm recording N waveforms from the DAQ Assistant

2) I want to collect these in a queue and then take the average of the N waveforms

3) Record the averaged waveform to my Write Measurement Function.

 

Attached are 2 LabView versions of my project.

 

I'd really like to have this up and running this week if possible and would really appreciate the help in modifying my vi.

 

Many thanks for reading!

 

AT 12. 

Download All
0 Kudos
Message 1 of 40
(2,902 Views)

I haven't messed with averaging waveforms much, but does this work?

 

 

Message 2 of 40
(2,892 Views)

Huge thanks for the rapid response! I will try it out and come back to you asap. Smiley Happy

0 Kudos
Message 3 of 40
(2,886 Views)

Any chance you could upload the vi, so I can figure out what's what?

0 Kudos
Message 4 of 40
(2,883 Views)

I'll just tell you; if you find it yourself in the palettes (use the "search" feature which the palette provides) you will be more likely to remember everything and where they are. There is a for loop, a numeric control, convert from dynamic data, an add function, and a shift register. Configure the convert from dynamic data to be a scalar waveform (you do this by double clicking on the node). The shift register you get by right clicking the loop and selecting add shift register. The add function is just a standard add function, and it will add the error terminals to itself when you wire up a waveform. Let me know if you can't find anything specifically.

Message 5 of 40
(2,880 Views)

Hi,

 

I'm not sure if I've done it right - a screenshot is uploaded and a modified vi - I think this is what I had done.

 

 

If I put, 25 say, in the numeric control it just cuts each waveform saved to the first 25 points. It doesn't average them, as in my recorded data are still 25 waveforms instead of 1!

 

Any ideas? My hunch is a queue would be required.

 

AT12.

Download All
0 Kudos
Message 6 of 40
(2,872 Views)

Any other ideas anyone?

0 Kudos
Message 7 of 40
(2,846 Views)

Is this really a hard thing to achieve on LabView? Considering you could do it with a calculator (if you had the time) I'd have thought it could have been done?

 

Is it worth my time and effort to continue with this?

0 Kudos
Message 8 of 40
(2,831 Views)

I think this is what you are going for.

 

You should be dividing by how many acquisitions you have made.  The FOR loop isn't needed.  Your shift registers should be on your while loop.  On the first iteration, initialize to the first set of acquired data.


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
Message 9 of 40
(2,829 Views)

Hi,

 

Many thanks for what you've done - greatly appreciated.

 

There is still a problem though....

 

It doesn't give me any averaged I(t) data, and it gives me multiple sets of PSD data at the end?

 

Am I doing something silly? I've ran it with 0 in the shift register constant and with numbers in it, to the same effect - no I(t) data.

 

Thanks very much once again,

 

AT12.

0 Kudos
Message 10 of 40
(2,821 Views)