02-02-2015 09:02 PM
Hi All
I want to acquire waveforms of 200us 10000 times and average them. I am using NI USB 6361 and Labview 2013. The problem is that it is not fast enough. With averaging each scan takes about 1 second. Here is my VI.
I tried using matlab instead of Labview. Matlab shows no advantage over labview. However I was using labview signalexpress previously. The time averaging in labview signal express is much faster than my labview vi and matlab. Could someone tell me how labview signal express achieve such an efficient waveform averaging?
02-02-2015 09:48 PM
The first thing I would recommend is to move away from using the Express VIs, while they make things easier they are quite often the cause of slow-downs simply because they have a number of additional processses that you are unlikely to use, they also make debugging quite hard for us as we cannot see any information about your processes inside the Express VIs.
Could you attach a copy of your vi so that we may be able to see what is going on?
Are you measuring samples at 200us intervals or are your collecting 200us length samples, if you are recording 200us length samples, what is your sampling frequency?
Why are you averaging the waveform at the end of each sample? It would be better to save the data until the sampling has been finished and preform the averaging once you have all the data.
02-02-2015 10:26 PM
The length of the waveform is 200us. I am averaging it at the end of each sample because I would like to monitor it in realtime. I attached my vi. Thank you.
02-03-2015 08:36 AM
The problem, it seems to me, is not well-posed. You have a waveform that is 200 micro-seconds long (how many points? What is the sampling rate?) and want to average 10,000 of them. It takes 0.000200 * 10000 = 2.0 seconds to collect this much data, so you are "looking backwards in time" for 2 seconds (unless you can "predict the future" and include future data in your average).
Note that averaging "smears out over time" any changes in your signal. For example, suppose it is a TTL (or "on/off") signal that changes from 0 to 1 at 1 second. If you average before the transition, you get 0. After the transition, you get 1. During the transition, you get a number between 0 and 1, depending on where in your average the transition happens.
In particular, if you choose to use a "moving average", your step change gets "smeared out" over two seconds, looking like a 2-second ramp instead of a step.
"You Pays Your Money, You Takes Your Choice".
Bob Schor
P.S. -- I might have missed something here -- if so, I apologize ...
02-04-2015 10:17 PM
400 points
2Mhz sampling rate
I am expecting a periodic signal that occurs every 200us(I am applying a microwave pulse every 200us. Signal should show up right after the microwave pulse). My DAQ will start acquire 200us for 10000 times everytime after it recieve the microwace trigger.
02-05-2015 12:56 AM
@ogk.nz wrote:
The first thing I would recommend is to move away from using the Express VIs, while they make things easier they are quite often the cause of slow-downs simply because they have a number of additional processses that you are unlikely to use, they also make debugging quite hard for us as we cannot see any information about your processes inside the Express VIs.
Could you attach a copy of your vi so that we may be able to see what is going on?
Are you measuring samples at 200us intervals or are your collecting 200us length samples, if you are recording 200us length samples, what is your sampling frequency?
Why are you averaging the waveform at the end of each sample? It would be better to save the data until the sampling has been finished and preform the averaging once you have all the data.
Looks like he's not averaging the waveform at the end of each sample, he's just adding all waveforms and then dividing by # of waveforms outside FOR loop.
Lihuang: if your intention is to watch averaging live in each loop then you'd have to correct your logic. I currently can't open your VI on my mac but looks like part of the problem is your logic in use of those Express VI. Subtracting/adding/dividing of 400 points waveform would be blazing fast by LabVIEW, I'd guess in microseconds depending on your computer.
(Is that code switching between channel 0 & 7 in each loop to get two waveform that you're subtracting? In that case acquisition hardware might also require extra settling time each time you switch channels. Also matters how acquisition is setup in each of those Express VI. )
-BTC
02-05-2015 01:26 AM
If you want to monitor something with a human eye on a monitor there are two things to keep in mind:
Refresh rate of the monitor and the GUI-backend (say 10ms to 20(? or 100)ms ) and how fast can a human eye track a change ? 50ms?
So build a producer consumer vi , init your DAQ once, use trigger and multiple records , add up all traces for 50ms , display the last trace, a 50ms mean and your 2s mean....
Do you know eye diagrams ? altenbach provided a nice solution here in the forum....
keep a 500x 500 array representing pixel intensity and add your traces there .... nice to see jitter 🙂