importTrace('Energy_Data/rate90.lvm') power=data; pr90=moving(power,10); figure; %plot(pr90) %%%%%%%%%%%%%%%%%%%% % Default parameters dchthresh = 1; fachthresh = 0.3; tail = 4100; % Assumed 4100 ms tail % Unlimited download ax1 = subplot(2,3,1); plot(ax1,pr90(2000:33000)) rate90_dch_start_1 = find(pr90(4000:4500) > dchthresh,1) + 4000; rate90_dch_end_1 = find(pr90(31190:32000) < dchthresh,1) + 31190; rate90_transmission_time_1 = rate90_dch_end_1 - tail - rate90_dch_start_1; rate90_down_unlimited = 526624; 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,pr90(144300:176700)) rate90_dch_start_2 = find(pr90(146700:149000) > dchthresh,1) + 146700; rate90_dch_end_2 = find(pr90(170000:171000) < dchthresh,1) + 170000; rate90_transmission_time_2 = rate90_dch_end_2 - tail - rate90_dch_start_2; rate90_up_unlimited = 77323; 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,pr90(33000:60000)) rate90_dch_start_3 = find(pr90(35200:36000) > dchthresh,1) + 35200; rate90_dch_end_3 = find(pr90(57025:57200) < dchthresh,1) + 57025; rate90_transmission_time_3 = rate90_dch_end_3 - tail - rate90_dch_start_3; rate90_down_1Mbps = 125712; 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,pr90(60000:89000)) rate90_dch_start_4 = find(pr90(62900:65000) > dchthresh,1) + 62900; rate90_dch_end_4 = find(pr90(84400:85000) < dchthresh,1) + 84400; rate90_transmission_time_4 = rate90_dch_end_4 - tail - rate90_dch_start_4; rate90_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,pr90(89000:117000)) %rate90_dch_start_5 = find(pr50(74400:75000) > dchthresh,1) + 74400; %rate90_dch_end_5 = find(pr50(79100:79400) < dchthresh,1) + 79100; %rate90_transmission_time_dch_5 = rate90_dch_end_5 - tail - rate90_dch_start_5; rate90_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,pr90(117000:144300)) %rate90_dch_start_6 = find(pr50(101800:102000) > dchthresh,1) + 101800; %rate90_dch_end_6 = find(pr50(106450:107000) < dchthresh,1) + 106450; %rate90_transmission_time_dch_6 = rate90_dch_end_6 - tail - rate90_dch_start_6; rate90_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])