# Getting the frequency of a 0.33Hz to 3Hz signal

I read a noisy signal from an accelerometer which is attached to the pedal of a stationary bike and need to find the frequency of the signal/ speed of the person cycling. I taught of the following solutions and would like to know if I overlooked any or made some incorrect assumptions.

Currently the working solution is a low pass (10-30 point moving average) and then a peak detection with a minimum amplitude requirement and minimum time requirement. However this solution doesn't work very well when nearing 0.33Hz (20 RPM)

I tried using an fft but the result was never accurate enough for the small differences in frequency I am looking for.

I taught about using autocorrelation but how I understand it, I would have to wait atleast a period and then some before I could detect the frequency.

Any other ideas are welcome, or if anybody knows what is used in the commercial version it would be great to know.

• If you know that the signal is band limited to 0.33 to 3 Hz, I would sample it at a rate of 10 Hz for 6.4 seconds and than use the furrier transform. If you are interested in getting a pick exactly at 0.33 Hz use a sampling rate of 10/1.1 and the third bin will provide you with the power in the 3.3 frequency. – Moti May 23 '15 at 4:23
• Peak detection of two peaks also requires collecting at least "one period and then some", so why not use autocorrelation? – hotpaw2 May 23 '15 at 5:58
• @Moti: I'll see what this give, however the signal is not band limited at those values, I just don't have to detect the frequency anymore when it is outside this range. However it is a really big downside that I have a delay of 6.4 seconds. Is there any way to get accurate information faster? – YetAnotherStudent May 23 '15 at 9:07
• @hotpaw2 I detect both minima and maxima so I get can recalculate the frequency 2 times each period. – YetAnotherStudent May 23 '15 at 9:10
• You can compute an autocorrelation every new sample, which is even more often, thus potentially with less latency, than waiting for just 2 times per period. – hotpaw2 May 23 '15 at 14:22