importTrace('file50.lvm') power=data; p50=moving(power,10); figure; plot(p50) importTrace('file110.lvm') power=data; p110=moving(power,10); plot(p110) %Download subplot(2,2,1) plot(p50(55100:69734)) subplot(2,2,2) plot(p110(43164:57140)) %Upload subplot(2,2,3) plot(p50(183013:198722),'r') subplot(2,2,4) plot(p110(161236:176715),'r') p50dl=p50(55100:69734); %analyse only p50dl to get power values plot(p50dl) %filtered=moving(p50ul,50); %filtered=moving(p50dl,50); %PARAMS dchthreshold=1;%watt fachthreshold=0.3; t1=4100; %tailtime assumed: 4100 filtered=moving(p110ul,50); plot(filtered) %NEED TO MANUALLY GET %dchfach=9816 ;%end of the transition to fach %fachpch=14630 ;%start of transition to fach %50dl %dchfach=8660 ; %fachpch=13370 ; dchfach=9771 ; fachpch=14640 ; %takes filtered states and finds the cutting points (MAKE THEM IN %VECTOR) dch1 = find(filtered > dchthreshold,1); dch2 = find(filtered(dch1+1:end) < dchthreshold,1) + dch1; pch = find( filtered(dch1+dch2:end) < fachthreshold,1) + dch1+dch2; pchdch1=0; pchdch2=dch1; dchtx1=dch1; dchtx2=dch2; dchtime=dch2-dch1; dchfach=dch2; dchtx=dch2-t1;%transmission time. otherwise dch2 - tailtime %The check of the values check=filtered; check(:)=0; check(dch1)=2; check(dch2)=2; check(pch)=2; check(dchfach)=2; check(fachpch)=2; check(dchtx)=2; x=[1:1:size(filtered,1)]; plot(x,filtered) hold on plot(check) hold off %analyse p110dl to get power values plot(p110ul) plot(moving(p110ul,40)) p50ul=p50(183013:198722); p110dl=p110(43164:57140); p110ul=p110(161236:176715);