?? hata_simulate.m
字號:
% 仿真程序
clear;
hold off;
d=10:10:1000; % 距離10~1000m之間抽樣,步長10m
dkm=d/1000; % 換算成千米
para=[900 100 1.6; 900 200 1.6]; %仿真參數(shù),分兩組數(shù)據(jù)如下
%第一組: fc=900MHz,hte=100m,hre=1.6m
%第二組: fc=900MHz,hte=200m,hre=1.6m
% 計算不同地理類型下的路徑損耗值,并繪制路徑損耗與T-R距離的關(guān)系圖
for t=1:4 % 4種地理類型
for i=1:2 % 兩組數(shù)據(jù)
% 第t種地理類型 第i組數(shù)據(jù)得到的路徑損耗值
pl=hata(dkm,para(i,1),para(i,2),para(i,3),t);
if i==1
plot(d,pl,'k-');
else
plot(d,pl,'b-.');
end
hold on;
end
end
% 注釋和坐標(biāo)
legend('fc=900MHz,hte=100m,hre=1.6m','fc=900MHz,hte=200m,hre=1.6m');
title('Hata路徑損耗與T-R距離的關(guān)系');
xlabel('T-R距離(m)');
ylabel('路徑損耗(dB)')
pause;
hold off;
dist=[1];% 1km
% 路徑損耗與頻率的關(guān)系
f=10:10:1500; %單位:MHz
for t=1:4 % 4種地理類型
for j=1:length(f)
p(j)=hata(dist,f(j),100,1.6,t);
% 在distance=1km,hte=100m,hre=1.6m下計算頻率對路徑的損耗
end
if t==1
plot(f,p,'k:O');
elseif t==2
plot(f,p,'g-');
elseif t==3
plot(f,p,'b-.');
else
plot(f,p,'r*')
end
%t==1與t==2相近,用眼睛敏感的green實線穿過t==1的黑色":O"線來標(biāo)識t==2
hold on;
end
% 注釋和坐標(biāo)
legend('中小城市','大城市','郊區(qū)','農(nóng)村地區(qū)');
title('Hata路徑損耗與頻率的關(guān)系');
xlabel('載波頻率f(MHz)')
ylabel('路徑損耗(dB)')
?? 快捷鍵說明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -