After obtaining potenial s2, sandp splits s2 if there're multiple peaks inside. To split one peak, it must find a local minimum which is lower than two nearby local maximum by a factor (currently set as 5). However, currently the max point is not the local maximum, since it's only updating when it finds a point that is higher than previous value by the same factor... thus the algorithm may miss some multiple s2 peaks.
After obtaining potenial s2, sandp splits s2 if there're multiple peaks inside. To split one peak, it must find a local minimum which is lower than two nearby local maximum by a factor (currently set as 5). However, currently the max point is not the local maximum, since it's only updating when it finds a point that is higher than previous value by the same factor... thus the algorithm may miss some multiple s2 peaks.