07-09-2009 07:49 PM
Hello.
I am trying to downsample dynamic data acquired with the DAQ Assistant in LabVIEW. Specifically, the data is acquired at a sampling rate of 20000Hz, and I want to downsample the acquired data to 1000Hz, before writing/saving it to a file. There is a discussion on this topic between samfrancis33 and mikeporter, in which the latter suggests passing the array of acquired data into a loop and keeping only every nth element of the array (n being equal to 20 in my case, for example). I have been trying to implement the method suggested by mikeporter, but have not been able to do so..: would anyone be able to help me out..?
Solved! Go to Solution.
07-09-2009 08:25 PM
Perhaps you could post a link to this discussion you are talking about?
Also, post the VI showing what you've done so far and explain where you are having problems.
07-09-2009 08:34 PM
Hi Ravens Fan, and thank you for responding.
Here is the link to the discussion that I mention: http://forums.ni.com/ni/board/message?board.id=170&message.id=278282&query.id=313924#M278282
And I have attached my VI, too. In that VI, I want the downsampling to occur before the data are plotted and written to the measurement file.
07-09-2009 08:56 PM
In order to do what Mike was talking about in that thread, you would have to convert your dynamic datatype to waveforms. Unbundle the array, rebuild the array with every 20th data point. Bundle the array back into the waveform and then convert back into the dynamic datatype.
With less trouble I would try the Subset and Resample Express VI inside Signal Express>>Processing>>Analog palette. No subset, Resample checked, linear with a dt of 1m. See how that works.
07-10-2009 05:01 PM
Hi again, and thank you again.
OK.. Hmm.. I am still quite the beginner in LabVIEW, so I have a few questions about the first method that you suggest..
When you say "unbundle the array", do you mean extracting the Y component from the waveform (using the "Get Waveform Components" function)?
Furthermore, and maybe most importantly, how do I extract every 20th element from my data? That is actually where I am stuck.. I am thinking that it may involve using a loop (a For Loop?) and the "Index Array" function, but I am not sure..?
As for the second method, I only have the Base Package of LabVIEW, which does not include the "Subset And Resample" Express VI, so, unfortuntaley, I cannot try that method..
As a matter of fact, there apparently is a "Decimate (continuous)" function, which seems to do exactly what I want/need, but, there again, that function is not included in the Base Package..
07-11-2009 12:12 AM
Well that stinks. By only having the base version, it sounds like you lost some functionality.
See the attached VI for what I was talking about with unbundling the Y array and rebuilding it back in.
07-13-2009 07:47 PM
Hello.
Thank you very much for the VI that you attached! I used it to build a SubVI which I then integrated into my data acquisition VI. And it appears to work and to do exactly what I want it to do. Again, thank you so much for your help, I truly appreciate it.
Best regards,
Gilles
09-07-2009 04:32 PM
09-07-2009 09:04 PM
Here it is in LV 8.0
09-08-2009 07:05 AM