added SNR and SINR footprint images
This commit is contained in:
@@ -7,7 +7,7 @@ function L_FSPL_dB = pathLoss(obj, d)
|
|||||||
L_FSPL_dB (:, 1) double
|
L_FSPL_dB (:, 1) double
|
||||||
end
|
end
|
||||||
|
|
||||||
% Free Space Path Loss (dB)
|
% Free Space Path Loss (dB); d clamped away from zero (log undefined at d=0)
|
||||||
L_FSPL_dB = 20*log10(d) + 20*log10(obj.f_c) + 20*log10((4*pi)/obj.c);
|
L_FSPL_dB = 20*log10(max(d, eps)) + 20*log10(obj.f_c) + 20*log10((4*pi)/obj.c);
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|||||||
+18
-11
@@ -9,6 +9,8 @@ function f = plotPerformance(obj, altitude, otherSensorsPos, otherSensors)
|
|||||||
f (1, 1) {mustBeA(f, "matlab.ui.Figure")};
|
f (1, 1) {mustBeA(f, "matlab.ui.Figure")};
|
||||||
end
|
end
|
||||||
|
|
||||||
|
otherSensorsPos = otherSensorsPos + [0, 0, altitude];
|
||||||
|
|
||||||
% Create grid on which to evalute SINR, SNR
|
% Create grid on which to evalute SINR, SNR
|
||||||
agentPos = [0, 0, altitude];
|
agentPos = [0, 0, altitude];
|
||||||
d = max(10, max(vecnorm(otherSensorsPos(1:2), 2, 2)) * 1.25);
|
d = max(10, max(vecnorm(otherSensorsPos(1:2), 2, 2)) * 1.25);
|
||||||
@@ -22,20 +24,25 @@ function f = plotPerformance(obj, altitude, otherSensorsPos, otherSensors)
|
|||||||
SINR = reshape(SINR, size(targetPosX));
|
SINR = reshape(SINR, size(targetPosX));
|
||||||
SNR = reshape(SNR, size(targetPosX));
|
SNR = reshape(SNR, size(targetPosX));
|
||||||
|
|
||||||
% normalize
|
% normalize in linear scale
|
||||||
SINR = SINR ./ max(SINR);
|
SINR = 10.^(SINR/10); SINR = SINR ./ max(SINR(:)); SINR = 10 * log10(SINR);
|
||||||
SNR = SNR ./ max(SNR);
|
SNR = 10.^(SNR/10); SNR = SNR ./ max(SNR(:)); SNR = 10 * log10(SNR);
|
||||||
|
|
||||||
f = figure;
|
f = figure;
|
||||||
imagesc(SNR);
|
tiledlayout(1, 2, TileSpacing="compact", Padding="compact");
|
||||||
axis("image");
|
|
||||||
colorbar;
|
|
||||||
title("Normalized SNR");
|
|
||||||
|
|
||||||
f = figure;
|
nexttile;
|
||||||
imagesc(SINR);
|
imagesc(distances, distances, SNR);
|
||||||
axis("image");
|
axis("image"); set(gca, 'YDir', 'normal');
|
||||||
colorbar;
|
colorbar;
|
||||||
title("Normalized SINR");
|
xlabel("X (m)"); ylabel("Y (m)");
|
||||||
|
title("Linearly Normalized SNR (dB)");
|
||||||
|
|
||||||
|
nexttile;
|
||||||
|
imagesc(distances, distances, SINR);
|
||||||
|
axis("image"); set(gca, 'YDir', 'normal');
|
||||||
|
colorbar;
|
||||||
|
xlabel("X (m)"); ylabel("Y (m)");
|
||||||
|
title("Linearly Normalized SINR (dB)");
|
||||||
|
|
||||||
end
|
end
|
||||||
@@ -46,7 +46,7 @@ classdef test_rfSensor < matlab.unittest.TestCase
|
|||||||
tc.testClass = tc.testClass.initialize(P_TX, BW, f_c, G_RX_dBi);
|
tc.testClass = tc.testClass.initialize(P_TX, BW, f_c, G_RX_dBi);
|
||||||
|
|
||||||
altitude = 30;
|
altitude = 30;
|
||||||
otherSensorsPos = [5, 0, 400]; % relative to main sensor
|
otherSensorsPos = [6, -4, -1]; % relative to main sensor
|
||||||
otherSensors = cell(1, 1);
|
otherSensors = cell(1, 1);
|
||||||
otherSensors{1} = tc.testClass; % 2 identical sensors
|
otherSensors{1} = tc.testClass; % 2 identical sensors
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user