如果一维数组中有波峰和波谷,但是波峰会持续好几个同样的数值或者差异很小而不是只有一个数值,波谷同理,要去寻找这种类型的波峰波谷就会有点难度,数据类似这种:
[0. ,0. ,0. ,0. ,0. ,0. ,
0. ,0. ,0. ,0. ,0. ,0.,
0. ,0. ,0. ,0. ,0. ,0.00167902,
0.23939317 ,0.23939317 ,0.23939317 ,0.23939317 ,0.23939317 ,0.,
0. ,0. ,0. ,0. ,0. ,0.,
0.2423835 ,0.2435938 ,0.24378107 ,0.24212517 ,0.04351635 ,0.,
0. ,0. ,0. ,0.00046742 ,0.2389589 ,0.24335814,
0.24374051 ,0.2407499 ,0.04809693 ,0. ,0. ,0.,
0.24143921 ,0.24343102 ,0.24376021 ,0.24200544 ,0.04404309 ,0.,
0. ,0.04849761 ,0.23886044 ,