11-12-2014 01:28 PM
Hi,
I have a question on how to detect peak region. Let's say I have a parameters named floor value ( for example 0.0002 ) in the following graph.
As you can see there are 2 regions above that floor value ( graph number of points is 64 )
How can I detect peak regions ( 2 in this example ) because if I search for values above 0.0002 there are many points
How can I get the following data from this graph>>>>> peak 1 , starts from 18 to 26 . peak 2 starts from 32 to 37
THanks
11-12-2014 01:47 PM
depending on the form of your data, try:
http://zone.ni.com/reference/en-XX/help/371361J-01/lvwave/waveform_peak_detection/
--- or --
http://zone.ni.com/reference/en-XX/help/371361H-01/lvanls/peak_detector/
11-12-2014 07:23 PM
11-12-2014 09:01 PM
Hi Zwired1. Thank you for your reply
I don;t think this function gives me what I need. I would like to detect consecutive numbers above a certain value and bundle them into 1 peak regoin , then goto the next one . I don't want just the peak value and it's index.
for example in that graph I have 2 peak regions
Peak 1 region, starts from X value 18 to 26
Peak 2 regoin, starts from X value 32 to 37
11-12-2014 09:23 PM
Missed the part about wanting the x ranges where y was above threshold rather than just the peak locations.
Depending on how much data you have to go through the attached may be faster than Boolean crossing pt by pt. The attached tests the entire data array for ">threshold?" and the while loop only has to loop once for each crossing. Boolean crossing pt by pt. would require you to loop for each point in your array. This presumes, of course, that you have all of your data before you start your analysis.
11-12-2014 09:45 PM - edited 11-12-2014 10:11 PM
Have you considered a simple for loop?
Start iterating through loop, once you get above a threshold start adding positions to an array, then once you get below threshold again generate a new array.
[EDIT]
So I found a solution. And it works pretty well although there is probably a better way of tidying up the logic.
11-12-2014 11:30 PM
Interesting. Hadn't tried conditional tunnels yet.
Attached is a VI I wrote before I saw your last. It runs it three different ways on 100k data points. Not a lot of difference, and I can't imagine milliseconds will make a difference here, but it illustrates the power of operating on arrays instead of one by one.
11-13-2014 10:07 AM
Also note that the special case when the last point is greater than the threshold value need to be taken care of. As an exemple if we have the following array 0,0,0,0,0,1,1,1,1,1,1 none of the method suggested will indicate a "peak" between index 5 and 10. Note that this can depend of what we define as a peak in this case.
Ben64