Sie sind auf Seite 1von 7

# MATLAB CODE:

clc;
clear all;
close all;
Nt=5;
Nr=10;

## snrdB=0:1:10; %-----------snr values in dB, for which capacity will

be computed
snr=10.^(snrdB/10);
Cut=zeros(1,length(snr));
%---------capacity of a uninformed
transmitter i.e., without CSIT
Cit=zeros(1,length(snr));
%---------capacity of an informed
transmitter i.e., with CSIT
Cut_tot=zeros(1,length(snr));
Cit_tot=zeros(1,length(snr));
count=100;
for k=1:count
H=randn(Nr,Nt)+i*randn(Nr,Nt); %---------channel matrix H
[U,S,V]=svd(H); %----------singular value decomposition of H
sv=diag(S); %--------------non-zero singular values of H
ev=sv.*sv; %--------------eigen values of H
r=rank(H); %--------------computing rank of H
for i=1:length(snr)
%CAPACITY CALCULATION FOR EQUAL POWER ALLOCATION WITHOUR CSIT
for j=1:r
Cut(i)=Cut(i)+log2(1+((snr(i)/Nt)*ev(j)));
end
%WATER POURING ALGORITHM FOR CALCULATION OF CAPACITY WITH CSIT
p=1;
Pi=zeros(1,r);
while(Pi(r-p+1)<=0)
x=0;
for j=1:r-p+1
x=x+(1/ev(j));
end
Mu=(Nt/(r-p+1))*(1+(1/snr(i))*x);
for j=1:r-p+1
Pi(j)=Mu-(Nt/((snr(i))*ev(j)));

end
if Pi(r-p+1)<=0
Pi(r-p+1)=0;
end
p=p+1;
end
for j=1:r
Cit(i)=Cit(i)+log2(1+((snr(i)/Nt)*Pi(j)*ev(j)));
end
end
Cut_tot=Cut_tot+Cut;
Cit_tot=Cit_tot+Cit;
end
Cut_avg=Cut_tot/count;
Cit_avg=Cit_tot/count;
for i=1:length(snr)
diff(i)=Cit_avg(i)-Cut_avg(i);
end
%----------------PLOTS----------------------%
figure
plot(snrdB,Cut_avg,'-*r')
hold on
plot(snrdB,Cit_avg,'-o')
hold on
plot(snrdB,diff,'->g')
xlabel('SNR in dB')
ylabel('Capacity')
legend('without CSIT','with CSIT','difference in capacity')

## 2. CAPACITY WITH AND WITHOUT CSIT FOR 10X5 MIMO SYSTEM

clc;
clear all;
close all;
Nt=10;
%---------No. of transmitter antennas
snrdB=0:1:10; %-----------snr values in dB, for which capacity will
be computed
snr=10.^(snrdB/10);
Cut=zeros(1,length(snr));
%---------capacity of a uninformed
transmitter i.e., without CSIT
Cit=zeros(1,length(snr));
%---------capacity of an informed
transmitter i.e., with CSIT

Cut_tot=zeros(1,length(snr));
Cit_tot=zeros(1,length(snr));
count=100;
for k=1:count
H=randn(Nr,Nt)+i*randn(Nr,Nt); %---------channel matrix H
[U,S,V]=svd(H); %----------singular value decomposition of H
sv=diag(S); %--------------non-zero singular values of H
ev=sv.*sv; %--------------eigen values of H
r=rank(H); %--------------computing rank of H
for i=1:length(snr)
%CAPACITY CALCULATION FOR EQUAL POWER ALLOCATION WITHOUR CSIT
for j=1:r
Cut(i)=Cut(i)+log2(1+((snr(i)/Nt)*ev(j)));
end
%WATER POURING ALGORITHM FOR CALCULATION OF CAPACITY WITH CSIT
p=1;
Pi=zeros(1,r);
while(Pi(r-p+1)<=0)
x=0;
for j=1:r-p+1
x=x+(1/ev(j));
end
Mu=(Nt/(r-p+1))*(1+(1/snr(i))*x);
for j=1:r-p+1
Pi(j)=Mu-(Nt/((snr(i))*ev(j)));
end
if Pi(r-p+1)<=0
Pi(r-p+1)=0;
end
p=p+1;
end
for j=1:r
Cit(i)=Cit(i)+log2(1+((snr(i)/Nt)*Pi(j)*ev(j)));
end
end
Cut_tot=Cut_tot+Cut;
Cit_tot=Cit_tot+Cit;
end
Cut_avg=Cut_tot/count;
Cit_avg=Cit_tot/count;
for i=1:length(snr)
diff(i)=Cit_avg(i)-Cut_avg(i);

end
%----------------PLOTS----------------------%
figure
plot(snrdB,Cut_avg,'-*r')
hold on
plot(snrdB,Cit_avg,'-o')
hold on
plot(snrdB,diff,'->g')
xlabel('SNR in dB')
ylabel('Capacity')
legend('without CSIT','with CSIT','difference in capacity')

PLOTS:
1. Nt<Nr

2. Nt>Nr

EC6325
MIMO COMMUNICATION
SYSTEMS
ASSIGNMENT

SUBMITTED BY:
NAMITHA R
S2 TELECOMMUNICATION
M110253EC

OBSERVATION:
1.Nt>Nr
diff =

3.3068
3.4490
3.5999
3.7543
4.3157
4.4270
4.5244
4.6082

3.9072

4.0539

4.1909

0.0251

0.0169

0.0112

2.Nt<Nr
diff =

0.1053
0.0755
0.0532
0.0368
0.0074
0.0048
0.0031
0.0020