Qup=[];
Qdown=[];
aa=-19;

for jj=1:length(w)-20;
   if w(jj,3)>0.25 & jj>aa+19,
      Qup=[Qup 
         w(jj:jj+19,4)];
%      disp('up')
      aa=jj;
   elseif w(jj,3)<-0.25 & jj>aa+19,
      Qdown=[Qdown 
         w(jj:jj+19,4)];
%      disp('down')
      aa=jj;
   end;
end;

wq=TA(ii,2);
ww=TA(ii,1);

acoef=wq.*1000./sqrt(ww)./(mean(Qup)-mean(Qdown))
ACOEF=[ACOEF acoef];