-
Notifications
You must be signed in to change notification settings - Fork 10
/
Copy pathmainEP.m
75 lines (57 loc) · 2.21 KB
/
mainEP.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
function mainEP(flagRun,dataEP,scenario)
if nargin==0
flagRun=1;
end
if dataEP.flagPSK, modName='PSK'; else modName='QAM'; end
if dataEP.scenario==1
dataEP.folderSave=['ResultsEQ/Results'];
else %MIMO
dataEP.folderSave=['ResultsMIMO/Results'];
end
if dataEP.scenario==2, Ants=['MIMO',num2str(dataEP.numberAntennas(1)),'x',num2str(dataEP.numberAntennas(2))], end
dataEP.folderSave=[dataEP.folderSave,num2str(dataEP.M),modName,'Lim',num2str(dataEP.LLRlim),dataEP.channelName];
if dataEP.flagBlockLengths==1
dataEP.folderSave=[dataEP.folderSave,'N',num2str(dataEP.channelBlockLength)];
end
if dataEP.flagEPiterations
dataEP.folderSave=[dataEP.folderSave,'S',num2str(dataEP.EPiterations)];
dataEP.BEP_S=dataEP.EPiterations;% BEP [Santos16], Default 10
dataEP.PBEP_S=dataEP.EPiterations; % P-BEP [Santos18], Default 3
dataEP.DBEP_S=dataEP.EPiterations; % D-BEP [Santos19], Default 1
dataEP.KSEP_S=dataEP.EPiterations;
% dataEP.DKSEP_S=dataEP.EPiterations;
% else
% dataEP.BEP_S=10; % BEP [Santos16], Default 10
% dataEP.PBEP_S=3; % P-BEP [Santos18], Default 3
% dataEP.DBEP_S=1; % D-BEP [Santos19], Default 1
% dataEP.KSEP_S=3;
% dataEP.DKSEP_S=1; % D-KSEP [Santos19], Default 1
end
%
%% Executing the simulation
if flagRun
parfor simulationNumber=1:dataEP.numberSimulations
%dataEP.simulationNumber=simulationNumber;
runSimulationNumber(dataEP,scenario,simulationNumber);
end
end
%% Plotting the figures
nameSave=[dataEP.folderSave,'/BER'];
if dataEP.flagEPiterations
nameSave=[nameSave,'vsTS',num2str(dataEP.EPiterations)];
else
nameSave=[nameSave,'vsSNRdB'];
end
if dataEP.flagBlockLengths
nameSave=[nameSave,'N',num2str(dataEP.channelBlockLength)];
end
if dataEP.scenario==1
Ants=[];
end
if isfield(dataEP,'long'),
aux=num2str(dataEP.rate,2);Rate=aux(3:end);
nameSave=[nameSave,num2str(dataEP.M),modName,Ants,'Lim',num2str(dataEP.LLRlim),'Long',Rate,dataEP.channelName,'Fr',num2str(dataEP.numberFrames*dataEP.numberSimulations)];
else
nameSave=[nameSave,num2str(dataEP.M),modName,Ants,'Lim',num2str(dataEP.LLRlim),dataEP.channelName,'Fr',num2str(dataEP.numberFrames*dataEP.numberSimulations)];
end
plotEPeqSNRdBSave(dataEP,nameSave,scenario)