close all;


OB=importdata('TEST_343.dat'); %Open 10x10
OBP=OB(:,2:end)./100;
t=OB(:,1);

Dt=t(2,1)-t(1,1);
sr=1/Dt;

limy1=2.0;

figure
plot(t,OBP(:,1),'-b');
t1=22;
t2=t1+1024*Dt;
axis([t1 t2 -limy1/100 limy1/100]);
grid on
xlabel('t (sec)');
ylabel('z (m)');

pause

%probe1
t1=22;
t2=t1+1024*Dt;
i1=find(t==t1);
i2=i1+1024-1;
t2=t(i2);

 y1=OBP(i1:i2,1);
 yyfft1 = fft(y1);
 yyfft21 = yyfft1./length(y1);
 n1=length(y1)/2;
 m1 = 2*abs(yyfft21(1:n1+1,:));
 f1=(0:n1)'.*1/(length(y1)./sr);
 
 
 f=[-f1(2:end); f1(1:end-1)];
 f=sort(f)
 
 figure
%   set(gcf,'Position',[680   558   379   420])
 plot(abs(yyfft21),'-k')
 axis([0 1024 0 0.012]) 
xlabel('#');
ylabel('amplitude (m)')

  figure
 plot(m1,'-r')
xlabel('#');
ylabel('amplitude (m)')

 
 figure
 plot(f1,m1,'-r')
xlabel('f (Hz)');
ylabel('amplitude (m)')

 
