I am ploting data from serial port.
Want to detect peak count and manually marking peaks code wrt time on xaxis.
Any suggestions or example code would be very helpful.
-Thanks & Regards,
Mukesh.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Peak Counting is typically a local maxima problem. The simplest algorithm divides the time into discrete intervals. For each interval, find the maximum. You will then have one peak for every interval. Then you can plot your peaks.
There are other algorithms that get more sophisticated, but how you do it depends on exactly what you consider a peak. For instance, you may want to only count a maxima as a peak if it has a sharp angle that exceeds a certain threshold. In that case, you could apply that condition as a filter to the first simple algorithm. The result will be that some of your discrete time intervals don't have a peak while others have one peak.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I am ploting data from serial port.
Want to detect peak count and manually marking peaks code wrt time on xaxis.
Any suggestions or example code would be very helpful.
-Thanks & Regards,
Mukesh.
Peak Counting is typically a local maxima problem. The simplest algorithm divides the time into discrete intervals. For each interval, find the maximum. You will then have one peak for every interval. Then you can plot your peaks.
There are other algorithms that get more sophisticated, but how you do it depends on exactly what you consider a peak. For instance, you may want to only count a maxima as a peak if it has a sharp angle that exceeds a certain threshold. In that case, you could apply that condition as a filter to the first simple algorithm. The result will be that some of your discrete time intervals don't have a peak while others have one peak.