-
Notifications
You must be signed in to change notification settings - Fork 0
/
SIMO.m
54 lines (47 loc) · 958 Bytes
/
SIMO.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
clc;
%clear variables;
%%
frames = 200; % frames / Eb/No value
Nsymbols = 20; % OFDM Symbos / Frame
M = 4; %QPSK
L = 50;
x = 0:3:40;
%[Convolutional, LinearBlock, PolarCode]
coding = "LinearBlock";
%[Fading,AWGN}
channel = "Fading";
%{SC,MRC}
selc = "MRC";
%%
BER = [];
c = 1;
if M == 4
modu = "QPSK";
elseif M == 16
modu = "16QAM";
elseif M == 64
modu = "64QAM";
else
modu = "QPSK";
end
for EbNo = 0:3:40
error = 0;
total = 0;
for i = 1:1:frames
[err, tot] = OFDMframeSIMO(Nsymbols,L,M,EbNo,coding,channel,selc);
error = error + err;
total = total + tot;
end
BER(c) = error / total;
c = c + 1
end
%%
figure
semilogy(x,BER,'linewidth',2,'marker','o');
%hold on
%semilogy(x,BERsc,'linewidth',2,'marker','o');
title(['BER VS Eb/No (SIMO) ' coding ' - ' modu ]);
xlabel('Eb/No (db)')
ylabel('BER')
%legend('OFDM Selection combining');
%legend('OFDM MRC','OFDM Selection combining');