the first vision of peak detection. I try to detect the value max of a array that the previous min point is lower than a threshold given.