-
Notifications
You must be signed in to change notification settings - Fork 146
/
STTC_stage_modulation.m
105 lines (103 loc) · 3.78 KB
/
STTC_stage_modulation.m
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
96
97
98
99
100
101
102
103
104
105
function [dlt,slt,M]=STTC_stage_modulation(state,NRx)
%MIMO-OFDM Wireless Communications with MATLAB¢ç Yong Soo Cho, Jaekwon Kim, Won Young Yang and Chung G. Kang
%2010 John Wiley & Sons (Asia) Pte Ltd
switch state
case '4_State_4PSK', M=4; Ns=4;
case '8_State_4PSK', M=4; Ns=8;
case '16_State_4PSK', M=4; Ns=16;
case '32_State_4PSK', M=4; Ns=32;
case '8_State_8PSK', M=8; Ns=8;
case '16_State_8PSK', M=8; Ns=16;
case '32_State_8PSK', M=8; Ns=32;
case 'DelayDiv_8PSK', M=8; Ns=8;
case '16_State_16qam', M=16; Ns=16;
case 'DelayDiv_16qam', M=16; Ns=16;
otherwise, disp('Wrong option !!');
end
base = reshape(1:Ns,M,Ns/M)'; slt = repmat(base,M,1);
stc_bc16 = [ 0 0;11 1; 2 2; 9 3; 4 4;15 5; 6 6;13 7;
8 8; 3 9;10 10; 1 11;12 12; 7 13;14 14; 5 15];
for n = 1:M
l = n-1;
ak=bitget(l,1); bk=bitget(l,2); dk=bitget(l,3); ek=bitget(l,4);
switch M
% 4 PSK
case 4 % NOTE: trace criterion option implemented as an example
for m = 1:Ns
k = m-1;
ak_1 = bitget(k,1); bk_1 = bitget(k,2);
ak_2 = bitget(k,3); bk_2 = bitget(k,4);
ak_3 = bitget(k,5); bk_3 = bitget(k,6);
switch Ns
case 4 %4state_4psk
if NRx~=2
dlt(m,n,1) = mod(2*bk_1+ak_1,M);%rank & determinant criteria
dlt(m,n,2) = mod(2*bk+ak,M);
else
dlt(m,n,1) = mod(2*bk_1+ak_1,M);%rank & determinant criteria
dlt(m,n,2) = mod(2*bk+ak,M);
end
case 8 %8state_4psk
if NRx~=2
dlt(m,n,1) = mod(2*ak_2+2*bk_1+ak_1,M);%rank & determinant criteria
dlt(m,n,2) = mod(2*ak_2+2*bk+ak,M);
else
dlt(m,n,1)= mod(2*bk_1+2*bk+ak_1+2*ak,M); %trace criterion
dlt(m,n,2)= mod(bk_1+2*ak_2+2*bk+2*ak_1,M);
end
case 16 %16state_4psk
if NRx~=2
dlt(m,n,1) = mod(2*ak_2+2*bk_1+ak_1,M);%rank & determinant criteria
dlt(m,n,2) = mod(2*bk_2+2*ak_1+2*bk+ak,M);
else
dlt(m,n,1)=mod(2*bk_3+2*ak_3+3*bk_2+3*bk_1+2*ak_1+2*ak,M); %trace criterion
dlt(m,n,2)=mod(2*bk_3+3*bk_2+bk_1+2*ak_1+2*bk+2*ak,M);
end
case 32 %32state_4psk
dlt(m,n,1) = mod(2*ak_3+3*bk_2+2*ak_2+2*bk_1+ak_1,M); % rank & determinant criteria
dlt(m,n,2) = mod(2*ak_3+3*bk_2+2*bk_1+ak_1+2*bk+ak,M);
end
end
% 8 PSK
case 8 % 'rank & determinant' criteria only
for m = 1:Ns
k = m - 1;
ak_1 = bitget(k,1); bk_1 = bitget(k,2); dk_1 = bitget(k,3);
ak_2 = bitget(k,4); bk_2 = bitget(k,5);
switch Ns
case 8
switch state
case '8_State_8PSK'
dlt(m,n,1) = mod(4*dk_1+2*bk_1+5*ak_1,M);
dlt(m,n,2) = mod(4*dk+2*bk+ak,M);
case 'DelayDiv_8PSK'
dlt(m,n,1)=mod(4*dk_1+2*bk_1+ak_1,M);
dlt(m,n,2)=mod(4*dk+2*bk+ak,M);
end
case 16 %16state_8psk
dlt(m,n,1) = mod(ak_2+4*dk_1+2*bk_1+5*ak_1,M);
dlt(m,n,2) = mod(5*ak_2+4*dk_1+2*bk_1+ak_1+4*dk+2*bk+ak,M);
case 32 %32state_8psk
dlt(m,n,1) = mod(2*bk_2+3*ak_2+4*dk_1+2*bk_1+5*ak_1,M);
dlt(m,n,2) = mod(2*bk_2+7*ak_2+4*dk_1+2*bk_1+ak_1+4*dk+2*bk+ak,M);
end
end
% 16 QAM
case 16% 'rank & determinant' criteria only
for m = 1:Ns
k = m - 1;
ak_1 = bitget(k,1); bk_1 = bitget(k,2);
dk_1 = bitget(k,3); ek_1 = bitget(k,4);
switch Ns
case 16
switch state
case '16_State_16qam'
dlt(m,n,1) = stc_bc16(k+1,1); dlt(m,n,2) = stc_bc16(k+1,2)-m+n;
case 'DelayDiv_16qam'
dlt(m,n,1) = mod(8*ek_1+4*dk_1+2*bk_1+ak_1,M);
dlt(m,n,2) = mod(8*ek+4*dk+2*bk+ak,M);
end
end
end
end
end