Hi again bisetti,
Yes, if the data contain either noise or high-frequency components that you want to ignore (as you describe), then it is not just a straightforward matter of finding local max and min values. The algorithm would either have to do some local smoothing, filtering, or even curve fitting. If the signal is totally continuous with no transient part, I would recommend Fourier analysis which would give you the frequencies of the various harmonics, and from what you describe I believe you want the period (1/frequency) of the lowest harmonic (the fundamental frequency). Excel has a Fourier analysis tool (Excel mistakenly groups it in its Statistical tool set) that you could use for this.
But if the function is transient or has a significant transient component you should use smoothing, such as a sliding fit on a number of points that is small compared to the period of the fundamental frequency, looking for inflections in the fit function that are within the range of the sliding fit.
I hope this helps.
Damon