% Fourier analysis of the sun's velcity
figure
L=fix(0.6.*length(t));
NFFT=2^nextpow2(L);
Fs=1./abs((t(2)-t(1))./365.25./86400);
f = Fs/2*linspace(0,1,NFFT/2+1); 

    
Y=fft(y(:,4)  ,NFFT)/L;
plot(1./f,(2*abs(Y(1:NFFT/2+1))),'r')
Y1=fft(y1(:,4)  ,NFFT)/L;
hold on;
plot(1./f,(2*abs(Y1(1:NFFT/2+1))),'g')

set(gca,'yscale','log','xscale','log')
xlabel('Period (years)');ylabel('Power');
title('Fourier analysis of the Sun''s motion');
