peak detection algorithm

Google "peak detection algorithm" for lots of ideas.