function b = findme(T, W, p,d) d=match(T, W, p,d); d=abs(d); %d=movavg(400,d); %g= doppler(8,T,W,p,4*p*T*W,0,0,0); [findamt,maxind] = max(d); threshd = findamt - d; TC = 2000; if maxind > TC threshd(maxind-TC:maxind) = mean(threshd); else threshd(1:maxind) = mean(threshd); end if maxind < length(d) - TC + 1 threshd(maxind:maxind+400-1) = mean(threshd); else threshd(maxind:length(d)) = mean(threshd); end for i=1:15, [a,ti] = min(threshd); maxind(i+1) = ti; if ti > TC threshd(ti-TC:ti) = mean(threshd); else threshd(1:ti) = mean(threshd); end if ti < length(d) - TC threshd(ti:ti+TC-1) = mean(threshd); else threshd(ti:length(d)) = mean(threshd); end end maxindold = maxind(1:8); maxind = sort(maxind); one = 0; for i=1:15, if maxind(i+1) - maxind(i) < 1000 one = 1; end end if one == 1 b = sort(maxindold); else b = sort(maxind); end %b= maxind; plot(abs(threshd));