# How to find the period of a periodic function?

I'm working on some numerical analysis problem, and I'm studying functions that "seem" to be periodic. Now what I would like to do, is to determine their period. Only, the methods I actually use are extremely childish (I visually find two points where the function intercepts the abscissa axis, get the coordinates and calculate the difference between them...).

In other words :

Given a function $\ f(t)\ |\ t\in\ [0,t_f]$

I would like to find $\{T,\ T>0\}$ so that $\forall\, t,\ f(t+T)=f(t)$

Does anyone have a solution?

The quick and dirty answer is to take a Fourier transform of your function and observe where, if any, there are spikes in the transform. The frequencies at which the transform has spikes represents the $2 \pi/p$, where $p$ is a period of the data.