Hello,
I'm not sure I understood completely your question.
The example you mentioned is making some peak detection in a waveform, that in the case is a sine wave. To use it in your own signal, you must take care about the following:
- First, this is a point-by-point peak detection, it cannot wire there an array and expect the results from the peak detection of that array, but you mentioned that your data is being displayed in a waveform chart, so I think this ois ok for you.
- You have to take care for the values in width ant threshold, thershold is easy - your peaks must have an amplitude bigger than that value to be detected (try changing it to 12 in the example - no peak will be found). Width is the minor peak width it will detect - this can be used to avoid that some noise will be interpreted as a peak (try changing it to 100 in the example - no peak will be found).
- The arrays that the function is returning are: Peak locations (the index of the peak in your data), Amplitudes (The amplitude of the peak) and 2nd derivatives (the value of the second derivative of the signal at that peak point).
The arrays you mentionning out of the while loop are just some treatment to display the peaks in the XY graph (you see some red squares in the graph).
So if you want to search for the location of the peaks just look at the peak locations array.
If you're looking for peak amplitudes look at the amplitudes array.
If you're looking for number of peaks found, look at the #found indicator.
Hope this helps,
Paulo