from Path Loss by DBR Rawat
Matlab code and Plot for plane earth model and free space model used in wireless communication

free_space_plane_earth_model.m
%*********************************************************************
%***Author:  	       Danda B. Rawat
%***Department:        ECE, ODU, Norfolk, VA, USA
%***Date:              02/06/2007
%***Modified:          02/06/2007
%***Email:             dbrawat@gmail.com
%*********************************************************************
%Program for free sapace model and plane earth model for wave propagation

f=800000000
c=300000000
R_free_space = 1:10:40000;
lp_freespace =((4*pi*R_free_space*f)/c).^2


subplot(2,2,1); 
plot(R_free_space,lp_freespace)
xlabel('x--> R (distance in Meter)'); 
ylabel('y--> Lp (Path loss)'); 
title('Free space model'); 
grid on

subplot(2,2,2); 
plot(R_free_space,10*log(lp_freespace))
xlabel('x--> R (distance in Meter)'); 
ylabel('y--> Lp (Path loss in dB)'); 
title('Free space model'); 
grid on


%plane earth model

lp(1)=1
ht=10
hr=10
R_plane_earth = 1:1000:40000
lp=0*R_plane_earth
size(lp)
lp_plane(1)=0
ii=0
for i=1:1000:40000
    ii=ii+1
    lp_plane(ii)=4*i.^4/(ht^2*hr^2)
end

subplot(2,2,3); 
plot(R_plane_earth,lp_plane)
xlabel('x (distance in m)'); 
ylabel('y (Path loss)'); 
title('Plane earth model') 
grid on


subplot(2,2,4); 
plot(R_plane_earth,10*log(lp_plane))
xlabel('x (distance in m)'); 
ylabel('y (Path loss in dB)'); 
title('Plane earth model') 
grid on




Contact us at files@mathworks.com