01-29-2015 07:18 PM
Hello everyone,
I have just used the peak detector VI on 1-D array with a threshold. I now have an array of indexes which I need to round in order to use as an actual index. My question is, with this array of indexes corresponding to peaks, how do I grab those peak values
To give some context:
1. I have three time correlated signals. I filter them, normalize them, then add them so that I can increase the S/N ratio.
2. Peak DetectionVI gives me an array of where these peaks are
3. I want as my end result
A. Signal1[peak_indices]
B. Signal2[peak_indices]
C.Signal3[peak_indices]
Now I am thinking about this in the way i would code it in MATLAB which is way easier, however I would like to do this in Labview and would greatly appreciate any insight.
Thanks,
-Joe
Solved! Go to Solution.
01-29-2015 07:25 PM
As you have said, once you have rounded the peak locations to the nearest value you have an array of indexs. From there it should be a simple matter of passing that array into a for loop that auto-indexes the results that you have passed out to generate an array of the peak values.
01-29-2015 07:28 PM
Thanks for your prompt reply. I guess I was just hoping there was a non-loop way to do that, but I'll accept that as the best way to do it.
Thanks,
-Joe
10-24-2018 11:48 AM
There's an OpenG function called "Index ID array elements" in the OpenG array group that is essentially the for loop that ogk.nz showed, but in a subfunction.
10-24-2018 12:48 PM
I guess I don't understand is the problem.
What's wrong with just using the array of amplitudes coming out of the peak detector?
Unless all signals are similar in amplitude and noise, I would normalize after adding them, not before.
A for loop is one of the simplest and most efficient structures, so it is not something that should be avoided. Any primitive that operates on arrays has to loop one way or another, even you don't see it on the surface. 🙂 (Only on an FPGA you can process an entire array at once. :D)