An implementation of a peak detection algorithm referenced at the bottom of the page. Peaks are detected when a new data point is x amount of standard deviations [the threshold] away from a moving mean. For new points that trigger peak detection, the influence determines the affect they have on the moving mean. Click on the below graph to add points, a minimum of 5 points [lag] are required to generate the moving mean.