NI Home
Cart Cart | Help
Hello Events Academic NI Developer Zone Support Solutions Products & Services Contact NI MyNI
You are here: 
NI Home > NI Developer Zone > NI Discussion Forums


Reply
Member
chrisharris
Posts: 30
0 Kudos

Remove data samples from an array

Hi All,

 

I am developing a VI which reads data, using the 'Read Data [Channel]' block, from a 'Open Data Storage [MATLAB]' block. There is a total of four channels and I have a very high number of data samples per channel which I am importing (order of millions). I wish to reduce this by only taking in every (n)th data point in each channel. Does anyone have any suggestions as to how this can be achieved? 

 

I am using LabVIEW 2011.

 

Thanks in advance for any help.

 

Chris

Active Participant
Henrik_Volkers
Posts: 1,740
0 Kudos

Re: Remove data samples from an array

What you are looking for is the decimate vi.

In your case probably the

Decimate (continuous) VI

Owning Palette: Signal Operation VIs

Requires: Full Development System

Continuously decimates the input sequence X by the decimating factor and the averaging Boolean control. Wire data to the X input to determine the polymorphic instance to use or manually select the instance.

 

Read your data in blocks , pass it through the decimate vi and work with the reduced data.

If you are not directly storing the smaller data blocks, try to allocate the data arrays first and use the inplace structure  to avoid to run out of memory due to continous memory reallocation of the increasing array.

Greetings from Germany
Henrik

LV since v3.1

“ground” is a convenient fantasy

'˙˙˙˙uıɐƃɐ lɐıp puɐ °06 ǝuoɥd ɹnoʎ uɹnʇ ǝsɐǝld 'ʎɹɐuıƃɐɯı sı pǝlɐıp ǝʌɐɥ noʎ ɹǝqɯnu ǝɥʇ'
By using this web site, you accept the Terms of Use for this web site. Please read these Terms of Use carefully before using any part of this site. Please go here for information on ni.com's copyright infringement policy.
My Profile | Privacy | Legal | Contact NI © 2011 National Instruments Corporation. All rights reserved.    |    E-Mail this Page E-Mail this Page