3

I have a periodic signal generated by accelerometer sensor and I need to count the number of peaks. However, I can't predict when the periodic sequence starts and ends. What would be the best way to do this if expected frequency of the useful signal is between 0.2Hz - 5Hz?

Here is the example of the signal - five squats. enter image description here

  • 1
    Are you sampling the sequence? If so, at what rate? That is, how many samples per second? Does the signal repeat periodically (if so, do you know the period?) or does periodic signal mean that the signal "looks" like a (possibly decaying) sinusoidal signal of frequency between $0.2$ and $5$ Hz preceded by a brief start-up transient, (and you don't know when it starts up)? And what you would like to detect and count the number of peaks in the signal? – Dilip Sarwate Nov 26 '12 at 12:47
  • Do you mean that you don't know how long the period is? – Jim Clay Nov 26 '12 at 13:15
  • The sampling rate is 50Hz and I'm trying to calculate the repetitions in pushups, squats etc... That's why I'm assuming periodic signal with this kind of frequency. Yes. There is a transient period at the start and at the end, that I can't control, i.e. when person activates the sensor and lays down on the floor. – Mykola Pavlov Nov 26 '12 at 13:20
  • @JimClay I can't control the duration of overal process. However, the frequency of useful signal is limited to the nature of the physical exercises. I'm assuming that 0.2 to 5 Hz is more than enough. – Mykola Pavlov Nov 26 '12 at 13:25
  • @NikolayPavlov Okay, so you are counting push-ups and the like. I would call that "sort of" periodic because the period between push-ups can change. I would call this a straightforward peak detection problem where you have to detect multiple peaks. This thread might help- http://dsp.stackexchange.com/questions/1302/peak-detection-approach/ – Jim Clay Nov 26 '12 at 14:36
  • Can you please put a plot up so that we can see what you mean exactly? It will help a lot. – Spacey Nov 27 '12 at 00:14
  • @Mohammad yep. See above. – Mykola Pavlov Nov 27 '12 at 09:06
  • Nikolay, very good, so you want a way to detect the 'edges' of this signal, that is, detect around '4', and also detect around '12' is that correct? Also, can you put the actual data into a vector on dropbox so that we can access it. – Spacey Nov 27 '12 at 15:38
  • This is correct. Here is the data, @Mohammad https://www.dropbox.com/s/qr806wb7ja1ot76/data.csv – Mykola Pavlov Nov 27 '12 at 17:56

1 Answers1

2

The autocorrelation function of a sliding window of data may change by a significant amount when the window is slid past the first or last cycle of your burst of periodic events. You may have to play with the width of the autocorrelation window depending on the estimated frequency of your cyclic/periodic events.

hotpaw2
  • 35,346
  • 9
  • 47
  • 90