importTrace('Energy_Data/rate70.lvm') power=data; pr70=moving(power,10); figure; %plot(pr70) %%%%%%%%%%%%%%%%%%%% % Default parameters dchthresh = 1; fachthresh = 0.3; tail = 4100; % Assumed 4100 ms tail % Unlimited download ax1 = subplot(2,3,1); plot(ax1,pr70(4000:48000)) rate70_dch_start_1 = find(pr70(6600:8000) > dchthresh,1) + 6600; rate70_dch_end_1 = find(pr70(45700:46000) < dchthresh,1) + 45700; rate70_transmission_time_1 = rate70_dch_end_1 - tail - rate70_dch_start_1; rate70_down_unlimited = 348022; title('Download unlimited, downloaded=12800000 bytes') xlabel('time [ms]') % x-axis label ylabel('Power [Watt]') % y-axis label % Unlimited upload ax2 = subplot(2,3,2); plot(ax2,pr70(157200:189000)) rate70_dch_start_2 = find(pr70(159400:160000) > dchthresh,1) + 159400; rate70_dch_end_2 = find(pr70(182220:182500) < dchthresh,1) + 182220; rate70_transmission_time_2 = rate70_dch_end_2 - tail - rate70_dch_start_2; rate70_up_unlimited = 78283; title('Upload unlimited, uploaded=2560195 bytes') xlabel('time [ms]') % x-axis label ylabel('Power [Watt]') % y-axis label % Download limit = 1 Mbps ax3 = subplot(2,3,3); plot(ax3,pr70(48000:75000)) rate70_dch_start_3 = find(pr70(49900:50000) > dchthresh,1) + 49900; rate70_dch_end_3 = find(pr70(71260:72000) < dchthresh,1) + 71260; rate70_transmission_time_3 = rate70_dch_end_3 - tail - rate70_dch_start_3; rate70_down_1Mbps = 125010; title('Download limit=1 Mbps, downloaded=2560000 bytes') xlabel('time [ms]') % x-axis label ylabel('Power [Watt]') % y-axis label % Download limit = 100 kbps ax4 = subplot(2,3,4); plot(ax4,pr70(75000:104000)) rate70_dch_start_4 = find(pr70(77400:80000) > dchthresh,1) + 77400; rate70_dch_end_4 = find(pr70(97000:98000) < dchthresh,1) + 97000; rate70_transmission_time_4 = rate70_dch_end_4 - tail - rate70_dch_start_4; rate70_down_100kbps = 12200; title('Download limit=100 kbps, downloaded=256000 bytes') xlabel('time [ms]') % x-axis label ylabel('Power [Watt]') % y-axis label % Download limit = 10 kbps, goes from ax5 = subplot(2,3,5); plot(ax5,pr70(104500:130200)) %rate70_dch_start_5 = find(pr70(74400:75000) > dchthresh,1) + 74400; %rate70_dch_end_5 = find(pr70(79100:79400) < dchthresh,1) + 79100; %rate70_transmission_time_dch_5 = rate70_dch_end_5 - tail - rate70_dch_start_5; rate70_down_10kbps = 1216; title('Download limit=10 kbps, downloaded=25600 bytes') xlabel('time [ms]') % x-axis label ylabel('Power [Watt]') % y-axis label % Download limit = 1 kbps, goes from ax6 = subplot(2,3,6); plot(ax6,pr70(130200:157200)) %rate70_dch_start_6 = find(pr70(101800:102000) > dchthresh,1) + 101800; %rate70_dch_end_6 = find(pr70(106450:107000) < dchthresh,1) + 106450; %rate70_transmission_time_dch_6 = rate70_dch_end_6 - tail - rate70_dch_start_6; rate70_down_1kbps = 123; title('Download limit=1 kbps, downloaded=2500 bytes') xlabel('time [ms]') % x-axis label ylabel('Power [Watt]') % y-axis label %ylim(ax1,[0 1.8]) %ylim(ax2,[0 1.8]) %ylim(ax3,[0 1.8]) %ylim(ax4,[0 1.8]) %ylim(ax5,[0 1.8])