clc;
clear;
% Constants
c = 3e8; % Speed of light (m/s)
% Parameters
frequencies = [600e6, 900e6, 1800e6, 2.4e9, 3.5e9]; % RF source frequencies (Hz)
Pt = 0.1; % Transmit Power (Watts) ~ 100 mW
Gt = 2; % Transmit antenna gain (unitless)
Gr = 2; % Receive antenna gain (unitless)
distances = 1:1:50; % Distance range (meters)
% Initialize matrix to store received power values
Pr_matrix = zeros(length(frequencies), length(distances));
% Loop over each frequency and distance
for i = 1:length(frequencies)
f = frequencies(i);
lambda = c / f;
for j = 1:length(distances)
d = distances(j);
% Friis Transmission Equation
Pr = Pt * Gt * Gr * (lambda / (4 * pi * d))^2;
Pr_matrix(i, j) = Pr;
end
end
% Plotting results
figure;
hold on;
colors = lines(length(frequencies));
for i = 1:length(frequencies)
plot(distances, Pr_matrix(i, :) * 1e6, 'LineWidth', 2, 'Color', colors(i, :)); % µW
end
hold off;
% Labels and Legends
xlabel('Distance from Transmitter (m)', 'FontSize', 12);
ylabel('Received Power (\muW)', 'FontSize', 12);
title('Received Power vs Distance for Various RF Frequencies', 'FontSize', 14);
legend({'600 MHz (TV)', '900 MHz (GSM)', '1800 MHz (LTE)', '2.4 GHz (Wi-Fi)', '3.5 GHz (5G)'}, ...
'Location', 'northeast');
grid on;