clear;

filename='AAMWPgfz0.050-year.dat';

fin=fopen(filename,'rt');
fgetl(fin);
A=fscanf(fin,'%f',[3 inf]);% A - array of data
fclose(fin);

l=size(A);
N=l(2);

YEARS=A(1,1:N);
X=A(2,1:N);
Y=A(3,1:N);

dT=YEARS(2)-YEARS(1);

plot(YEARS,X)



 [spectr, omega] = ampl_fft(X+i*Y,dT)
 
 plot(1./(omega/2/pi),abs(spectr))
 %periods   amplitudes
 