Professional Documents
Culture Documents
Lab Slot:L37+L38
Prof: Abhijit Bhowmick
Submitted by:
Neeraj P-16BEC0091
RVR Abhiram-17BEC0085
Tanay Raj-17BEC0135
Vishak VS-17BEC0126
Task1
MATLAB Code:
i)
clc;clear all; close all;
% For n=2 & Ps=10
numb_simul=1000;
n=2;
Ps=10;
d=linspace(1,8,20);
for i=1:length(d);
signal_power=0;
for k=1:numb_simul
%%gen of signal
signal=randsrc(1,1);
%%gen of noise
var=1;
std1=sqrt(var);
noise=normrnd(0,std1,1,1);
%%channel
h1= 1/sqrt(2)*(randn(1,1)+j*randn(1,1));%Rayleigh
h=abs(h1);
Rec_signal=(sqrt(Ps)*h.*signal)/(sqrt(d(i)^n))+noise;
signal_power=signal_power+sum(abs((Rec_signal).^2));
end
avg_Rxsignal_power(i)=(signal_power/numb_simul);
ii)
%%path loss
pathloss(i)=Ps-avg_Rxsignal_power(i);
if pathloss(i)<=0
avg_pathloss(i)=0;
else
avg_pathloss(i)=pathloss(i);
end
end
iii)
iv)
Output:
Inference:
Some inferences which may be drawn from the above obtained graph are:
• The received power decreases as we move away from the receiver.
• The received power decreases more rapidly with the increase in the
path loss exponent for example in case of Ps =10,
When n=2, the received power is 6.423dB when distance is 1.368m
When n=3, the received power is 5.097dB when distance is 1.368m
• There is an effect in the path loss as well, it is more when the path
loss exponent is large and finally tend to saturate when distance is
large, for example when Ps=10
If n=2, the path loss is 8.161dB when distance is 3.121m
If n=3, the path loss is 8.705dB when distance is 3.121m