The discrete Fourier transform can give you periodicity. A longer time window gives you a higher frequency resolution, so I changed the definition of t to t = linspace(0, 500, 2000) . time domain http://img402.imageshack.us/img402/8775/timedomain.png (here is a link to the chart , it looks better on the hosting site). You can do:
h = hann(length(x), 'periodic'); %# use a Hann window to reduce leakage y = fft(x .* [hh]); %# window each time signal and calculate FFT df = 1/t(end); %# if t is in seconds, df is in Hz ym = abs(y(1:(length(y)/2), :)); %# we just want amplitude of 0..pi frequency components semilogy(((1:length(ym))-1)*df, ym);
frequency domain http://img406.imageshack.us/img406/2696/freqdomain.png Link to the chart.
Looking at the graph, the first peak is about 0.06 Hz, which corresponds to the period of 16 seconds observed in plot(t,x) .
It is not computational, but fast. FFTs are N * log (N) operations.
source share