-
Notifications
You must be signed in to change notification settings - Fork 12
/
Copy pathmain03_TestNetwork.m
359 lines (345 loc) · 18.4 KB
/
main03_TestNetwork.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
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
% These MATLAB scripts are prepared by A.M.E for the following paper,
% Ahmet M. Elbir, "CNN-based Precoder and Combiner Design in mmWave MIMO Systems", IEEE Communications Letters, in press.
% please cite the above work if you use this file. For any comments and
% questions please email: ahmetmelbir@gmail.com
addpath('./AltMin/Narrowband');
addpath(genpath('./AltMin'));
% profile on
%%
SNR_index = -20:5:20; % noise added to the received signal.
SNR_TEST_DATA = 10;%-10:5:30; % synthetic noise added to the test data.
xIndex = SNR_index;
% xIndex = SNR_TEST_DATA;
Ntrial = 10;
%% Select Methods.
t = num2cell(1:11);
[iFullOPT, iFullSOMP, iDASOPT, iRASOPT, iDBest, iDASHB, iRASDHB, iDASAltMin, iRASAltMin, iDASSOMP, iRASSOMP] = deal(t{:});
% tempSet = [iDASHB iDASSOMP iDBest];
if Nr == Nrs %% Full Array Test
selectedMethods = [iDASOPT, iDBest, iDASHB, iDASAltMin, iDASSOMP];
LegendsR{iDASOPT} = 'OPT'; MarkerSet{iDASOPT} = 'none';LineStyleSet{iDASOPT} = '-'; % optimum BF. subarray
LegendsR{iDASHB} = 'HBDL' ;MarkerSet{iDASHB} = 'pentagram';LineStyleSet{iDASHB} = '-'; % DAS + DHB
LegendsR{iDBest} = 'Best' ;MarkerSet{iDBest} = 'pentagram';LineStyleSet{iDBest} = '-.'; % DAS + DHB
LegendsR{iDASAltMin} = 'PE Alt-Min';MarkerSet{iDASAltMin} = 'v';LineStyleSet{iDASAltMin} = '-'; % DAS + MOAltMin
LegendsR{iDASSOMP} = 'SOMP'; MarkerSet{iDASSOMP} = '<';LineStyleSet{iDASSOMP} = '-.';
else % Antenna Selection Test.
selectedMethods = [iDASOPT, iRASOPT, iDASHB, iRASDHB, iDASAltMin, iRASAltMin, iDASSOMP, iRASSOMP];
% selectedMethods = [iFullOPT, iFullSOMP, iDASOPT, iRASOPT, iDASHB, iRASDHB, iDASAltMin, iRASAltMin, iDASSOMP, iRASSOMP];
LegendsR{iFullOPT} = 'Full Array, OPT' ;MarkerSet{iFullOPT} = 'o';LineStyleSet{iFullOPT} = '-';% optimum BF. Full array
% LegendsR{iFullDHB} = 'Full array, DHB' ;MarkerSet{iFullDHB} = 'pentagram';LineStyleSet{iFullDHB} = '-'; % DAS + DHB
% LegendsR{iFullAltMin} = 'Subarray, DAS + MO Alt-Min';MarkerSet{iFullAltMin} = 'v';LineStyleSet{iFullAltMin} = '-'; % DAS + MOAltMin
LegendsR{iFullSOMP} = 'Full Array, SOMP' ; MarkerSet{iFullSOMP} = 'none' ;LineStyleSet{iFullSOMP} = '-' ;% full array + SOMP
LegendsR{iDASOPT} = 'DAS + OPT'; MarkerSet{iDASOPT} = 'none';LineStyleSet{iDASOPT} = '-'; % optimum BF. subarray
LegendsR{iDASHB} = 'DAS + DHB' ;MarkerSet{iDASHB} = 'pentagram';LineStyleSet{iDASHB} = '-'; % DAS + DHB
LegendsR{iRASDHB} = 'RAS + DHB' ;MarkerSet{iRASDHB} = '*';LineStyleSet{iRASDHB} = '-.'; % RAS + DHB
LegendsR{iDASAltMin} = 'DAS + MO Alt-Min';MarkerSet{iDASAltMin} = 'v';LineStyleSet{iDASAltMin} = '-'; % DAS + MOAltMin
LegendsR{iRASAltMin} = 'RAS + MO Alt-Min'; MarkerSet{iRASAltMin} = '^';LineStyleSet{iRASAltMin} = '-'; % RAS + MOAltMin
LegendsR{iRASSOMP} = 'RAS + SOMP'; MarkerSet{iRASSOMP} = '<';LineStyleSet{iRASSOMP} = '-';
LegendsR{iDASSOMP} = 'DAS + SOMP'; MarkerSet{iDASSOMP} = '<';LineStyleSet{iDASSOMP} = '-.';
LegendsR{iRASOPT} = 'RAS + OPT'; MarkerSet{iRASOPT} = 'none';LineStyleSet{iRASOPT} = '-.';
end
sA = cell(numel(selectedMethods),1); % selected antennas.
sRF = cell(numel(selectedMethods),1); % selected RF Chains.
%% Test Data.
dataAntennaSelection = XAS;
labelsAntennaSelection = categorical(Y);
Nray = opts.Nray_param;
Ncl = opts.Ncl_param;
Nscatter = Nray*Ncl;
%%
if length(idx) > Ntrial
trialIndex = idx(1:Ntrial); % Validation data indices.
else
trialIndex = idx;%(1:Ntrial); % Validation data indices.
end
%% Generate Array Positions.
rng(4096);
c = 3e8;
fc = 28e9;
lambda = c/fc;
Nt = opts.Nt_param(1);
txarray = phased.PartitionedArray(...
'Array',phased.URA([sqrt(Nt) sqrt(Nt)],lambda/2),...
'SubarraySelection',ones(NtRF,Nt),'SubarraySteering','Custom');
rxarray = phased.PartitionedArray(...
'Array',phased.URA([sqrt(Nr) sqrt(Nr)],lambda/2),...
'SubarraySelection',ones(NrRF,Nr),'SubarraySteering','Custom');
txpos = getElementPosition(txarray)/lambda;
rxpos = getElementPosition(rxarray)/lambda;
%%
Nx = length(xIndex);
Ropt0 = zeros(Nx,Ntrial,3); Ropt = zeros(Nx,numel(selectedMethods));
Rhyb0 = zeros(Nx,Ntrial,3); Rhyb = zeros(Nx,numel(selectedMethods));
for i = 1:length(xIndex)
%% SNR TEST
snr = db2pow(xIndex(i));
snrTEST = SNR_TEST_DATA;
Ns = opts.Ns_param;
Ncl = opts.Ncl_param;
xLabel = 'SNR, [dB]';
%% SNRTESTDATA TEST
% snr = db2pow(SNR_index);
% snrTEST = SNR_TEST_DATA(i);
% Ns = opts.Ns_param;
% Ncl = opts.Ncl_param;
% xLabel = 'SNR_{TEST}, [dB]';
%%
for iTrial = trialIndex
%% Generate Data.
% H = Z(1,iTrial).H; % No noise.
H = awgn(Z(1,iTrial).H,snrTEST,'Measured');
Ar = Z(1,iTrial).Ar;
At = Z(1,iTrial).At;
Arb = Z(1,iTrial).Arb;
Atb = Z(1,iTrial).Atb;
txang = Z(1,iTrial).txang;
rxang = Z(1,iTrial).rxang;
if opts.selectOutputAsPhases == 1
FrfSelected = Z(1,iTrial).FrfSelected;
WrfSelected = Z(1,iTrial).WrfSelected;
FbbSelected = Z(1,iTrial).FbbSelected;
WbbSelected = Z(1,iTrial).WbbSelected;
else
DOASelected = Z(1,iTrial).DOASelected;
DODSelected = Z(1,iTrial).DODSelected;
end
randomSelection = subSet(randi([size(subSet,1)],1),:);
for iM = selectedMethods
switch iM
case iFullOPT %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%% Full Array, baseband beamformer. Optimum.
sA{iM} = 1:Nr;
%%
[Fopt,Wopt] = helperOptimalHybridWeights(H(sA{iM},:),Ns,1/snr);
Ropt0(i,iTrial,iM) = helperComputeSpectralEfficiency(H(sA{iM},:),Fopt,Wopt,Ns,snr);
Rhyb0(i,iTrial,iM) = Ropt0(i,iTrial,iM);
case iRASOPT %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%% RAS, baseband beamformer. Optimum.
sA{iM} = randomSelection;
%%
[Fopt,Wopt] = helperOptimalHybridWeights(H(sA{iM},:),Ns,1/snr);
Ropt0(i,iTrial,iM) = helperComputeSpectralEfficiency(H(sA{iM},:),Fopt,Wopt,Ns,snr);
Rhyb0(i,iTrial,iM) = Ropt0(i,iTrial,iM);
case iDASOPT %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%% DAS, Deep Antenna Selection.
XTest(:,:,1) = abs(H);
XTest(:,:,2) = real(H);
XTest(:,:,3) = imag(H);
YTest = Z(1,iTrial).Y;
timeCNNTemp = tic;
[YPred,~] = classify(convnetAntennaSelection,XTest); % find the best array index.
timeCNN0(iTrial) = toc(timeCNNTemp);
YPred = str2num(char(YPred));
accuracy0(i,iTrial,1) = mean(YPred == (YTest).'); % compute accuracy.
sA{iM} = subSet(YPred,:);
%%
[Fopt,Wopt] = helperOptimalHybridWeights(H(sA{iM},:),Ns,1/snr);
Ropt0(i,iTrial,iM) = helperComputeSpectralEfficiency(H(sA{iM},:),Fopt,Wopt,Ns,snr);
Rhyb0(i,iTrial,iM) = Ropt0(i,iTrial,iM);
case iDBest %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
sA{iM} = sA{iDASOPT};
%%
[Fopt,Wopt] = helperOptimalHybridWeights(H(sA{iM},:),Ns,1/snr);
Frf = FrfSelected;
Fbb = FbbSelected;
% Fbb = (Frf'*Frf)\Frf'*Fopt;
% Fbb = sqrt(Ns)*Fbb/norm(Frf*Fbb,'fro');
Wrf = WrfSelected;
Wbb = WbbSelected;
% Wmmse = ((Fopt'*(H(sA{iM},:)'*H(sA{iM},:))*Fopt+1/snr*Ns*eye(Ns))\Fopt'*H(sA{iM},:)')';
% Ess = 1/Ns*eye(Ns);
% Eyy = H(sA{iM},:)*Fopt*Ess*Fopt'*H(sA{iM},:)'+ 1/snr*eye(Nrs);
% Wbb = (Wrf'*Eyy*Wrf)\(Wrf'*Eyy*Wmmse);
% Wrf = conj(Wrf);
% Wbb = conj(Wbb);
% Wbb = (Wrf'*Wrf)\Wrf'*Wopt;
% Wbb = sqrt(Ns)*Wbb/norm(Wrf*Wbb,'fro');
%% Test
% Wrf2 = conj(Wrf);
% Wbb2 = (Wbb);
% norm(Wopt - Wrf2*Wbb2)
%%
sRF{iM}.Frf = Frf;
sRF{iM}.Fbb = Fbb;
sRF{iM}.Wrf = Wrf;
sRF{iM}.Wbb = Wbb;
case iDASHB %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%% DAS + DHB.
sA{iM} = sA{iDASOPT};
%% DHB, Deep Hybrid Beamformer.
[Fopt,Wopt] = helperOptimalHybridWeights(H(sA{iM},:),Ns,1/snr);
XRFTest(:,:,1) = abs(H(sA{iM},:));
XRFTest(:,:,2) = real(H(sA{iM},:));
XRFTest(:,:,3) = imag(H(sA{iM},:)); % input data
timeCNNRFTemp = tic;
[YFRFPred] = double(predict(convnetFRFSelection,XRFTest)); % estimate precoder
[YWRFPred] = double(predict(convnetWRFSelection,XRFTest)); % estimate combiner
timeCNNRF0(iTrial) = toc(timeCNNRFTemp);
if opts.selectOutputAsPhases == 1
% find baseband beamformers
[Frf,Fbb] = findFrfFbb(H(sA{iM},:),Ns,NtRF,exp(1i*reshape(YFRFPred,[Nt,NtRF])));
[Wrf,Wbb] = findWrfWbb(H(sA{iM},:),Ns,NrRF,exp(-1i*reshape(YWRFPred,[Nrs,NrRF])),1/snr);
% Frf = exp(1i*reshape(YFRFPred,[Nt,NtRF]));
% Fbb = (Frf'*Frf)\Frf'*Fopt;
% Fbb = sqrt(Ns)*Fbb/norm(Frf*Fbb,'fro');
% Wrf = exp(1i*reshape(YWRFPred,[Nrs,NrRF]));
% Wrf = conj(Wrf);
% Wmmse = ((Fopt'*(H(sA{iM},:)'*H(sA{iM},:))*Fopt+1/snr*Ns*eye(Ns))\Fopt'*H(sA{iM},:)')';
% Ess = 1/Ns*eye(Ns);
% Eyy = H(sA{iM},:)*Fopt*Ess*Fopt'*H(sA{iM},:)'+ 1/snr*eye(Nrs);
% Wbb = (Wrf'*Eyy*Wrf)\(Wrf'*Eyy*Wmmse);
% Wbb = (Wrf'*Wrf)\Wrf'*Wopt;
% Wbb = sqrt(Ns)*Wbb/norm(Wrf*Wbb,'fro');
% Wrf = conj(Wrf);
% Wbb = conj(Wbb);
else
% DOA based approach/ not used.
txangEst = reshape(YFRFPred, [2, NtRF])*180/pi;
rxangEst = reshape(YWRFPred, [2, NrRF])*180/pi;
errorDOA(i,iTrial,iM) = rms(rms(DOASelected - txangEst)); % compute DOA error
errorDOD(i,iTrial,iM) = rms(rms(DODSelected - rxangEst)); % compute DOA error
AtEst = steervec(txpos,txangEst);
ArEst = steervec(rxpos,rxangEst);
[Frf,Fbb] = findFrfFbb(H(sA{iM},:),Ns,NtRF,AtEst);
[Wrf,Wbb] = findWrfWbb(H(sA{iM},:),Ns,NrRF,ArEst(sA{iM},:),1/snr);
end
% compute LS error.
error_F_Prediction0(i,iTrial,iM) = rms(rms ( sRF{iDBest}.Frf*sRF{iDBest}.Fbb - Frf*Fbb))/numel(Fopt);
error_W_Prediction0(i,iTrial,iM) = rms(rms ( sRF{iDBest}.Wrf*sRF{iDBest}.Wbb - Wrf*Wbb))/numel(Fopt);
sRF{iM}.Frf = Frf;
sRF{iM}.Fbb = Fbb;
sRF{iM}.Wrf = Wrf;
sRF{iM}.Wbb = Wbb;
case iRASDHB %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%% RAS + DHB.
sA{iM} = randomSelection;
%% DHB, Deep Hybrid Beamformer.
if opts.selectOutputAsPhases == 1
Frf = exp(1i*reshape(YFRFPred,[Nt,NtRF]));
Fbb = (Frf'*Frf)\Frf'*Fopt;
Fbb = sqrt(Ns)*Fbb/norm(Frf*Fbb,'fro');
Wrf = exp(1i*reshape(YWRFPred,[Nrs,NrRF]));
Wmmse = ((Fopt'*(H(sA{iM},:)'*H(sA{iM},:))*Fopt+1/snr*Ns*eye(Ns))\Fopt'*H(sA{iM},:)')';
Ess = 1/Ns*eye(Ns);
Eyy = H(sA{iM},:)*Fopt*Ess*Fopt'*H(sA{iM},:)'+ 1/snr*eye(Nrs);
Wbb = (Wrf'*Eyy*Wrf)\(Wrf'*Eyy*Wmmse);
Wrf = conj(Wrf);
Wbb = conj(Wbb);
% Wbb = (Wrf'*Wrf)\Wrf'*Wopt;
% Wbb = sqrt(Ns)*Wbb/norm(Wrf*Wbb,'fro');
else
txangEst = reshape(YFRFPred, [2, NtRF])*180/pi;
rxangEst = reshape(YWRFPred, [2, NrRF])*180/pi;
errorDOA(i,iTrial,iM) = rms(rms(DOASelected - txangEst)); % compute DOA error
errorDOD(i,iTrial,iM) = rms(rms(DODSelected - rxangEst)); % compute DOA error
AtEst = steervec(txpos,txangEst);
ArEst = steervec(rxpos,rxangEst);
[Frf,Fbb] = findFrfFbb(H(sA{iM},:),Ns,NtRF,AtEst);
[Wrf,Wbb] = findWrfWbb(H(sA{iM},:),Ns,NrRF,ArEst(sA{iM},:),1/snr);
end
sRF{iM}.Frf = Frf;
sRF{iM}.Fbb = Fbb;
sRF{iM}.Wrf = Wrf;
sRF{iM}.Wbb = Wbb;
case iDASAltMin %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%% DAS + Alt-Min.
sA{iM} = sA{iDASHB};
%%
[Fopt,Wopt] = helperOptimalHybridWeights(H(sA{iM},:),Ns,1/snr);
[Fmo,sRF{iM}.Frf,sRF{iM}.Fbb] = MO_AltMin_F( Fopt, NtRF, 1e-1);
[Wmo,sRF{iM}.Wrf,sRF{iM}.Wbb] = MO_AltMin_W( Wopt,Fopt,H(sA{iM},:), NrRF, 1/snr, 1e-1 );
case iRASAltMin %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%% RAS + Alt-Min.
sA{iM} = randomSelection;
%%
[Fopt,Wopt] = helperOptimalHybridWeights(H(sA{iM},:),Ns,1/snr);
[Fmo,sRF{iM}.Frf,sRF{iM}.Fbb] = MO_AltMin_F( Fopt, NtRF, 1e-1);
[Wmo,sRF{iM}.Wrf,sRF{iM}.Wbb] = MO_AltMin_W( Wopt,Fopt,H(sA{iM},:), NrRF, 1/snr, 1e-1 );
case iDASSOMP %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%% DAS + SOMP
sA{iM} = sA{iDASHB};
%% SOMP
[sRF{iM}.Fbb,sRF{iM}.Frf,sRF{iM}.Wbb,sRF{iM}.Wrf]...
= helperOMPHybridWeights(H(sA{iM},:),NtRF,NrRF,Ns,At,Ar(sA{iM},:),1/snr);
case iRASSOMP %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%% RAS + SOMP
sA{iM} = randomSelection;
%% SOMP
[sRF{iM}.Fbb,sRF{iM}.Frf,sRF{iM}.Wbb,sRF{iM}.Wrf]...
= helperOMPHybridWeights(H(sA{iM},:),NtRF,NrRF,Ns,At,Ar(sA{iM},:),1/snr);
end
%% Calculate sum-rate
if iM ~= iFullOPT && iM ~= iRASOPT && iM ~= iDASOPT
Ropt0(i,iTrial,iM) = helperComputeSpectralEfficiency(H(sA{iM},:),Fopt,Wopt,Ns,snr);
Rhyb0(i,iTrial,iM) = helperComputeSpectralEfficiency(H(sA{iM},:),...
sRF{iM}.Frf*sRF{iM}.Fbb,sRF{iM}.Wrf*sRF{iM}.Wbb,Ns,snr);
errorF0(i,iTrial,iM) = norm(Fopt - sRF{iM}.Frf*sRF{iM}.Fbb)/numel(Fopt);
errorW0(i,iTrial,iM) = norm(Wopt - (sRF{iM}.Wrf*sRF{iM}.Wbb))/numel(Wopt);
end
end
end
accuracy(i,1) = rms(accuracy0(i,trialIndex,1));
% accuracyRF(i,1) = rms(accuracyRF0(i,trialIndex,1));
for iM = selectedMethods
Ropt(i,iM) = rms(Ropt0(i,trialIndex,iM));
Rhyb(i,iM) = rms(Rhyb0(i,trialIndex,iM));
errorF(i,iM) = rms(errorF0(i,trialIndex,iM));
errorW(i,iM) = rms(errorW0(i,trialIndex,iM));
if iM == iDASHB
error_F_Prediction(i,iM) = rms(error_F_Prediction0(i,trialIndex,iM));
error_W_Prediction(i,iM) = rms(error_W_Prediction0(i,trialIndex,iM));
end
end
i
end
errorF(:,selectedMethods)
errorW(:,selectedMethods)
% Legends{1} = ['CNN_{AS}, N_{RS}=' num2str(Nrs)];
% Legends{2} = ['CNN_{RF}, N_{RS}=' num2str(Nrs)];
% | 'o' | '*' | '.' | 'x' | 'square' | 'diamond' | 'v' | '^' |
% '>' | '<' | 'pentagram' | 'hexagram' | 'none'.
% plotIndex = selectedMethods;
figure(101)
% subplot(211)
for k = selectedMethods
plotR(k) = plot(xIndex,Rhyb(:,k));
% plotR(k).Color = ColorSet(k,:);
plotR(k).Marker = MarkerSet{k};
plotR(k).LineStyle = LineStyleSet{k};
plotR(k).LineWidth = 1;
hold on
end
hold off
% plot(xIndex,[Ropt])
legend(LegendsR{selectedMethods},'Location','Best')
xlabel(xLabel)
ylabel('Spectral Efficiency [bits/s/Hz]')
% magnifyOnFigure;
% figure(102)
% plot(xIndex,error_F_Prediction(:,iDASHB))
% hold on
% for k = selectedMethods
% plotR(k) = plot(xIndex,errorF(:,k));
% % plotR(k).Color = ColorSet(k,:);
% plotR(k).Marker = MarkerSet{k};
% plotR(k).LineStyle = LineStyleSet{k};
% plotR(k).LineWidth = 1;
% end
% plot(xIndex,error_W_Prediction1(:,iDASHB))
% for k = selectedMethods
% plotR(k) = plot(xIndex,errorW1(:,k));
% % plotR(k).Color = ColorSet(k,:);
% plotR(k).Marker = MarkerSet{k};
% plotR(k).LineStyle = LineStyleSet{k};
% plotR(k).LineWidth = 1;
% hold on
% end
% hold off
% leg1 = legend('Prediction Error for $\textbf{F}_{RF}\textbf{F}_{BB}$',...
% LegendsR{selectedMethods},'Prediction Error for $\textbf{W}_{RF}\textbf{W}_{BB}$',LegendsR{selectedMethods});
% set(leg1,'Interpreter','latex');
% xlabel(xLabel)
display(['Figure Plotted: Hybrid Beamforming, N_T=' num2str(Nt) ', N_R=' num2str(Nr) '/N_{RS}=' num2str(Nrs) ', N_S=' num2str(Ns)])
% suggestedFileNameSNRTest = ['SNR_Test' , '_Nt' num2str(Nt) '_Nr' num2str(Nr) ...
% '_Nrs' num2str(Nrs) '_Ns' num2str(Ns) '_' fileNameLabelsTrainNet ]
beep