www.gusucode.com > phased 案例源码 matlab代码程序 > phased/FreeSpacePathLossInDBExample.m

    %% Free Space Path Loss in dB
% Assume a transmitter is located at _(1000,250,10)_ in
% the global coordinate system. Assume a target is located at
% _(3000,750,20)_. The transmitter operates at 1 GHz.
% Determine the free space path loss in decibels for a narrowband signal
% propagating to and from the target.
[tgtrng,~] = rangeangle([3000; 750; 20],[1000; 250; 10]);
%%
% Multiply the range by two for two-way propagation.
tgtrng = 2*tgtrng;
%%
% Determine the wavelength for 1 GHz.
lambda = physconst('LightSpeed')/1e9;
%%
% Solve for the loss using |fspl|.
L = fspl(tgtrng,lambda)
%%
% The free space path loss in decibels is approximately 105 dB.
%%
% Alternatively, you can compute the loss directly from
Loss = pow2db((4*pi*tgtrng/lambda)^2)