P
P
pingo2021-11-04 13:33:56
Algorithms
pingo, 2021-11-04 13:33:56

Is there an efficient and not complicated algorithm for searching for pronounced peaks in 2D arrays without ML?

Tell me, for example, for such an array:

let arr = [
[4000.123, 0.0002250716, ],
[3999.641, 0.0002206956, ],
[3999.159, 0.0002314698, ],
[3998.677, 0.0002602464,],
//....... length 5678  
[2998.195, 0.0005059349,]
[2997.712, 0.0004620409, ]
..........
]

I tested different data, running it through simple conditions in reduses and loops, but it's not that. I get the data from the software connected to FTIR in the form of a csv file, but the software itself shows very clearly the main bursts. (exports in other formats - proprietary such as Perkin Elmer and so on, I did not find any libraries)
thanks if you put some common sense in this topic.

Answer the question

In order to leave comments, you need to log in

2 answer(s)
D
dmshar, 2021-11-04
@dmshar

As far as I know, there is no strict algorithm for searching for peaks in an arbitrary time series. Therefore, one should be content with empiricism.
Well, that's what I would do.
1. Fix the size of the sliding window.
2. At the first position of the window, I would look for the maximum.
3. Move the window so that it starts from the found maximum point.
4. Again, I would look for the maximum.
If the maximum on the first window remained the maximum on the second window, I would consider it a "pronounced peak". If not, repeat the procedure.
The issue of choosing the size of the sliding window is solved empirically.

R
res2001, 2021-11-04
@res2001

You can find the difference between neighboring elements. If the modulus of the difference is greater than some value - a pronounced peak.
The fixed value can be taken as the mean of the differences or the median or something else.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question