added SNR and SINR footprint images

This commit is contained in:
2026-04-26 11:46:25 -07:00
parent 5cbb395684
commit e19e9870d7
3 changed files with 21 additions and 14 deletions
+2 -2
View File
@@ -7,7 +7,7 @@ function L_FSPL_dB = pathLoss(obj, d)
L_FSPL_dB (:, 1) double
end
% Free Space Path Loss (dB)
L_FSPL_dB = 20*log10(d) + 20*log10(obj.f_c) + 20*log10((4*pi)/obj.c);
% Free Space Path Loss (dB); d clamped away from zero (log undefined at d=0)
L_FSPL_dB = 20*log10(max(d, eps)) + 20*log10(obj.f_c) + 20*log10((4*pi)/obj.c);
end
+18 -11
View File
@@ -9,6 +9,8 @@ function f = plotPerformance(obj, altitude, otherSensorsPos, otherSensors)
f (1, 1) {mustBeA(f, "matlab.ui.Figure")};
end
otherSensorsPos = otherSensorsPos + [0, 0, altitude];
% Create grid on which to evalute SINR, SNR
agentPos = [0, 0, altitude];
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));
SNR = reshape(SNR, size(targetPosX));
% normalize
SINR = SINR ./ max(SINR);
SNR = SNR ./ max(SNR);
% normalize in linear scale
SINR = 10.^(SINR/10); SINR = SINR ./ max(SINR(:)); SINR = 10 * log10(SINR);
SNR = 10.^(SNR/10); SNR = SNR ./ max(SNR(:)); SNR = 10 * log10(SNR);
f = figure;
imagesc(SNR);
axis("image");
colorbar;
title("Normalized SNR");
tiledlayout(1, 2, TileSpacing="compact", Padding="compact");
f = figure;
imagesc(SINR);
axis("image");
nexttile;
imagesc(distances, distances, SNR);
axis("image"); set(gca, 'YDir', 'normal');
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
+1 -1
View File
@@ -46,7 +46,7 @@ classdef test_rfSensor < matlab.unittest.TestCase
tc.testClass = tc.testClass.initialize(P_TX, BW, f_c, G_RX_dBi);
altitude = 30;
otherSensorsPos = [5, 0, 400]; % relative to main sensor
otherSensorsPos = [6, -4, -1]; % relative to main sensor
otherSensors = cell(1, 1);
otherSensors{1} = tc.testClass; % 2 identical sensors