I have an array, for them I built a graph, now I need to get those values
which correspond to the "hills" and preferably an index. How do i do this better? enter image description here

  • I think that it would not hurt to add some tags related to mathematics and / or signal processing, perhaps then the answer will be received by you faster. Offhand, extremes are searched for the zeros of the first derivative ( f'[t]=(f[t]-f[t-1])/delta ), slides where it changes sign from "+" to "- when changing to zero, - ". But first, most likely, do some smoothing filtering. - i-one

1 answer 1

In my opinion, nothing better than the decision "in the forehead" is not here.
The signal contains pulses greater than zero. They need to look.
Thus, to search for "hump":

  1. Set the threshold, the excess of which we assume that the value in the signal differs from zero (for example, 0.1).
  2. We set the threshold for permissible impulse nonuniformity (for example, 0.01).
  3. Set the minimum pulse duration (for example, 30s).
  4. We find the successive values ​​of the signal that meet the conditions of paragraphs. 1-3 (for example, values ​​fluctuate in the range of 0.948..0.950 over 30 s) - this is the beginning of the pulse.
  5. Find the value less than the threshold from p. 1 - this is the end of the pulse.
  6. Repeat paragraphs 4-5 to search for the next pulse.
  • And can the code of the fire is - SVD102
  • @ SVD102 The code is not ready to write - in my opinion, there is enough information in the above algorithm for its implementation. If something is unclear - I can explain. There was also a similar question: ru.stackoverflow.com/q/493973/201103 . There are code samples in the answers to this question. - Konstantin Les