source: ReferenceDesigns/w3_802.11/sysgen/wlan_phy_tx_pmd/mcode_blocks/signal_rate_decode_tx.m

Last change on this file was 2153, checked in by murphpo, 11 years ago

Initial Tx/Rx PHY models with 64QAM support (incl. redesigned de-interleaver with much lower latency)

File size: 2.4 KB
Line 
1function [mod_order, code_rate, N_CBPS, N_DBPS, valid] = signal_rate_decode_tx(signal_rate)
2
3%Inputs:
4% signal_rate: 4-bit RATE field from received SIGNAL field
5
6%Outputs:
7% mod_order: payload modulation order in bits-per-sym
8%  ([1,2,4,6] for [BSPK,QPSK,16-QAM,64-QAM])
9% code_rate: payload coding rate ([0,1,2] for [1/2, 2/3, 3/4])
10% valid: 0 when signal_rate is not a valid 4-bit value
11
12BPSK = 1;
13QPSK = 2;
14QAM16 = 4;
15QAM64 = 6;
16
17CODE12 = 0;
18CODE23 = 1;
19CODE34 = 2;
20
21%Coded bits per OFDM symbol
22% Depends only on modulation rate
23N_CPBS_BPSK = 48;
24N_CPBS_QPSK = 96;
25N_CPBS_16QAM = 192;
26N_CPBS_64QAM = 288;
27
28%Data bits per OFDM symbol
29% Depends on modulation and code rates
30N_DBPS_BPSK12 = 24;
31N_DBPS_BPSK34 = 36;
32N_DBPS_QPSK12 = 48;
33N_DBPS_QPSK34 = 72;
34N_DBPS_16QAM12 = 96;
35N_DBPS_16QAM34 = 144;
36N_DBPS_64QAM23 = 192;
37N_DBPS_64QAM34 = 216;
38
39switch double(signal_rate)
40   
41    case 13 %bin2dec('1101')
42        mod_order = BPSK;
43        code_rate = CODE12;
44        N_CBPS = N_CPBS_BPSK;
45        N_DBPS = N_DBPS_BPSK12;
46        valid = 1;
47    case 15 %bin2dec('1111')
48        mod_order = BPSK;
49        code_rate = CODE34;
50        N_CBPS = N_CPBS_BPSK;
51        N_DBPS = N_DBPS_BPSK34;
52        valid = 1;
53    case 5 %bin2dec('0101')
54        mod_order = QPSK;
55        code_rate = CODE12;
56        N_CBPS = N_CPBS_QPSK;
57        N_DBPS = N_DBPS_QPSK12;
58        valid = 1;
59    case 7 %bin2dec('0111')
60        mod_order = QPSK;
61        code_rate = CODE34;
62        N_CBPS = N_CPBS_QPSK;
63        N_DBPS = N_DBPS_QPSK34;
64        valid = 1;
65    case 9 %bin2dec('1001')
66        mod_order = QAM16;
67        code_rate = CODE12;
68        N_CBPS = N_CPBS_16QAM;
69        N_DBPS = N_DBPS_16QAM12;
70        valid = 1;
71    case 11 %bin2dec('1011')
72        mod_order = QAM16;
73        code_rate = CODE34;
74        N_CBPS = N_CPBS_16QAM;
75        N_DBPS = N_DBPS_16QAM34;
76        valid = 1;
77    case 1 %bin2dec('0001')
78        mod_order = QAM64;
79        code_rate = CODE23;
80        N_CBPS = N_CPBS_64QAM;
81        N_DBPS = N_DBPS_64QAM23;
82        valid = 1;
83    case 3 %bin2dec('0011')
84        mod_order = QAM64;
85        code_rate = CODE34;
86        N_CBPS = N_CPBS_64QAM;
87        N_DBPS = N_DBPS_64QAM34;
88        valid = 1;
89    otherwise
90        mod_order = BPSK;
91        code_rate = CODE12;
92        N_CBPS = N_CPBS_BPSK;
93        N_DBPS = N_DBPS_BPSK12;
94        valid = 0;
95end %end switch
96       
97end %end function
98
Note: See TracBrowser for help on using the repository browser.