15 nA = np.linspace(5, 50, 10)
25 T_SYMBOL_DATA = 12.8e-6 + T_GI
37 Aggregation_Type =
"A_MPDU"
41 L_MSDU_HEADER = 14 * 8
43 Aggregation_Type =
"NONE"
45 N_DBPS = data_rate * T_SYMBOL_DATA
47 if Aggregation_Type ==
"NONE":
48 N_SYMBOLS = math.ceil((L_SERVICE + (L_MAC + L_DATA + L_APP_HDR) + L_TAIL) / N_DBPS)
49 T_DATA = T_PHY_DATA + (T_SYMBOL_DATA * N_SYMBOLS)
53 if Aggregation_Type ==
"A_MSDU":
54 N_SYMBOLS = math.ceil(
57 + K_MPDU * (L_MAC + L_MPDU_HEADER + K_MSDU * (L_MSDU_HEADER + L_DATA + L_APP_HDR))
62 T_DATA = T_PHY_DATA + (T_SYMBOL_DATA * N_SYMBOLS)
64 if Aggregation_Type ==
"A_MPDU":
65 N_SYMBOLS = math.ceil(
66 (L_SERVICE + K_MPDU * (L_MAC + L_MPDU_HEADER + L_DATA + L_APP_HDR) + L_TAIL) / N_DBPS
68 T_DATA = T_PHY_DATA + (T_SYMBOL_DATA * N_SYMBOLS)
71 N_DBPS = ack_rate * T_SYMBOL_ACK
72 N_SYMBOLS = math.ceil((L_SERVICE + L_ACK + L_TAIL) / N_DBPS)
73 T_ACK = T_PHY_ACK + (T_SYMBOL_ACK * N_SYMBOLS)
75 T_s = T_DATA + T_SIFS + T_ACK + T_DIFS
79 T_s = T_DATA + T_SIFS + T_ACK + T_DIFS + delta
80 T_C = T_DATA + T_DIFS + T_SIFS + T_ACK + delta
82 T_S = T_s / (1 - B) + T_SLOT
84 S_bianchi = np.zeros(len(nA))
85 for j
in range(len(nA)):
88 m = math.log2((CWmax + 1) / (CWmin + 1))
89 tau1 = np.linspace(0, 0.1, 100000)
90 p = 1 - np.power((1 - tau1), (n - 1))
93 for i
in range(int(m)):
94 ps = ps + np.power(2 * p, i)
96 taup = 2.0 / (1 + W + p * W * ps)
97 b = np.argmin(np.abs(tau1 - taup))
100 Ptr = 1 - math.pow((1 - tau), int(n))
101 Ps = n * tau * math.pow((1 - tau), int(n - 1)) / Ptr
109 / ((1 - Ptr) * T_SLOT + Ptr * Ps * T_S + Ptr * (1 - Ps) * T_C)
113 bianchi_result = S_bianchi
114 return bianchi_result
118 str_bianchi =
" {" +
'"HeMcs{:d}'.format(mcs) +
'_{:d}MHz"'.format(bw) +
", {\n"
119 for i
in range(len(bianchi_result)):
120 str_tmp =
" {" +
"{:d}, {:.4f}".format(5 * (i + 1), bianchi_result[i]) +
"},\n"
121 str_bianchi = str_bianchi + str_tmp
122 str_bianchi = str_bianchi +
" }},\n"
142ack_rates_20MHz = [6e6, 12e6, 12e6, 24e6, 24e6, 24e6, 24e6, 24e6, 24e6, 24e6, 24e6, 24e6]
157ack_rates_40MHz = [6e6, 12e6, 12e6, 24e6, 24e6, 24e6, 24e6, 24e6, 24e6, 24e6, 24e6, 24e6]
172ack_rates_80MHz = [6e6, 12e6, 12e6, 24e6, 24e6, 24e6, 24e6, 24e6, 24e6, 24e6, 24e6, 24e6]
187ack_rates_160MHz = [6e6, 12e6, 12e6, 24e6, 24e6, 24e6, 24e6, 24e6, 24e6, 24e6, 24e6, 24e6]
193with open(
"bianchi_11ax_difs.txt",
"w", encoding=
"utf-8")
as f:
194 for i
in range(len(data_rates_20MHz)):
195 bianchi_result =
bianchi_ax(data_rates_20MHz[i], ack_rates_20MHz[i], k, difs)
198 for i
in range(len(data_rates_40MHz)):
199 bianchi_result =
bianchi_ax(data_rates_40MHz[i], ack_rates_40MHz[i], k, difs)
202 for i
in range(len(data_rates_80MHz)):
203 bianchi_result =
bianchi_ax(data_rates_80MHz[i], ack_rates_80MHz[i], k, difs)
206 for i
in range(len(data_rates_160MHz)):
207 bianchi_result =
bianchi_ax(data_rates_160MHz[i], ack_rates_160MHz[i], k, difs)
212with open(
"bianchi_11ax_eifs.txt",
"w", encoding=
"utf-8")
as f:
213 for i
in range(len(data_rates_20MHz)):
214 bianchi_result =
bianchi_ax(data_rates_20MHz[i], ack_rates_20MHz[i], k, difs)
217 for i
in range(len(data_rates_40MHz)):
218 bianchi_result =
bianchi_ax(data_rates_40MHz[i], ack_rates_40MHz[i], k, difs)
221 for i
in range(len(data_rates_80MHz)):
222 bianchi_result =
bianchi_ax(data_rates_80MHz[i], ack_rates_80MHz[i], k, difs)
225 for i
in range(len(data_rates_160MHz)):
226 bianchi_result =
bianchi_ax(data_rates_160MHz[i], ack_rates_160MHz[i], k, difs)
str_result(bianchi_result, mcs, bw)
bianchi_ax(data_rate, ack_rate, k, difs)