LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Apply Multiple filters on 2D array of data

Hello all,

I was hoping if anyone can help me with a small algorithm.
I have an array of numeric data as an input and based on a condition i output the indices of the array which pass the condition i.e array of indices as an output.
Now i want to apply another filter on the filtered data, i have been scratching my head on this trivial problem, any help will be much appreciated!
Attached is the test vi with single filter. 

0 Kudos
Message 1 of 4
(2,658 Views)

Just chain up the filters. 🙂 You can filter the data at the same time as you check the index.

Filter data.png

G# - Award winning reference based OOP for LV, for free! - Qestit VIPM GitHub

Qestit Systems
Certified-LabVIEW-Developer
0 Kudos
Message 2 of 4
(2,630 Views)

Thanks for the reply! I think i didn't make it clear enough, i was thinking in the direction of having "filter parameters in an array" and looping over all the "filter parameters" (on different columns) and in the end output filtered indices of the original array.

0 Kudos
Message 3 of 4
(2,627 Views)

This is textbook OO polymorphism (composite pattern).

 

+ Make a filter class.

+ Inherit filters from it.

+ Give each child it's own init that set's it's parameters.

+ Make a composite child that executes an array of filters (the init takes an array).

 

The code using the filter won't know (and doesn't have to know) if it's a single filter or a composite (if you don't want it to).

0 Kudos
Message 4 of 4
(2,562 Views)