Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is there a standard approach to counting repetitions in an oscillating signal?

I am collecting sensor data from a repetitive physical process (think an elevator moving up and down). This is an example of what the signal looks like. The y-axis reflects our equivalent of 'height' and the x-axis is just time. Perhaps not surprising, this particular image reflects 5 repetitions of the process in question.

enter image description here

Although this particular example is quite regular, it is not always so, sometimes with small gaps in the data, jumps, or increased noise. Is there a standard machine learning or statistical approach to counting the number of repetitions for a given signal/data series? So far, our hand-written methods seem to top out at around 80% accuracy. We've also tried an LSTM approach, also with limited success.

like image 935
migsvult Avatar asked Oct 21 '25 09:10

migsvult


2 Answers

Have a look at the scipy function find_peaks. With it you can specify some threshold for the peaks to be detected, and spacing between them. Should work quite nicely for what yyou are looking for.

That of course, if the actual repeated signal you are hoping to detect is always present as a peak. If you are simply trying to detect potentially any pattern that repeats itself in the signal perhaps you could take the convolution and look for the peaks of that instead.

like image 118
yatu Avatar answered Oct 24 '25 09:10

yatu


You could try first using autocorrelation to find matching repetitions within the signal; and then feed the autocorrelation results to a ML algorithm for thresholding any found correlation peaks above the noise.

like image 44
hotpaw2 Avatar answered Oct 24 '25 10:10

hotpaw2



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!