📄 drawaltitude.m
字号:
%The program is used to illustrate the loss of wavefront propagating forward %t-height of the source in meter%frequency-frequency of source in MHzfunction drawHeight(hs,frequency)epsilon0=1e-9/(36*pi);mu0=4*pi*1e-7;const=3e8;k0=2*pi*frequency*1e6/const;deltax=180;deltah=0.5;x=eps:deltax:200e3;height=eps:deltah:500;for k=1:length(x) tantheta(:,k)=(height' - hs)./x(k); dist(:,k) = sqrt((height' - hs).^2 + x(k)^2);endtheta=atan(tantheta);% direct=sqrt(4*pi)/(pi/12);% freep = sqrt(60*direct) ./ dist;% % p=k0*sin(theta);y=exp(-(height').^2*log(2)/(2*(k0)^2*sin(pi/12))).*exp(-i*height'*hs)-conj(exp(-(height').^2*log(2)/(2*(k0)^2*sin(pi/12)))).*exp(i*height'*hs);ans=y; % % %figure;plot(height,-20*log10(abs(ans)),'r');y=ifft(y);q=y; for m=2:length(x) q=exp(i*(k0).*deltax.*height'/6400000).*ifft(exp(-i*deltax.*k0.*(sin(theta(:,m))).^2 /2).*fft(q)); y=[y q];endfigure;h1=10;plot(x,-20*log10(abs(y(h1,:))),'r');xlabel('range in meter');ylabel('power in dB');titletext = strcat('场强随距离的变化,高度为(m): ');title(texlabel(titletext));hold on;h2=25;plot(x,-20*log10(abs(y(h2,:))),'g');h3=40;plot(x,-20*log10(abs(y(h3,:))),'b');legend(num2str(deltah*h1),num2str(deltah*h2),num2str(deltah*h3));hold off;figure;x1=100;plot(height,-20*log10(abs(fft(y(:,x1)))),'r');xlabel('height in meter');ylabel('power in dB');titletext = strcat('场强随高度的变化,在距离为(km): ');title(texlabel(titletext));hold on;x2=250;plot(height,-20*log10(abs(fft(y(:,x2)))),'g');x3=400;plot(height,-20*log10(abs(fft(y(:,x3)))),'b');legend(num2str(deltax*x1/1e3),num2str(deltax*x2/1e3),num2str(deltax*x3/1e3));hold off;% figure;% meshc(x,height,-20*log10(abs(y)));% figure;% meshc(x,height,-20*log10(abs(fp)));% figure;% meshc(x,height,-20*log10(abs(y./fp)));figure;image(-20*log10(abs(y)));keyboard;
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -