added SINR visualization
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
function SINR = sensorPerformance(obj, agentPos, targetPos, otherSensorsPos, otherSensors)
|
||||
function [SINR, SNR] = sensorPerformance(obj, agentPos, targetPos, otherSensorsPos, otherSensors)
|
||||
arguments (Input)
|
||||
obj (1, 1) {mustBeA(obj, "rfSensor")};
|
||||
agentPos (1, 3) double;
|
||||
@@ -8,6 +8,7 @@ function SINR = sensorPerformance(obj, agentPos, targetPos, otherSensorsPos, oth
|
||||
end
|
||||
arguments (Output)
|
||||
SINR (:, 1) double;
|
||||
SNR (:, 1) double;
|
||||
end
|
||||
assert(size(otherSensorsPos, 1) == size(otherSensors, 1), "Mismatch in number of other sensor positions (%d) and number of other sensors (%d) provided", size(otherSensorsPos, 1), size(otherSensors, 1));
|
||||
|
||||
@@ -16,10 +17,11 @@ function SINR = sensorPerformance(obj, agentPos, targetPos, otherSensorsPos, oth
|
||||
% Performance is measured as SINR for this sensor
|
||||
S = 10 .^ (0.1 .* obj.RSS(d, t, a)); % Signal
|
||||
I = zeros(size(d)); % Interference from other agents
|
||||
for ii = 1:size(otherSensors, 2)
|
||||
for ii = 1:size(otherSensors, 1)
|
||||
[d_other, t_other, a_other] = otherSensors{ii}.computePointToPoints(otherSensorsPos(ii, 1:3), targetPos);
|
||||
I = I + 10 .^ (0.1 .* otherSensors{ii}.RSS(d_other, t_other, a_other));
|
||||
end
|
||||
|
||||
SINR = 10*log10(S ./ (I + obj.N));
|
||||
SNR = 10*log10(S ./ obj.N);
|
||||
end
|
||||
Reference in New Issue
Block a user