-
Notifications
You must be signed in to change notification settings - Fork 9
/
Copy paththreshold.m
66 lines (53 loc) · 1.77 KB
/
threshold.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
function [] = threshold ()
SNRdB = [-30 -20 -10 0];
SNRmin = 10 .^ (SNRdB ./ 10);
SNRrad = zeros(100, length(SNRmin), 500);
ERRORcomm = zeros(100, length(SNRmin), 500);
for idx = 1 : length(SNRmin)
for jdx = 1 : 100
[~, ~, SNR_rad, ERROR_comm, ~] = cyclic3 (SNRmin(idx));
for kdx = 1 : 500
SNRrad(jdx, idx, kdx) = SNR_rad(kdx);
ERRORcomm(jdx, idx, kdx) = ERROR_comm(kdx);
end
end
end
SNRradplot = mean(SNRrad);
ERRORcommplot = mean(ERRORcomm);
iterations = zeros(1, 500);
for ldx = 1 : 500
iterations(ldx) = ldx;
end
SNRrad1 = zeros(1, 500);
SNRrad2 = zeros(1, 500);
SNRrad3 = zeros(1, 500);
SNRrad4 = zeros(1, 500);
ERRORcomm1 = zeros(1, 500);
ERRORcomm2 = zeros(1, 500);
ERRORcomm3 = zeros(1, 500);
ERRORcomm4 = zeros(1, 500);
for iidx = 1 : 500
SNRrad1(iidx) = SNRradplot(1, 1, iidx);
SNRrad2(iidx) = SNRradplot(1, 2, iidx);
SNRrad3(iidx) = SNRradplot(1, 3, iidx);
SNRrad4(iidx) = SNRradplot(1, 4, iidx);
ERRORcomm1(iidx) = ERRORcommplot(1, 1, iidx);
ERRORcomm2(iidx) = ERRORcommplot(1, 2, iidx);
ERRORcomm3(iidx) = ERRORcommplot(1, 3, iidx);
ERRORcomm4(iidx) = ERRORcommplot(1, 4, iidx);
end
figure
plot(iterations, SNRrad1, iterations, SNRrad2, iterations, SNRrad3, iterations, SNRrad4, 'LineWidth', 1.5);
xlabel('iterations');
ylabel('Radar SNR (dB)');
legend('SNR_{min} = -30dB', 'SNR_{min} = -20dB', 'SNR_{min} = -10dB', 'SNR_{min} = -0dB');
title('Radar SNR Performance');
grid on;
figure
semilogy(iterations, ERRORcomm1, iterations, ERRORcomm2, iterations, ERRORcomm3, iterations, ERRORcomm4, 'LineWidth', 1.5);
xlabel('iterations)');
ylabel('BER');
legend('SNR_{min} = -30dB', 'SNR_{min} = -20dB', 'SNR_{min} = -10dB', 'SNR_{min} = -0dB');
title('Communication BER Performance');
grid on;
end