ni.com is currently undergoing scheduled maintenance.

Some services may be unavailable at this time. Please contact us for help or try again later.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How to extract elements with a fixed interval from a 1D array

Solved!
Go to solution
Solution
Accepted by topic author HerbMa

Cory K wrote:

What would you like to use to determine the spacing?

You can make it variable using a control, or some other value from your block diagram.

 

See the attached example.


 

Hello C.Clad

I like your Vi but from 8.2 Labview actually has this function.

Decimate (single shot) VI
Owning Palette: Signal Operation VIs

Installed With: Full Development System

Decimates the input sequence X by the decimating factor and the averaging Boolean control

And the to be honest I discovered my self by an accident in Labview 8.6. So yes I did also sleep somewhat in class. The nice thing about this function is that it let choose if you want to just pick out samples or use the average sum between each "down sample" interval  



Besides which, my opinion is that Express VIs Carthage must be destroyed deleted
(Sorry no Labview "brag list" so far)
0 Kudos
Message 11 of 20
(2,788 Views)
That is what I am looking for. Thanks for everyone's help!
0 Kudos
Message 12 of 20
(2,773 Views)

Coq Rouge wrote:

 

Hello C.Clad


Did you mistakenly call me 'Clad' or was that a running joke from here? Smiley Very Happy

Cory K
0 Kudos
Message 13 of 20
(2,758 Views)

Cory K wrote:

Did you mistakenly call me 'Clad' or was that a running joke from here? Smiley Very Happy


hu.gif 

I am quite disappointed C. You should know now that I am always 100 serious in this forum. The Labview forum is way to important for pranks and tricks........Smiley Indifferent 

 

 

Smiley Very Happy



Besides which, my opinion is that Express VIs Carthage must be destroyed deleted
(Sorry no Labview "brag list" so far)
0 Kudos
Message 14 of 20
(2,737 Views)

OK, I know this is late but I just stumbled on this thread as I was looking for something similar.  Here is another stab at decimation (homemade).  This VI runs about 4-5x faster than the VI pointed out by Coq.  It doesn't have the ability to select the initial index at which to start decimating, nor does it have bounds checking, but this should be fairly straightforward to implement.  It's similar to Cory's solution but uses the array indexing on the bounds of a for loop to improve performance.

 

Just thought someone might be interested.

 

Peace, Matt

 

decimate.png

0 Kudos
Message 15 of 20
(2,611 Views)
Is there a performance difference to my second solution? I would expect both solutions to have similar performance. However your solution might be faster, because of some implicit coding which is faster than my explicit suggestion.
0 Kudos
Message 16 of 20
(2,568 Views)

Maybe this implementation (if you don't mind the coercition dots) which takes into account the starting index?

 

0 Kudos
Message 17 of 20
(2,541 Views)

Your image is pointing to your hard drive.

 

The easiest thing to use is the 'Upload or insert an image on the toolbar above.

0 Kudos
Message 18 of 20
(2,539 Views)

Ok thanks...I've done a copy&paste.  The image was showing on my side.  Here's the "real" image:

 

 moz-screenshot-1.png

0 Kudos
Message 19 of 20
(2,530 Views)

Jorn,

 

The indexing on the bounds of the array is about as fast as the example you provided.  Interestingly enough, adding the routine as a subvi adds considerable overhead.

 

Peace, Matt

0 Kudos
Message 20 of 20
(2,520 Views)