LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

removing common elements in 3 different arrays

Hello All,
I have two arrays with different data in each of them. However, due to some unknown hardware malfunction, every once in a while the data (collected from two counters) show a spike and this happens simultaneously in all the 3 counters I am collecting data from. I have shown in the VI I have attached with this plot, the spikes from 2 of the 3 counters. How can I delete these points from the counters. I cannot use a simple threshold based approach since there may be legitimate peaks in the counters. However, if a peaks occurs simultaneously in all the counters, then it is not a legitimate peak. So the question is how do you delete elements if those elements are common to 3 different arrays?
Please see
the attached Vi for the peaks.
Thank you,

KB
0 Kudos
Message 1 of 4
(2,409 Views)
Hello KB,

my first approach would be:
1) code a subvi giving you a boolean array that is true for "peak" and false for "no peak"
2) create an array for every 3 data arrays
3) AND the boolean arrays
4) now you should have a true for a peak at the same place in all 3 data arrays: discard this data item

You should think about the length of your data arrays (are they all the same length?). To detect peaks you can use a treshold, perhaps using moving average.

Hope this helps,
GerdW
Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 2 of 4
(2,409 Views)
Yes, all the arrays have the same number of data points (84600 points). This method of making 3 more boolean arrays increases the memory usage, does it not?
0 Kudos
Message 3 of 4
(2,409 Views)
Yes, it does indeed.

If memory consumption is a concern, you could feed one (for/while) loop with all 3 data arrays and do the checking/boolean stuff "in place". So you may avoid big arrays in memory, probably with a speed penalty (as usual...).

Best regards,
GerdW
...going to vacation in Tuscany tomorrow 🙂
Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 4 of 4
(2,409 Views)