-
Notifications
You must be signed in to change notification settings - Fork 6
/
Fig12.m
278 lines (184 loc) · 7.96 KB
/
Fig12.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
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
% This Matlab script generates Figure 12 in the paper:
%
% Özlem Tugfe Demir and Emil Björnson,
% "Is Channel Estimation Necessary to Select Phase-Shifts for
% RIS-Assisted Massive MIMO?,"
% IEEE Transactions on Wireless Communications, vol. 21, no. 11, November
% 2022.
%
% This is version 1.0 (Last edited: 2023-08-23)
%
% License: This code is licensed under the GPLv2 license. If you in any way
% use this code for research that results in publications, please cite our
% paper as described above.
%Number of RISs
L = 2;
%Number of vertical and horizontal RIS units per RIS
NVer = 16;
NHor = 16;
PorVer = 4;
PorHor = 4;
NVerUE = 16;
NHorUE = 16;
%Number of UEs
K = 8;
%Number of BS antennas
M = 100;
%Select the number of setups with random UE locations
nbrOfSetups = 600;
%Number of channel realizations per setup
nbrOfRealizations = 1000;
%Total uplink pilot transmit power per UE (W)
etaa = 0.05;
%Communication bandwidth
B = 1e6;
%Noise figure (in dB)
noiseFigure = 7;
%Compute noise power
noiseVariancedBm = -174 + 10*log10(B) + noiseFigure;
%Noise power (dB)
noiseVariancedB = noiseVariancedBm-30;
%Select length of coherence block
tau_c = 1000;
%Angular standard deviation per path in the local scattering model (in degrees)
ASDazimDeg = 15;
ASDelevDeg = 15;
%Number of specular components with LOS component, h, G, f
SpecNum_h = 1;
SpecNum_G = 1;
SpecNum_f = 1;
%Power ratio of LOS to other specular components
LOStoSpecPow_h = 1;
LOStoSpecPow_G = 1;
LOStoSpecPow_f = 1;
%Direct link loss (dB)
DirectLoss = 0;
%Total pilot length for RIS
tau_p_RIS = (L*PorHor*PorVer+1)*K;
tau_coef = (L*PorHor*PorVer+1);
tau_p_RIS2 = tau_coef*K;
%Total pilot length for conventional operation without RIS
tau_coef_Conv = 4;
tau_p_Conv = tau_coef_Conv*K;
%Prelog factor for RIS
prelogFactor_RIS1 = (tau_c - tau_p_RIS)/tau_c;
prelogFactor_RIS2 = (tau_c - tau_p_RIS2)/tau_c;
prelogFactor_RIS3 = (tau_c - tau_p_RIS - tau_p_RIS2)/tau_c;
%Prelog factor for conventional operation without RIS
prelogFactor_Conv = (tau_c - tau_p_Conv)/tau_c;
SE_RIS_MR1 = zeros(K,nbrOfSetups,5);
SE_RIS_MR2b = zeros(K,nbrOfSetups,5);
SE_Conv_MR = zeros(K,nbrOfSetups);
SE_RIS_RZF1 = zeros(K,nbrOfSetups,5);
SE_RIS_RZF2b = zeros(K,nbrOfSetups,5);
SE_Conv_RZF = zeros(K,nbrOfSetups);
SE_RIS_AMMSE1 = zeros(K,nbrOfSetups,5);
SE_RIS_AMMSE2b = zeros(K,nbrOfSetups,5);
SE_Conv_AMMSE = zeros(K,nbrOfSetups);
SE_RIS_MR_maxmin1 = zeros(K,nbrOfSetups,5);
SE_RIS_MR_maxmin2b = zeros(K,nbrOfSetups,5);
SE_Conv_MR_maxmin = zeros(K,nbrOfSetups);
SE_RIS_RZF_maxmin1 = zeros(K,nbrOfSetups,5);
SE_RIS_RZF_maxmin2b = zeros(K,nbrOfSetups,5);
SE_Conv_RZF_maxmin = zeros(K,nbrOfSetups);
SE_RIS_AMMSE_maxmin1 = zeros(K,nbrOfSetups,5);
SE_RIS_AMMSE_maxmin2b = zeros(K,nbrOfSetups,5);
SE_Conv_AMMSE_maxmin = zeros(K,nbrOfSetups);
%%%%%%%%%%%%%%%%
RISpositions = zeros(L,1);
RISpositions(1) = 200+50*1i;
RISpositions(2) = 200-50*1i;
%Base UE distance to BS
BaseDistHor = 200;
%UE dropping area
AreaHorSize = 100;
AreaVerSize = 100;
%LOS probability (it is 0.5 if it will be determined by the formula)
probLOSbinary_f = 0.5;
probLOSbinary_h = 0.5;
%Rician factor loss for RIS-UE channels compared to the original formula
%(dB)
ricianFactorLoss_f = 0;
%Azimuth and elevation angle deviations for the specular components
%(radians)
AzimSpecDev = 60/180*pi;
ElevSpecDev = 15/180*pi;
%% Go through all setups
for setupp = 1:nbrOfSetups
disp(setupp)
%Power distribution among specular components other than LOS
PowDistSpec_h = rand(SpecNum_h-1,K);
PowDistSpec_f = rand(SpecNum_f-1,K,L);
PowDistSpec_G = rand(SpecNum_G-1,L);
%R and HMean is normalized
[Rh,HBar,Rf,fBar,RG_BS,RG_RIS,GBar,...
channelGaindB_h,channelGaindB_f,channelGaindB_G,...
probLOS_h,probLOS_f,ricianFactor_h,ricianFactor_f,ricianFactor_G,...
Rf_b,fBar_b,RG_RIS_b,GBar_b,...
channelGaindB_f_b,channelGaindB_G_b] =...
function_Setup_specular(L,K,M,NHor,NVer,ASDazimDeg,ASDelevDeg,...
SpecNum_h,SpecNum_G,SpecNum_f,DirectLoss,RISpositions,BaseDistHor,AreaHorSize,AreaVerSize,...
probLOSbinary_h,probLOSbinary_f,ricianFactorLoss_f,AzimSpecDev,ElevSpecDev);
channelGaindB_h = channelGaindB_h - noiseVariancedB;
channelGaindB_f = channelGaindB_f - noiseVariancedB;
channelGaindB_f_b = channelGaindB_f_b - noiseVariancedB;
poww = etaa*ones(K,1);
RISassignments = functionRISassignment(channelGaindB_h,channelGaindB_f,channelGaindB_G,...
L,K,NVer,NHor,NVerUE,NHorUE);
[Rh2,HBar2,H,Hhat_Conv,bb1,bHat1,Ctilde1,bb2,bHat2,Ctilde2,bb3,bHat3,Ctilde3,...
bb4,bHat4,Ctilde4,bb5,bHat5,Ctilde5] = ...
functionChannelEstimationRIS_individual(Rh,HBar,Rf,fBar,RG_BS,RG_RIS,GBar,...
channelGaindB_h,channelGaindB_f,channelGaindB_G,...
probLOS_h,probLOS_f,ricianFactor_h,ricianFactor_f,ricianFactor_G,...
nbrOfRealizations,L,K,M,etaa,NVer,NHor,NVerUE,NHorUE,RISassignments,tau_p_Conv,PorVer,PorHor,...
SpecNum_h,SpecNum_G,SpecNum_f,LOStoSpecPow_h,LOStoSpecPow_G,LOStoSpecPow_f,...
PowDistSpec_h,PowDistSpec_f,PowDistSpec_G);
[SE_MR0, SE_RZF0, SE_AMMSE0, SE_MR_maxmin0, SE_RZF_maxmin0, SE_AMMSE_maxmin0 ] = ...
functionComputeSEConv(Rh2,HBar2,H,Hhat_Conv,K,M,tau_p_Conv,etaa,nbrOfRealizations,poww,SpecNum_h);
SE_Conv_MR(:,setupp) = prelogFactor_Conv*SE_MR0;
SE_Conv_RZF(:,setupp) = prelogFactor_Conv*SE_RZF0;
SE_Conv_AMMSE(:,setupp) = prelogFactor_Conv*SE_AMMSE0;
SE_Conv_MR_maxmin(:,setupp) = prelogFactor_Conv*SE_MR_maxmin0;
SE_Conv_RZF_maxmin(:,setupp) = prelogFactor_Conv*SE_RZF_maxmin0;
SE_Conv_AMMSE_maxmin(:,setupp) = prelogFactor_Conv*SE_AMMSE_maxmin0;
[SE_MR1, SE_RZF1, SE_AMMSE1, SE_MR_maxmin1, SE_RZF_maxmin1, SE_AMMSE_maxmin1 ] = functionComputeSERIS(bb1,bHat1,Ctilde1,K,M,nbrOfRealizations,poww,etaa);
SE_RIS_MR1(:,setupp,1) = prelogFactor_RIS1*SE_MR1;
SE_RIS_RZF1(:,setupp,1) = prelogFactor_RIS1*SE_RZF1;
SE_RIS_AMMSE1(:,setupp,1) = prelogFactor_RIS1*SE_AMMSE1;
SE_RIS_MR_maxmin1(:,setupp,1) = prelogFactor_RIS1*SE_MR_maxmin1;
SE_RIS_RZF_maxmin1(:,setupp,1) = prelogFactor_RIS1*SE_RZF_maxmin1;
SE_RIS_AMMSE_maxmin1(:,setupp,1) = prelogFactor_RIS1*SE_AMMSE_maxmin1;
%%%%%%%%%%%%%%%
[bb1,bHat1,Ctilde1,bb2,bHat2,Ctilde2,bb3,bHat3,Ctilde3,...
bb4,bHat4,Ctilde4,bb5,bHat5,Ctilde5] = ...
functionChannelEstimationRIS_cascadedDominant(Rh,HBar,Rf,fBar,RG_BS,RG_RIS,GBar,...
channelGaindB_h,channelGaindB_f,channelGaindB_G,...
probLOS_h,probLOS_f,ricianFactor_h,ricianFactor_f,ricianFactor_G,...
nbrOfRealizations,L,K,M,etaa,NVer,NHor,NVerUE,NHorUE,RISassignments,tau_p_RIS2,...
SpecNum_h,SpecNum_G,SpecNum_f,LOStoSpecPow_h,LOStoSpecPow_G,LOStoSpecPow_f,...
PowDistSpec_h,PowDistSpec_f,PowDistSpec_G);
[SE_MR2, SE_RZF2, SE_AMMSE2, SE_MR_maxmin2, SE_RZF_maxmin2, SE_AMMSE_maxmin2 ] = functionComputeSERIS(bb1,bHat1,Ctilde1,K,M,nbrOfRealizations,poww,etaa);
SE_RIS_MR2b(:,setupp,1) = prelogFactor_RIS2*SE_MR2;
SE_RIS_RZF2b(:,setupp,1) = prelogFactor_RIS2*SE_RZF2;
SE_RIS_AMMSE2b(:,setupp,1) = prelogFactor_RIS2*SE_AMMSE2;
SE_RIS_MR_maxmin2b(:,setupp,1) = prelogFactor_RIS2*SE_MR_maxmin2;
SE_RIS_RZF_maxmin2b(:,setupp,1) = prelogFactor_RIS2*SE_RZF_maxmin2;
SE_RIS_AMMSE_maxmin2b(:,setupp,1) = prelogFactor_RIS2*SE_AMMSE_maxmin2;
%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%
end
Conv = vec(SE_Conv_RZF_maxmin);
RIS1 = vec(SE_RIS_RZF_maxmin1(:,:,1));
RIS2b = vec(SE_RIS_RZF_maxmin2b(:,:,1));
%% Figure 12
nbrOfPoints = length(Conv);
figure;
hold on; box on; grid on;
set(gca,'fontsize',16);
ppp1 = plot(sort(Conv),linspace(0,1,nbrOfPoints),'k:','LineWidth',2);
ppp2 = plot(sort(RIS1),linspace(0,1,nbrOfPoints),'b-','LineWidth',2);
ppp3 = plot(sort(RIS2b),linspace(0,1,nbrOfPoints),'r--','LineWidth',2);
xlabel('SE per UE [b/s/Hz]','Interpreter','Latex');
ylabel('CDF','Interpreter','Latex');
legend({'Conv-mMIMO', 'RIS-mMIMO, Short-Term', 'RIS-mMIMO, Long-Term' },'Interpreter','Latex','Location','SouthEast');
xlim([0 6]);