LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

downsampling of data

Solved!
Go to solution

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..?

0 Kudos
Message 1 of 17
(11,256 Views)

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.

0 Kudos
Message 2 of 17
(11,250 Views)

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.

0 Kudos
Message 3 of 17
(11,245 Views)

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.

0 Kudos
Message 4 of 17
(11,238 Views)

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..

0 Kudos
Message 5 of 17
(11,208 Views)
Solution
Accepted by topic author Ech

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.

Message 6 of 17
(11,188 Views)

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

0 Kudos
Message 7 of 17
(11,154 Views)
Hi Ravens Fan - could you possibly post your resample VI in Labview 8.0? I do not have 8.5 and am trying to do something similar. Thanks!
0 Kudos
Message 8 of 17
(11,013 Views)

Here it is in LV 8.0

0 Kudos
Message 9 of 17
(11,003 Views)
Thanks for the quick response and the program! 
0 Kudos
Message 10 of 17
(10,976 Views)