-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathPart3.m
59 lines (38 loc) · 1.69 KB
/
Part3.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
SNR = (1:1:25); %Range of SNR values
count = 10; %Iterations per SNR value for more accurate result
% Error Rate Vs SNR for [OOK with Linear Block Coding]
figure();
finalErrorRate = SNRTraverse (SNR, count, 'Part2_OOK');
semilogy(SNR, max(10^(-5),finalErrorRate));
title( {'Error Rate Vs SNR';'\fontsize{8}OOK with Linear Block Coding'},'FontWeight','normal','fontsize',10)
xlabel('SNR')
ylabel('Error Rate')
hold on;
finalErrorRate = SNRTraverse (SNR, count, 'Part3_OOKLinear');
semilogy(SNR, max(10^(-5),finalErrorRate));
legend({'None', 'Linear'},'Location','southwest')
disp("~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~")
% Error Rate Vs SNR for [OOK with Hamming Encoding]
figure();
finalErrorRate = SNRTraverse (SNR, count, 'Part2_OOK');
semilogy(SNR, max(10^(-5),finalErrorRate));
title( {'Error Rate Vs SNR';'\fontsize{8}OOK with Hamming Encoding'},'FontWeight','normal','fontsize',10)
xlabel('SNR')
ylabel('Error Rate')
hold on;
finalErrorRate = SNRTraverse (SNR, count, 'Part3_OOKHamming');
semilogy(SNR, max(10^(-5),finalErrorRate));
legend({'None','Hamming'},'Location','southwest')
disp("~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~")
% Error Rate Vs SNR for [OOK with Cyclic Block Coding]
figure();
finalErrorRate = SNRTraverse (SNR, count, 'Part2_OOK');
semilogy(SNR, max(10^(-5),finalErrorRate));
title( {'Error Rate Vs SNR';'\fontsize{8}OOK with Cyclic Block Coding'},'FontWeight','normal','fontsize',10)
xlabel('SNR')
ylabel('Error Rate')
hold on;
finalErrorRate = SNRTraverse (SNR, count, 'Part3_OOKCyclic');
semilogy(SNR, max(10^(-5),finalErrorRate));
legend({'None', 'Cyclic'},'Location','southwest')
disp("~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~")