-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathshow_results.m
168 lines (131 loc) · 3.9 KB
/
show_results.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
%% Confronto Nit, n = 576 r = 5
clear all;
close all;
load results/Nit/Copy_of_Nit1.mat;
Pbit1 = Pbit;
SNR_dB1 = SNR_dB;
load results/Nit/Copy_of_Nit10.mat;
Pbit2 = Pbit;
SNR_dB2 = SNR_dB;
load results/Nit/Copy_of_Nit50.mat;
Pbit3 = Pbit;
SNR_dB3 = SNR_dB;
load results/Nit/Copy_of_Nit100.mat;
Pbit4 = Pbit;
SNR_dB4 = SNR_dB;
%Uncoded BER
SNR_dBU = [5 : 7 , 7.2];
SNR = 10.^(SNR_dBU/10);
Pbit_uncoded = qfunc(sqrt(2*SNR));
% show results
figure;
set(0,'defaultTextInterpreter','latex') % to use LaTeX format
set(gca,'FontSize',14);
semilogy(SNR_dB1,Pbit1,'k-',SNR_dB2,Pbit2,'rs-',SNR_dB3,Pbit3,'go-',SNR_dB4,Pbit4,'b+-',SNR_dBU,Pbit_uncoded,'b--','LineWidth',2,'MarkerSize',10)
axis([5 7.2 1e-7 1e-1])
hleg = legend('Nit = 1',...
'Nit = 10',...
'Nit = 50',...
'Nit = 100','Uncoded BER');
set(hleg,'position',[0.15 0.13 0.20 0.15]);
xlabel('SNR $\Gamma$ [dB]')
ylabel('BER $P_{\rm bit}$')
set(gca, 'XMinorTick', 'on', 'YMinorTick', 'on',...
'YGrid', 'on', 'XGrid', 'on');
%% - Confronto rate, n = 576 Nit = 50
clear all;
load results/r/Copy_of_r1.mat;
Pbit1 = Pbit;
SNR_dB1 = SNR_dB;
load results/r/Copy_of_r2.mat;
Pbit2 = Pbit;
SNR_dB2 = SNR_dB;
load results/r/Copy_of_r3.mat;
Pbit3 = Pbit;
SNR_dB3 = SNR_dB;
load results/r/Copy_of_r5.mat;
Pbit5 = Pbit;
SNR_dB5 = SNR_dB;
%Uncoded BER
SNR_dBU = [1 : 7 , 7.2];
SNR = 10.^(SNR_dBU/10);
Pbit_uncoded = qfunc(sqrt(2*SNR));
% show results
figure;
set(0,'defaultTextInterpreter','latex') % to use LaTeX format
set(gca,'FontSize',14);
semilogy(SNR_dB1,Pbit1,'k-',SNR_dB2,Pbit2,'go-',SNR_dB3,Pbit3,'b+-',SNR_dB5,Pbit5,'rs-',SNR_dBU,Pbit_uncoded,'b--','LineWidth',2,'MarkerSize',10)
axis([1 7.2 1e-5 0.2e-0])
hleg = legend('R = 1/2'...
,'R = 2/3 B'...
,'R = 3/4 A'...
,'R = 5/6'...
,'Uncoded BER');
%set(hleg,'position',[0.15 0.13 0.20 0.15]);
xlabel('SNR $\Gamma$ [dB]')
ylabel('BER $P_{\rm bit}$')
set(gca, 'XMinorTick', 'on', 'YMinorTick', 'on',...
'YGrid', 'on', 'XGrid', 'on');
%% - Confronto n, R=3 Nit = 50
clear all;
load results/n/n576;
Pbit1 = Pbit;
SNR_dB1 = SNR_dB;
load results/n/Copy_of_n1344_prova.mat;
Pbit2 = Pbit;
SNR_dB2 = SNR_dB;
load results/n/Copy_of_n2304.mat;
Pbit3 = Pbit;
SNR_dB3 = SNR_dB;
%Uncoded BER
SNR_dBU = [1 : 7 , 7.2];
SNR = 10.^(SNR_dBU/10);
Pbit_uncoded = qfunc(sqrt(2*SNR));
% show results
figure;
set(0,'defaultTextInterpreter','latex') % to use LaTeX format
set(gca,'FontSize',14);
semilogy(SNR_dB1,Pbit1,'k-',SNR_dB2,Pbit2,'go-',SNR_dB3,Pbit3,'rs-',SNR_dBU,Pbit_uncoded,'b--','LineWidth',2,'MarkerSize',10)
axis([3 6 1e-5 1e-1])
hleg = legend('n = 576'...
,'n = 1344'...
,'n = 2304','Uncoded BER');
set(hleg,'position',[0.15 0.13 0.20 0.15]);
xlabel('SNR $\Gamma$ [dB]')
ylabel('BER $P_{\rm bit}$')
set(gca, 'XMinorTick', 'on', 'YMinorTick', 'on',...
'YGrid', 'on', 'XGrid', 'on');
%% - Confronto BICM, n = 576 R = 5
clear all;
% load results/r/Copy_of_r5.mat;
% Pbit1 = Pbit;
% SNR_dB1 = SNR_dB;
load results/BICM/qpsk.mat;
Pbit2 = Pbit;
SNR_dB2 = SNR_dB;
load results/BICM/16qam.mat;
Pbit3 = Pbit;
SNR_dB3 = SNR_dB;
SNR_3 = 10.^(SNR_dB3/10); %Linear SNR range
SNR_dB3 = 10*log10(SNR_3*4/2);
load results/BICM/64qam2.mat;
Pbit5 = Pbit;
SNR_dB5 = SNR_dB;
SNR_5 = 10.^(SNR_dB5/10); %Linear SNR range
SNR_dB5 = 10*log10(SNR_5*6/2);
%Uncoded BER
% SNR_dBU = [1 : 7 , 7.2];
% SNR = 10.^(SNR_dBU/10);
% Pbit_uncoded = qfunc(sqrt(2*SNR));
% show results
figure;
set(0,'defaultTextInterpreter','latex') % to use LaTeX format
set(gca,'FontSize',14);
semilogy(SNR_dB2,Pbit2,'go-',SNR_dB3,Pbit3,'rs-',SNR_dB5,Pbit5,'b+-','LineWidth',2,'MarkerSize',10)
axis([4 19 1e-5 1])
hleg = legend('QPSK','16-QAM','64-QAM');
set(hleg,'position',[0.15 0.13 0.20 0.15]);
xlabel('SNR $\Gamma$ [dB]')
ylabel('BER $P_{\rm bit}$')
set(gca, 'XMinorTick', 'on', 'YMinorTick', 'on',...
'YGrid', 'on', 'XGrid', 'on');