diff --git a/@rfSensor/sensorPerformance.m b/@rfSensor/sensorPerformance.m index 53f83e2..c11ab87 100644 --- a/@rfSensor/sensorPerformance.m +++ b/@rfSensor/sensorPerformance.m @@ -15,6 +15,8 @@ function [SINR, SNR] = sensorPerformance(obj, agentPos, targetPos, otherSensorsP [d, t, a] = obj.computePointToPoints(agentPos, targetPos); % Performance is measured as SINR for this sensor + %% TODO: how should interference calculation be modified for + % interference sources with different center frequencies and bandwidths? S = 10 .^ (0.1 .* obj.RSS(d, t, a)); % Signal I = zeros(size(d)); % Interference from other agents for ii = 1:size(otherSensors, 1) diff --git a/test/test_rfSensor.m b/test/test_rfSensor.m index ac2e76c..b939aed 100644 --- a/test/test_rfSensor.m +++ b/test/test_rfSensor.m @@ -48,7 +48,30 @@ classdef test_rfSensor < matlab.unittest.TestCase altitude = 30; otherSensorsPos = [6, -4, -1]; % relative to main sensor otherSensors = cell(1, 1); - otherSensors{1} = tc.testClass; % 2 identical sensors + otherSensors{1} = tc.testClass; % One interfering sensor, identical to the main sensor + + tc.testClass.plotPerformance(altitude, otherSensorsPos, otherSensors); + + end + + function plot_SINR_heterogenous_interferers(tc) + % Plot sensor performance with no sources of interference + P_TX = 1e-3; % Transmit power (Watts) + BW = 20e6; % Bandwidth (Hz) + f_c = 2e9; % Center frequency (Hz) + G_RX_dBi = 3; % Receiving Antenna Gain (dBi) + + tc.testClass = tc.testClass.initialize(P_TX, BW, f_c, G_RX_dBi); + + altitude = 30; + otherSensorsPos = [6, -4, -1; -2, 6, 0]; % relative to main sensor + otherSensors = cell(2, 1); + otherSensors{1} = rfSensor; % two heterogenous interfering sensors + otherSensors{2} = rfSensor; + + % Must use same center frequency and bandwidth for interference sources + otherSensors{1} = otherSensors{1}.initialize(10 * P_TX, BW, f_c, G_RX_dBi); + otherSensors{2} = otherSensors{2}.initialize(100 * P_TX, BW, f_c, G_RX_dBi); tc.testClass.plotPerformance(altitude, otherSensorsPos, otherSensors);