The algorithm detects peaks given a specified threshold