I'm trying to understand this library on PeakDetection which, I feel, is using common peak detection approaches, with lots of words I do not understand, such as its inputs to its algorithm: lag,, threshold, influence... and z-score. peakDetection.begin(lag, threshold,influence);
The library outputs 0 for no peak, 1 for a peak detected and a -1 for a minimum detected.
But in the end of the github page there is an animated graph which I see a peak after signal rises slowly but which the library does not seem to identify as peak, so Im thinking theres much more to this to understand. The point to the right of center:
Each of the terms is explained in the library text .
The parameters mentioned seem to allow you to select a region of incoming data over which you average it and create statistical information from it You can then select how “far” ( standard deviations ) from that data average to decide a data point is a peak .
The point you mention is the output from calculations from the data region around it and might be correct as a minimum point
. The Human is often better at processing this stuff !!
Worth a google of average , standard deviation , Gaussian distribution .
Usually the peak is simply the highest sample, sometimes within a time-window, or within a moving time window (i.e. the peak within the last 30 seconds).
Of course, a moving window requires that you store the past-data for the period of time.
An analog peak detector analog peak detector charges-up a capacitor to the peak voltage and then it decays slowly. That makes it easy to read the peaks with a multimeter, or it's a way to make a peak meter for audio, etc.