This is a Python implementation of the [Robust peak detection algorithm](https://stackoverflow.com/questions/22583391/peak-signal-detection-in-realtime-timeseries-data/22640362#22640362) algorithm.
2
3
The initialization and the computational parts are split up, only the `filtered_y` array has been kept, that has a maximum size equals to `lag`, so there is no memory increase. (Results are the same of above answers).
4
In order to plot the graph, also the `labels` array is kept.