improved rfSensor response plotting

This commit is contained in:
2026-04-21 10:07:50 -07:00
parent adac72dbc8
commit fbc7fe18f4
2 changed files with 19 additions and 8 deletions
+6 -2
View File
@@ -7,7 +7,11 @@ function value = antennaGain(obj, t)
value (:, 1) double
end
% TODO
%% TODO
% Temporary logic to make nadir-pointing most effective
value = 10*log10(cosd(t));
value = 10*log10(cosd(t) .^ 8);
% % Temporary logic for 0 dB at all tilt angles
% value = zeros(size(t));
end
+13 -6
View File
@@ -7,8 +7,13 @@ function f = plotParameters(obj)
end
% Distance and tilt sample points
d = [0.01, 0.1, 0.25, 0.5, 0.75, 1:1:100];
t = zeros(size(d));
d_values = [0.01, 0.1, 0.25, 0.5, 0.75, 1, 2, 3, 4, 5:5:100];
% t = zeros(size(d));
t_values = -90:15:90;
% Make grid of values of distances and tilts
[d_mg, t_mg] = meshgrid(d_values, t_values);
d = d_mg(:); t = t_mg(:); % flatten
% Sample RSS function by distances, tilts
r_x = obj.RSS(d', t');
@@ -26,9 +31,10 @@ function f = plotParameters(obj)
grid("on");
title("RSS vs Distance");
xlabel("Distance (m)");
ylabel("RSS (dBm)");
ylabel("Tilt (deg)");
zlabel("RSS (dBm)");
hold("on");
plot(d, r_x, "LineWidth", 2);
surf(d_mg, t_mg, reshape(r_x, size(d_mg)));
hold("off");
% ylim([0, 1]);
@@ -37,8 +43,9 @@ function f = plotParameters(obj)
grid("on");
title("SNR vs Distance");
xlabel("Distance (m)");
ylabel("SNR (dB)");
ylabel("Tilt (deg)");
zlabel("SNR (dB)");
hold("on");
plot(d, s_x, "LineWidth", 2);
surf(d_mg, t_mg, reshape(s_x, size(d_mg)));
hold("off");
end