importTrace('Energy_Data/rate110.lvm') power=data; pr110=moving(power,10); figure; %plot(pr110) %%%%%%%%%%%%%%%%%%%% % Default parameters dchthresh = 1; fachthresh = 0.3; tail = 4100; % Assumed 4100 ms tail % Unlimited download ax1 = subplot(2,3,1); plot(ax1,pr110(4500:109400)) rate110_dch_start_1 = find(pr110(7100:10000) > dchthresh,1) + 7100; rate110_dch_end_1 = find(pr110(107378:108000) < dchthresh,1) + 107378; rate110_transmission_time_1 = rate110_dch_end_1 - tail - rate110_dch_start_1; rate110_down_unlimited = 130824; 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,pr110(218500:303000)) rate110_dch_start_2 = find(pr110(221000:222000) > dchthresh,1) + 221000; rate110_dch_end_2 = find(pr110(295500:300000) < dchthresh,1) + 295500; rate110_transmission_time_2 = rate110_dch_end_2 - tail - rate110_dch_start_2; rate110_up_unlimited = 29960; 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,pr110(109400:137000)) rate110_dch_start_3 = find(pr110(111600:115000) > dchthresh,1) + 111600; rate110_dch_end_3 = find(pr110(132200:137000) < dchthresh,1) + 132200; rate110_transmission_time_3 = rate110_dch_end_3 - tail - rate110_dch_start_3; rate110_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,pr110(137000:164920)) rate110_dch_start_4 = find(pr110(139200:140000) > dchthresh,1) + 139200; rate110_dch_end_4 = find(pr110(157900:159000) < dchthresh,1) + 157900; rate110_transmission_time_4 = rate110_dch_end_4 - tail - rate110_dch_start_4; rate110_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,pr110(164920:191300)) %rate110_dch_start_5 = find(pr50(74400:75000) > dchthresh,1) + 74400; %rate110_dch_end_5 = find(pr50(79100:79400) < dchthresh,1) + 79100; %rate110_transmission_time_dch_5 = rate110_dch_end_5 - tail - rate110_dch_start_5; rate110_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,pr110(192000:218500)) %rate110_dch_start_6 = find(pr50(101800:102000) > dchthresh,1) + 101800; %rate110_dch_end_6 = find(pr50(106450:107000) < dchthresh,1) + 106450; %rate110_transmission_time_dch_6 = rate110_dch_end_6 - tail - rate110_dch_start_6; rate110_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])