1- function mcs_per_wlan = compute_mcs(power_from_ap_cell , num_channels_system )
1+ function mcs_per_wlan = compute_mcs(PSI_cell , power_from_ap_cell , num_channels_system )
22% MCS_PER_WLAN computes the allowed Modulation Coding Scheme for each WLAN
33% transmitting in different number of channels
44% INPUT:
88% * mcs_per_wlan: MCS in each WLAN for each number of channels used for tx
99% (rows: number of channels, columns: MCS index)
1010
11- load(' constants .mat' ); % Load constants into workspace
11+ load(' constants_sfctmn_framework .mat' ); % Load constants into workspace
1212
13- mcs_per_wlan = {} ;
13+ mcs_per_wlan = cell( 1 , size( power_from_ap_cell , 2 )) ;
1414
15- for state_ix = 1 : size(power_from_ap_cell , 2 )
16-
15+ for state_ix = 1 : size(power_from_ap_cell , 2 )
1716 power_state_ix = power_from_ap_cell{state_ix };
1817 num_wlans = size(power_from_ap_cell{state_ix }, 1 );
19- mcs_per_wlan{state_ix } = zeros(num_wlans , num_channels_system );
20-
18+ mcs_per_wlan{state_ix } = zeros(num_wlans , num_channels_system );
2119 for wlan_ix = 1 : num_wlans
22-
23- for ch_ix = 1 : num_channels_system % (log2(num_channels_system) + 1) % For 1, 2, 4 and 8 channels
24-
25- if power_state_ix(wlan_ix ,ch_ix ) < - 82 +((ch_ix - 1 )*3 )
20+ for ch_ix = 1 : num_channels_system % (log2(num_channels_system) + 1) % For 1, 2, 4 and 8 channels
21+ if PSI_cell{state_ix }(wlan_ix ) > 0
22+ if power_state_ix(wlan_ix ,ch_ix ) < - 82 +((ch_ix - 1 )*3 )
23+ % mcs_per_wlan{state_ix}(wlan_ix, ch_ix) = MODULATION_FORBIDDEN;
24+ mcs_per_wlan{state_ix }(wlan_ix , ch_ix ) = MODULATION_BPSK_1_2 ; % Default MCS (to always start the TX)
25+ elseif (power_state_ix(wlan_ix ,ch_ix ) >= - 82 + ((ch_ix - 1 )*3 ) && power_state_ix(wlan_ix ,ch_ix ) < - 79 +((ch_ix - 1 )*3 ))
26+ mcs_per_wlan{state_ix }(wlan_ix , ch_ix ) = MODULATION_BPSK_1_2 ;
27+ elseif (power_state_ix(wlan_ix ,ch_ix ) >= - 79 + ((ch_ix - 1 )*3 ) && power_state_ix(wlan_ix ,ch_ix ) < - 77 +((ch_ix - 1 )*3 ))
28+ mcs_per_wlan{state_ix }(wlan_ix , ch_ix ) = MODULATION_QPSK_1_2 ;
29+ elseif (power_state_ix(wlan_ix ,ch_ix ) >= - 77 + ((ch_ix - 1 )*3 ) && power_state_ix(wlan_ix ,ch_ix ) < - 74 +((ch_ix - 1 )*3 ))
30+ mcs_per_wlan{state_ix }(wlan_ix , ch_ix ) = MODULATION_QPSK_3_4 ;
31+ elseif (power_state_ix(wlan_ix ,ch_ix ) >= - 74 + ((ch_ix - 1 )*3 ) && power_state_ix(wlan_ix ,ch_ix ) < - 70 +((ch_ix - 1 )*3 ))
32+ mcs_per_wlan{state_ix }(wlan_ix , ch_ix ) = MODULATION_16QAM_1_2 ;
33+ elseif (power_state_ix(wlan_ix ,ch_ix ) >= - 70 + ((ch_ix - 1 )*3 ) && power_state_ix(wlan_ix ,ch_ix ) < - 66 +((ch_ix - 1 )*3 ))
34+ mcs_per_wlan{state_ix }(wlan_ix , ch_ix ) = MODULATION_16QAM_3_4 ;
35+ elseif (power_state_ix(wlan_ix ,ch_ix ) >= - 66 + ((ch_ix - 1 )*3 ) && power_state_ix(wlan_ix ,ch_ix ) < - 65 +((ch_ix - 1 )*3 ))
36+ mcs_per_wlan{state_ix }(wlan_ix , ch_ix ) = MODULATION_64QAM_2_3 ;
37+ elseif (power_state_ix(wlan_ix ,ch_ix ) >= - 65 + ((ch_ix - 1 )*3 ) && power_state_ix(wlan_ix ,ch_ix ) < - 64 +((ch_ix - 1 )*3 ))
38+ mcs_per_wlan{state_ix }(wlan_ix , ch_ix ) = MODULATION_64QAM_3_4 ;
39+ elseif (power_state_ix(wlan_ix ,ch_ix ) >= - 64 + ((ch_ix - 1 )*3 ) && power_state_ix(wlan_ix ,ch_ix ) < - 59 +((ch_ix - 1 )*3 ))
40+ mcs_per_wlan{state_ix }(wlan_ix , ch_ix ) = MODULATION_64QAM_5_6 ;
41+ elseif (power_state_ix(wlan_ix ,ch_ix ) >= - 59 + ((ch_ix - 1 )*3 ) && power_state_ix(wlan_ix ,ch_ix ) < - 57 +((ch_ix - 1 )*3 ))
42+ mcs_per_wlan{state_ix }(wlan_ix , ch_ix ) = MODULATION_256QAM_3_4 ;
43+ elseif (power_state_ix(wlan_ix ,ch_ix ) >= - 57 + ((ch_ix - 1 )*3 ) && power_state_ix(wlan_ix ,ch_ix ) < - 54 +((ch_ix - 1 )*3 ))
44+ mcs_per_wlan{state_ix }(wlan_ix , ch_ix ) = MODULATION_256QAM_5_6 ;
45+ elseif (power_state_ix(wlan_ix ,ch_ix ) >= - 54 + ((ch_ix - 1 )*3 ) && power_state_ix(wlan_ix ,ch_ix ) < - 52 +((ch_ix - 1 )*3 ))
46+ mcs_per_wlan{state_ix }(wlan_ix , ch_ix ) = MODULATION_1024QAM_3_4 ;
47+ else
48+ mcs_per_wlan{state_ix }(wlan_ix , ch_ix ) = MODULATION_1024QAM_5_6 ;
49+ end
50+ else % If the WLAN is not transmitting in state "state_ix"
2651 mcs_per_wlan{state_ix }(wlan_ix , ch_ix ) = MODULATION_FORBIDDEN ;
27- elseif (power_state_ix(wlan_ix ,ch_ix ) >= - 82 + ((ch_ix - 1 )*3 ) && power_state_ix(wlan_ix ,ch_ix ) < - 79 +((ch_ix - 1 )*3 ))
28- mcs_per_wlan{state_ix }(wlan_ix , ch_ix ) = MODULATION_BPSK_1_2 ;
29- elseif (power_state_ix(wlan_ix ,ch_ix ) >= - 79 + ((ch_ix - 1 )*3 ) && power_state_ix(wlan_ix ,ch_ix ) < - 77 +((ch_ix - 1 )*3 ))
30- mcs_per_wlan{state_ix }(wlan_ix , ch_ix ) = MODULATION_QPSK_1_2 ;
31- elseif (power_state_ix(wlan_ix ,ch_ix ) >= - 77 + ((ch_ix - 1 )*3 ) && power_state_ix(wlan_ix ,ch_ix ) < - 74 +((ch_ix - 1 )*3 ))
32- mcs_per_wlan{state_ix }(wlan_ix , ch_ix ) = MODULATION_QPSK_3_4 ;
33- elseif (power_state_ix(wlan_ix ,ch_ix ) >= - 74 + ((ch_ix - 1 )*3 ) && power_state_ix(wlan_ix ,ch_ix ) < - 70 +((ch_ix - 1 )*3 ))
34- mcs_per_wlan{state_ix }(wlan_ix , ch_ix ) = MODULATION_16QAM_1_2 ;
35- elseif (power_state_ix(wlan_ix ,ch_ix ) >= - 70 + ((ch_ix - 1 )*3 ) && power_state_ix(wlan_ix ,ch_ix ) < - 66 +((ch_ix - 1 )*3 ))
36- mcs_per_wlan{state_ix }(wlan_ix , ch_ix ) = MODULATION_16QAM_3_4 ;
37- elseif (power_state_ix(wlan_ix ,ch_ix ) >= - 66 + ((ch_ix - 1 )*3 ) && power_state_ix(wlan_ix ,ch_ix ) < - 65 +((ch_ix - 1 )*3 ))
38- mcs_per_wlan{state_ix }(wlan_ix , ch_ix ) = MODULATION_64QAM_2_3 ;
39- elseif (power_state_ix(wlan_ix ,ch_ix ) >= - 65 + ((ch_ix - 1 )*3 ) && power_state_ix(wlan_ix ,ch_ix ) < - 64 +((ch_ix - 1 )*3 ))
40- mcs_per_wlan{state_ix }(wlan_ix , ch_ix ) = MODULATION_64QAM_3_4 ;
41- elseif (power_state_ix(wlan_ix ,ch_ix ) >= - 64 + ((ch_ix - 1 )*3 ) && power_state_ix(wlan_ix ,ch_ix ) < - 59 +((ch_ix - 1 )*3 ))
42- mcs_per_wlan{state_ix }(wlan_ix , ch_ix ) = MODULATION_64QAM_5_6 ;
43- elseif (power_state_ix(wlan_ix ,ch_ix ) >= - 59 + ((ch_ix - 1 )*3 ) && power_state_ix(wlan_ix ,ch_ix ) < - 57 +((ch_ix - 1 )*3 ))
44- mcs_per_wlan{state_ix }(wlan_ix , ch_ix ) = MODULATION_256QAM_3_4 ;
45- elseif (power_state_ix(wlan_ix ,ch_ix ) >= - 57 + ((ch_ix - 1 )*3 ) && power_state_ix(wlan_ix ,ch_ix ) < - 54 +((ch_ix - 1 )*3 ))
46- mcs_per_wlan{state_ix }(wlan_ix , ch_ix ) = MODULATION_256QAM_5_6 ;
47- elseif (power_state_ix(wlan_ix ,ch_ix ) >= - 54 + (ch_ix * 3 ) && power_state_ix(wlan_ix ,ch_ix ) < - 52 +(ch_ix * 3 ))
48- mcs_per_wlan{state_ix }(wlan_ix , ch_ix ) = MODULATION_1024QAM_3_4 ;
49- else
50- mcs_per_wlan{state_ix }(wlan_ix , ch_ix ) = MODULATION_1024QAM_5_6 ;
5152 end
52-
53- end
54-
55- end
56-
53+ end
54+ end
5755 end
5856
5957end
0 commit comments