www.gusucode.com > CDMA小区网络源码程序 > CDMA小区网络源码程序/pathloth.m

     x_bs=0; %location of BS
y_bs=0;
x_ms=200; %location of MS
y_ms=300;
r_hexagon=364;
hb=30; %base station antenna effective height,Unit:m
hm=1.5; %mobile station antenna effective height,Unit:m
c=3; %0db for medium cities & suburban areas; 3db for metropolis
f=2145; %WCDMA downlink channel,Unit:MHz
B=5*10^6; %WCDMA carrier bandwidth
pt=3; %dB,33dbm,10lg(w*1000)=10lgw+30=dBm,WCDMA maximum output power 33,27,24,21dBm
n0=10^(-19); %AWGN power spectrum density
x_hexagon=[x_bs-r_hexagon,x_bs-1/2*r_hexagon,x_bs+1/2*r_hexagon,x_bs+r_hexagon,x_bs+1/2*r_hexagon,x_bs-1/2*r_hexagon,x_bs-r_hexagon];
y_hexagon=[y_bs,y_bs-r_hexagon,y_bs-r_hexagon,y_bs,y_bs+r_hexagon,y_bs+r_hexagon,y_bs];
plot(x_hexagon,y_hexagon)
axis([-1000 1000 -1000 1000])
text(x_bs,y_bs,'+')
text(x_ms,y_ms,'*')
d_bs_ms=sqrt((x_ms-x_bs)^2+(y_ms-y_bs)^2)*0.001; %Unit:km
ahm=(1.1*log10(f)-0.7)*hm-(1.56*log10(f)-0.8); %mobile station antenna height correction factor
pathloss=46.3+33.9*log10(f)-13.82*log10(hb)-ahm+(44.9-6.55*log10(hb))*log10(d_bs_ms)+c; %cost231-hata,Unit:dB
pr=pt-pathloss; %dB
prw=10^(pr/10);
SNR=prw/(n0*B);
fprintf('%f\t\n',SNR);