detecting the period of signal
If you want to find the periodicity of a signal, just calculate the autocorrelation of it and look for the highest peak.

Since that topic is almost entirely DSP and math related and has little to do with electronic engineering I suggest that you visit the sister-site https://dsp.stackexchange.com/ for more information.