Sie sind auf Seite 1von 6

https://in.mathworks.com/solutions/wireless-communications/resources.

html#channel-modeling

clc;
clear all;
close all;
Hte=30:1:100; % Base Station Antenna Height
Hre=input('Enter the receiver antenna height 3m<hre<10m : '); % Mobile Antenna
Height
d =input('Enter distance from base station 1Km<d<100Km : '); % Distance 30 Km
f=input('Enter the frequency 150Mhz<f<1920Mhz : ');
c=3*10^8;
lamda=(c)/(f*10^6);
Lf = 10*log((lamda^2)/((4*pi)^2)*d^2); % Free Space Propagation Loss
Amu = 35; % Median Attenuation Relative to Free Space (900 MHz and 30 Km)
Garea = 9; % Gain due to the Type of Environment (Suburban Area)
Ghte = 20*log(Hte/200); % Base Station Antenna Height Gain Factor
if(Hre>3)
Ghre = 20*log(Hre/3);
else
Ghre = 10*log(Hre/3);
end
% Propagation Path Loss
L50 = Lf+Amu-Ghte-Ghre-Garea;
display('Propagation pathloss is : ');
disp(L50);
plot(Hte,L50,'LineWidth',1.5);
title('Okumura Model Analysis');
xlabel('Transmitter antenna Height (Km)');
ylabel('Propagation Path loss(dB) at 50 Km');
grid on;

clc;
close all;
clear all;

d = 1:0.01:20;
hm = 5;
hb1 = 30;
hb2 = 100;
hb3 = 200;
fc = 1000;
% a. For Large Cities
% fc >= 400MHz

ahm = 3.2*(log10(11.75*hm)).^2 - 4.97;

% A. Typical Urban

L50urban1 = 69.55 + 26.16*log10(fc) + (44.9 - 6.55*log10(hb1))*log10(d) -


13.82*log10(hb1) - ahm;
L50urban2 = 69.55 + 26.16*log10(fc) + (44.9 - 6.55*log10(hb2))*log10(d) -
13.82*log10(hb2) - ahm;
L50urban3 = 69.55 + 26.16*log10(fc) + (44.9 - 6.55*log10(hb3))*log10(d) -
13.82*log10(hb3) - ahm;
% B. Typical Suburban

L50suburban1 = L50urban1 - 2*(log10(fc/28)).^2 - 5.4;


L50suburban2 = L50urban2 - 2*(log10(fc/28)).^2 - 5.4;
L50suburban3 = L50urban3 - 2*(log10(fc/28)).^2 - 5.4;

% C. Typical Rural

L50rural1 = L50urban1 - 4.78*(log10(fc)).^2 + 18.33*log10(fc) - 40.94;


L50rural2 = L50urban2 - 4.78*(log10(fc)).^2 + 18.33*log10(fc) - 40.94;
L50rural3 = L50urban3 - 4.78*(log10(fc)).^2 + 18.33*log10(fc) - 40.94;

figure(1);
plot(d, L50urban1, 'r', d, L50urban2, '--r', d, L50urban3,':r');
hold on;
plot(d, L50suburban1, 'b', d, L50suburban2, '--b', d, L50suburban3, ':b');
hold on;
plot(d, L50rural1, 'g', d, L50rural2, '--g', d, L50rural3, ':g');
hold on;

legend('large urban hb=30', 'large urban hb=100', 'large urban hb=200',


'suburban hb=30', 'suburban hb=100', 'suburban hb=200', 'rural hb=30', 'rural
hb=100','rural hb=200');

grid on;
xlabel('d [km]');
ylabel('L [dB]');
title('Hata Model for different base station ant. ht. in different
environments');
Simaple path loss model
clc;
close all;
clear all;
f = input('Enter carrrier frequency(MHz)');
c = 300;
d = 1:1:10000;
Lp =((4*pi*d*f)/c).^2;
subplot(2,1,1);
plot(d,Lp,'b');
xlabel('x--> D (distance in Km)');
ylabel('y--> Lp (path loss)');
title('Free space model');
grid on
subplot(2,1,2);
plot(d,10*log(Lp),'r');
xlabel('x--> D (distance in Meter)');
ylabel('y--> Lp (Path loss in dB)');
title('Free space model');
grid on;

%long Normal shadowing


function Pr = log_normal_shadowing(Pt, Gt, Gr, lambda, L, pathlossExp, std_db, d0, d)
% log normal shadowing radio propagation model:
% Pr0 = friss(d0)
% Pr(db) = Pr0(db) - 10*n*log(d/d0) + X0
% where X0 is a Gaussian random variable with zero mean and a variance in db
% Pt * Gt * Gr * (lambda^2) d0^passlossExp (X0/10)
% Pr = --------------------------*-----------------*10
% (4 *pi * d0)^2 * L d^passlossExp
% calculate receiving power at reference distance
Pr0 = friis(Pt, Gt, Gr, lambda, L, d0);
% calculate average power loss predicted by path loss model
avg_db = -10.0 * pathlossExp * log10(d/d0);
% get power loss by adding a log-normal random variable (shadowing)
% the power loss is relative to that at reference distance d0
% question: reset rand does influcence random
rstate = randn('state');
randn('state', d);
powerLoss_db = avg_db + (randn*std_db+0); % random('Normal', 0, std_db);
randn('state', rstate);
% calculate the receiving power at distance d
Pr = Pr0 * 10^(powerLoss_db/10);
return;

clc;
clear all;
close all;
%%%%Parameters Setting%%%%%
d0=1;%1 meter
d=1;%meter
LightSpeedC=3e8;
WCDMACellular=2100*1000000;%hz
% LTECellular=2000*1000000;%hz
Freq=WCDMACellular
TXAntennaGain=1; %db
RXAntennaGain=1; %db
PTx=1e-03; % i.e. .001 watt assumptation
PathLossExponent=2; %Line Of sight
PTxdBm=10*log10(PTx*1000);
e=input ('Enter type of Environment (1 - Free Space, 2 - Urban area cellular radio, 3 -
Shadowed urban cellular radio, 4 - In building line-of-sight, 5 - Obstructed in
factories, 6 - Obstructed in building)--:');
% u=input ('Enter type of city (1 - urban , 2 - suburban, 3-rural)--:');
ht=input('Enter height of transmitting antenna(30 to 200m)--:');
hr=input('Enter height of receiving antenna(1 to 10m)--:');
d=input('Enter Distance in meter from 100 to 2000--:');
display('The Received Power for your given data is Pr0 in dB is');
if e==1
PathLossExponent=2;
elseif e==2
PathLossExponent=3.1;
elseif e==3
PathLossExponent=4;
elseif e==4
PathLossExponent=1.7;
elseif e==5
PathLossExponent=2.5;
else
PathLossExponent=5;
end
Wavelength=LightSpeedC/Freq;
Pr0=PTxdBm + TXAntennaGain + RXAntennaGain- (10*PathLossExponent*log10(4*pi/Wavelength))
display(Pr0);
figure
d=1;
% plot for entire range of frequencies
display('The plot for entire range of Distance from 100 to 2000 is shown in the plot');
h = waitbar(0,'plotting the Received Power for the entire range of Distance please
wait......');
% log normal Shadowing Radio Propagation model:
% Pr0 = friss(d0)
% Pr(db) = Pr0(db) - 10*PathLossExponent*log(d/d0) + n
% where n is a Gaussian random variable with zero mean and a variance in db
% Pt * Gt * Gr * (Wavelength^PathLossExponent) d0^PathLossExponent (n/10)
% Pr = ---------------------------------------------*-----------------------*10
% 4 *pi * d0^PathLossExponent d^PathLossExponent
% get power loss by adding a log-normal random variable (shadowing)
% the power loss is relative to that at reference distance d0
% reset rand does influcence random
rstate = randn('state');
randn('state', d);
%GaussRandom=normrnd(0,6)%mean+randn*sigma; %Help on randn
GaussRandom= (randn*0.1+0);
%disp(GaussRandom);
for d=100:2:2000
Pr1=Pr0-(10*2* log10(d/d0))+GaussRandom;
randn('state', rstate);
subplot(1,1,1);
plot(d,Pr1,'g','DisplayName','Free Space 2');hold on;
Pr2=Pr0-(10*3.1* log10(d/d0))+GaussRandom;
plot(d,Pr2,'k','DisplayName','Urban area 3.1');
Pr3=Pr0-(10*4* log10(d/d0))+GaussRandom;
plot(d,Pr3,'r','DisplayName','Shadowed urban 4');
Pr4=Pr0-(10*1.7* log10(d/d0))+GaussRandom;
plot(d,Pr4,'b','DisplayName','In building LOS 1.7');
Pr5=Pr0-(10*2.5* log10(d/d0))+GaussRandom;
plot(d,Pr5,'c','DisplayName','In factory 2.5');
title('The plot for entire range of Distance from 100 meters to 2000 meters');
legend('show','Location','southwest')
xlabel('Distance (in meters)');ylabel('Received Power (in dB)');
waitbar(d / 2000)
end
close(h);

fq = 4.5e9; % 4.5 GHz


tx = txsite('Name','Delhi', ...
'Latitude',28.6139, ...
'Longitude',77.209, ...
'Antenna',design(dipole,fq), ...
'AntennaHeight',60, ... % Units: meters
'TransmitterFrequency',fq, ... % Units: Hz
'TransmitterPower',10);
% Define receiver sites in several surrounding towns and cities
rxNames = {...
'noida, MA','gurgaon, MA','sonipat, MA','meerut, MA', ...
'faridabad, MA','ghaziabad, MA','bulandsha, MA','GraterNoida MA'};
rxLocations = [........
28.5355 77.3910 ; ... % Boston
28.4595 77.0266 ; ... % Lexington
28.9931 77.0151 ; ... % Concord
28.9845 77.7064 ; ... % Marlborough
28.4089 77.3178 ; ... % Hopkinton
28.6692 77.4538 ; ... % Holliston
28.4070 77.8498 ; ... % Foxborough
28.4744 77.5040 ]; % Quincy
% Define receiver sensitivity. Sensitivity is the minimum signal strength in
% power that is necessary for the receiver to accurately detect the signal.
rxSensitivity = -90; % Units: dBm
rxs = rxsite('Name',rxNames, ...
'Latitude',rxLocations(:,1), ...
'Longitude',rxLocations(:,2), ...
'Antenna',design(dipole,tx.TransmitterFrequency), ...
'ReceiverSensitivity',rxSensitivity); % Units: dBm
show(tx)
show(rxs)
coverage(tx,'freespace', ...
'SignalStrengths',rxSensitivity)
link(rxs,tx,'freespace')
coverage(tx,'rain','SignalStrengths', rxSensitivity)
link(rxs,tx,'rain')

Das könnte Ihnen auch gefallen