TO DISPALY RAYLEIGH AWGN PLOT AND CALCULATE LCR AND AFD PLOT AND VERIFYING IT WITH MONTE CARLO
clc;
clear all;
close all;
% description of the values
N=100;
d=input('enter the velocity in km/hr ');
fc=input('enter the carrier frequency in hz');
% finding doppler frequency
v=d*5/18;
lambda=(3*(10^8))/fc;
vmax=v/lambda;
% definig 8000 samples
s= 8000;
Ts=1/s;
t=0:2*Ts:2;
u=500;
% envelope of inphase and qudrature
a=length(t);
% r_I=zeros(1,a);
% r_Q=zeros(1,a);
b=sqrt(N);
vmaxa=zeros(1,length(u));
%monte carlo
r=1:500;
for ua =1:u
r_I=zeros(1,a);
r_Q=zeros(1,a);
% b=sqrt(N);
for k=1:N
theta=rand*360;
phi=rand*360;
r_I=r_I+(randn*cos(2*pi*vmax*cosd(theta)*t+phi)*(1/b));
r_Q=r_Q+(randn*sin(2*pi*vmax*cosd(theta)*t+phi)*(1/b));
end
z=(r_I+1i*r_Q);
x=abs(z);
y=10*log(x);
% LCR and ADF
w=10^-0.3;
rms=sqrt(mean(x.^2));
wh=w/(sqrt(2)*rms);
df=(vmax*2);
T=1/df;
c1=0;
c2=0;
for j=1:length(x)
if x(j) > w
c1=c1+1;
end
if x(j) < w
c2=c2+1;
end
end
LCR_n =((c1/2)/(T*s))+1/2;
% estimating the velocity after the numerical LCR
vmaxa(ua)=LCR_n/(sqrt(2*pi)*wh*exp(-(wh^2)));
end
ka=mean(vmaxa);
ve=vmaxa*lambda;
velo=ve*18/5;
k=sum(velo);
v=k/u;
display(v);
plot(r,velo);
title('DIFFERENT VALUES OF VELOCITY');
xlabel('ITERATION ');
ylabel('VELOCITY');
Cite As
raghav khandelwal (2024). TO DISPALY RAYLEIGH AWGN PLOT AND CALCULATE LCR AND AFD PLOT AND VERIFYING IT WITH MONTE CARLO (https://www.mathworks.com/matlabcentral/fileexchange/50854-to-dispaly-rayleigh-awgn-plot-and-calculate-lcr-and-afd-plot-and-verifying-it-with-monte-carlo), MATLAB Central File Exchange. Retrieved .
MATLAB Release Compatibility
Platform Compatibility
Windows macOS LinuxCategories
Tags
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!Discover Live Editor
Create scripts with code, output, and formatted text in a single executable document.
Version | Published | Release Notes | |
---|---|---|---|
1.0.0.0 |