-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathwifi_spec.py
97 lines (86 loc) · 5.11 KB
/
wifi_spec.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
import collections
MCSSpec = collections.namedtuple("MCSSpec", ['index', 'modulation', 'dr_800ns',
'dr_400ns'])
RSSISpec = collections.namedtuple("RSSISpec", ['min', 'spec'])
# Datafrom IEEE 802.11 standard
MCS_20_1_1 = [MCSSpec(*i) for i in [(0, 'BPSK', 6.5, 7.2),
(1, 'QPSK', 13.0, 14.4),
(2, 'QPSK', 19.5, 21.7),
(3, '16QAM', 26.0, 28.9),
(4, '16QAM', 39.0, 43.3),
(5, '64QAM', 52.0, 67.8),
(6, '64QAM', 58.5, 65.0),
(7, '64QAM', 65.0, 72.2)]]
MCS_20_2_1_eqm = [MCSSpec(*i) for i in [(8, 'BPSK', 13, 14.4),
(9, 'QPSK', 26.0, 18.9),
(10, 'QPSK', 39.0, 43.3),
(11, '16QAM', 52.0, 57.8),
(12, '16QAM', 78.0, 86.7),
(13, '64QAM', 104.0, 115.6),
(14, '64QAM', 117.0, 130.0),
(15, '64QAM', 130.0, 144.4)]]
MCS_20_3_1_eqm = [MCSSpec(*i) for i in [(16, 'BPSK', 19.5, 21.7),
(17, 'QPSK', 39.0, 43.3),
(18, 'QPSK', 58.5, 65.0),
(19, '16QAM', 78.0, 86.7),
(20, '16QAM', 117.0, 130.0),
(21, '64QAM', 156.0, 173.3),
(22, '64QAM', 175.5, 195.0),
(23, '64QAM', 195.0, 216.7)]]
MCS_40_1_1 = [MCSSpec(*i) for i in [(0, 'BPSK', 13.5, 15.0),
(1, 'QPSK', 27.0, 30.0),
(2, 'QPSK', 40.5, 45.0),
(3, '16QAM', 54.0, 60.0),
(4, '16QAM', 81.0, 90.0),
(5, '64QAM', 108.0, 120.0),
(6, '64QAM', 121.5, 135.0),
(7, '64QAM', 135.0, 150.0)]]
MCS_40_1_1_extend = [MCSSpec(*i) for i in [
(0, 'xxx', 1 , 0.00001),
(1, 'xxx', 1 , 0.001),
(2, 'xxx', 1 , 0.05),
(3, 'xxx', 1 , 0.25),
(4, 'xxx', 1 , 0.5),
(5, 'xxx', 1 , 1.0),
(6, 'xxx', 1 , 4.0),
(7, 'BPSK', 13.5, 15.0),
(8, 'QPSK', 27.0, 30.0),
(9, 'QPSK', 40.5, 45.0),
(10, '16QAM', 54.0, 60.0),
(11, '16QAM', 81.0, 90.0),
(12, '64QAM', 108.0, 120.0),
(13, '64QAM', 121.5, 135.0),
(14, '64QAM', 135.0, 150.0)]]
MCS_40_2_1_eqm = [MCSSpec(*i) for i in [(8, 'BPSK', 27, 30.0),
(9, 'QPSK', 54.0, 60.0),
(10, 'QPSK', 81.0, 90.0),
(11, '16QAM', 108.0, 120.0),
(12, '16QAM', 162.0, 180.0),
(13, '64QAM', 216.0, 240.0),
(14, '64QAM', 243.0, 270.0),
(15, '64QAM', 270.0, 300)]]
# Source: https://higher-frequency.blogspot.com/2016/10/80211n-80211ac-data-rates-and-snr.html?m=1
RSSI_MAP_80211n_HT40_1_1 = [(-79, MCS_40_1_1[0]),
(-76, MCS_40_1_1[1]),
(-74, MCS_40_1_1[2]),
(-71, MCS_40_1_1[3]),
(-67, MCS_40_1_1[4]),
(-63, MCS_40_1_1[5]),
(-62, MCS_40_1_1[6]),
(-61, MCS_40_1_1[7])]
RSSI_MAP_80211n_HT40_1_1_extend = [
(-99, MCS_40_1_1_extend[0]),
(-83, MCS_40_1_1_extend[1]),
(-82, MCS_40_1_1_extend[2]),
(-81, MCS_40_1_1_extend[3]),
(-80, MCS_40_1_1_extend[4]),
(-79, MCS_40_1_1_extend[5]),
(-78, MCS_40_1_1_extend[6]),
(-77, MCS_40_1_1_extend[7]),
(-76, MCS_40_1_1_extend[8]),
(-74, MCS_40_1_1_extend[9]),
(-71, MCS_40_1_1_extend[10]),
(-67, MCS_40_1_1_extend[11]),
(-63, MCS_40_1_1_extend[12]),
(-62, MCS_40_1_1_extend[13]),
(-61, MCS_40_1_1_extend[14])]