Peak detection in data streams is a very common problem and there are several general purpose algorithms to find peaks.
Save yourself from reinventing the wheel and Google "peak detection algorithms" or "peak finding 1d" for lots of leads.
Peak detection in data streams is a very common problem and there are several general purpose algorithms to find peaks.
Save yourself from reinventing the wheel and Google "peak detection algorithms" or "peak finding 1d" for lots of leads.