raychannelmatrix.m
function [H]=raychannelmatrix(M,N,L,AOA,AOD,dr,dt,lambda,G)
H=0;
for l=1:1:L
ang1=AOA(l);
ang2=AOD(l);
temp1=[1];
temp2=[1];
for p=1:1:M-1
temp1=[temp1; exp(-j*2*pi*p*dt*cos(ang1)/lambda)]
end
temp2=[1];
for q=1:1:N-1
temp2=[temp2 ;exp(-j*2*pi*q*dr*cos(ang2)/lambda)]
end
H=H+G(l)*temp2*temp1';
end
plotRTM.m
M=20;
N=10;
L=4;
lambda=5*10^(-3);
dr=lambda/4;
dt=lambda/4;
for trial=1:1:25
G=rand(1,L)*10;
AOA=rand(1,L)*pi;
AOD=rand(1,L)*pi;
H=raychannelmatrix(M,N,L,AOA,AOD,dr,dt,lambda,G);
figure(1)
subplot(5,5,trial)
imagesc(abs(H));
figure(2)
subplot(5,5,trial)
imagesc(angle(H));
end
