CS计算机代考程序代写 clear all

clear all
clc

wd=(-2:0.1:2);%antenna matrix
wh=(-2:0.1:2);

%reflection network
[D,H]=meshgrid(wd,wh);
z0=4;

% user location
x0=0;
y0=0;

N=2;% number of antennas
phi=0.5*pi;
theta=0.6*pi;
P=20;
a = array_response(phi,theta, N);%antenna response
yita=(x0-D).^2+(y0-H).^2+z0.^2;
lambda=632.45*10^(-9);%wavelength
s=0.5.*(z0./pi).^0.5.*yita.^(-0.75).*exp(-2*pi.*1i.*yita.^0.5./lambda);%effective channel
figure(1)
mesh(D,H,abs(s));

%generate noise
N0=1;
noise = wgn(size(D,1),size(D,2),10*log10(N0),’dBw’);%AWGN signal
r=P.^0.5.*s.*a+noise;
figure(2)
mesh(D,H,abs(r));