-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcal_avg_throuput.m
19 lines (18 loc) · 1004 Bytes
/
cal_avg_throuput.m
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
function average_throughput_Mbps = cal_avg_throuput(TB_size_bits,num_assigned_RB,TTI_time_s,TTI_MAX)
TTIs_to_ignore = 0;
len = sum(TTI_MAX);
UE_was_disabled =true(1,length(len));
indx = find(TB_size_bits ~= 0);
if indx ~= 0
% indx = find(TB_size_bits ~= 0);
% UE_was_disabled(indx) = 1;
UE_was_disabled =false(1,len);
end
total_bits = sum(TB_size_bits);
TTIs_to_account_for = true(1,len);
TTIs_to_account_for(1:TTIs_to_ignore) = false; % Ignore TTIs where no feedback information was available
TTIs_to_account_for(UE_was_disabled) = false;
sum_total_bits = sum(total_bits);
accounted_TTIs = sum(TTIs_to_account_for);
average_throughput_Mbps = sum(sum_total_bits) / (5*TTI_time_s) / 1e6;
end