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
    $\begingroup$ 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? $\endgroup$ – Dilip Sarwate Nov 26 '12 at 12:47
  • $\begingroup$ Do you mean that you don't know how long the period is? $\endgroup$ – Jim Clay Nov 26 '12 at 13:15
  • $\begingroup$ 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. $\endgroup$ – Mykola Pavlov Nov 26 '12 at 13:20
  • $\begingroup$ @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. $\endgroup$ – Mykola Pavlov Nov 26 '12 at 13:25
  • $\begingroup$ @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- dsp.stackexchange.com/questions/1302/peak-detection-approach $\endgroup$ – Jim Clay Nov 26 '12 at 14:36

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.


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.