function D=ajust(ve1f,k)
t=1:3284;
ve1th=cos((2*pi*t)/494.4270);
expo=exp(-k*t);
ve1th2=expo.*ve1th;
unite=ones(3284,1);
A=[unite ve1th2'];
beta=A\ve1f;
fit=A*beta;
plot(fit,'r')
hold on
plot(ve1f)
format long;
xlabel('unite de temps (2 min)');
ylabel('amplitude (cm/s)');
title('vi filtree a 2h et vi modelisee bin 1/45'); 
gtext(['k=1/',int2str(1/k)])
beta
hold off
C=cov(fit,ve1f);
D=C(2,1)/(sqrt(C(1,1)*C(2,2)));