哪位高手能帮忙解释一下这个关于通信的Matlab程序？谢啦！

loveashen 2013-05-03 09:30:49
（1）ccdfcorrelation.m
%space time coding pp.35. Fig.1.24 |||| Fig.1.23
clear;
clc;
SNR1=20;
SNR=10^(SNR1/10);
X20=zeros(1,5);

Q201=zeros(1,5);
Q202=zeros(1,5);
Q203=zeros(1,5);
F=0;
ar=pi/36;
for k=1:1:5
m=k;
X20(k)=m;
F=0;
for x=0:0.000001:ar/2-0.000001
y=x+0.0000005;
F=F+ cos(2*pi*m*sin(y))/ar*0.000001;
end
Q201(k)=2*F;
F=0;
for x=0:0.000001:ar/2-0.000001
y=x+0.0000005;
F=F+ cos(2*pi*2*m*sin(y))/ar*0.000001;
end
Q202(k)=2*F;
F=0;
for x=0:0.000001:ar/2-0.000001
y=x+0.0000005
F=F+ cos(2*pi*3*m*sin(y))/ar*0.000001;
end
Q203(k)=2*F;
end
Capacity=zeros(5,10000);

I=eye(4);
R=zeros(4,4);
T=zeros(4,4);
for k=1:1:5
R=[1 Q201(k) Q202(k) Q203(k);Q201(k) 1 Q201(k) Q202(k); Q202(k) Q201(k) 1 Q201(k);Q203(k) Q202(k) Q201(k) 1];
T=I;
for i=1:1:10000
j=sqrt(-1);
for m=1:1:4
for n=1:1:4
h(m,n)=(randn(1)+j*randn(1))*sqrt(1/2);
end
end
H=[h(1,1) h(1,2) h(1,3) h(1,4);h(2,1) h(2,2) h(2,3) h(2,4);h(3,1) h(3,2) h(3,3) h(3,4);h(4,1) h(4,2) h(4,3) h(4,4)];
Capacity(k,i)=abs(log2(det(I+SNR/4*R'*H*T*H')));
end
end
for k=1:1:10000
j=sqrt(-1);
for m=1:1:4
for n=1:1:4
h(m,n)=(randn(1)+j*randn(1))*sqrt(1/2);
end
end
H=h;
% Capacity(k,i)=abs(log2(det(I+SNR/6*R'*H*T*H')));

Capacity_r(k)=abs(log2(det(I+SNR/4*H*H')));

end

Capacity1=zeros(1,10000);
Capacity2=zeros(1,10000);
Capacity3=zeros(1,10000);
Capacity4=zeros(1,10000);
Capacity5=zeros(1,10000);

P=zeros(1,100);
P1=zeros(1,100);
P2=zeros(1,100);
P3=zeros(1,100);
P4=zeros(1,100);
P5=zeros(1,100);

for k=1:1:10000
Capacity1(k)=Capacity(1,k);
end
for k=1:1:10000
Capacity2(k)=Capacity(2,k);
end
for k=1:1:10000
Capacity5(k)=Capacity(5,k);
end
for k=1:1:10000
Capacity3(k)=Capacity(3,k);
end
for k=1:1:10000
Capacity4(k)=Capacity(4,k);
end

cmin=min(Capacity_r);
cmax=max(Capacity_r);
cmin1=min(Capacity1);
cmax1=max(Capacity1);
cmin2=min(Capacity2);
cmax2=max(Capacity2);
cmin3=min(Capacity3);
cmax3=max(Capacity3);
cmin4=min(Capacity4);
cmax4=max(Capacity4);
cmin5=min(Capacity5);
cmax5=max(Capacity5);

for i=1:1:100
end
for i=1:1:100
end
for i=1:1:100
end
for i=1:1:100
end
for i=1:1:100
end
for i=1:1:100
end
for i=1:1:10000
for j=1:1:100
P(j)=P(j)+1;
end
end
end

for i=1:1:10000
for j=1:1:100
P1(j)=P1(j)+1;
end
end
end
for i=1:1:10000
for j=1:1:100
P2(j)=P2(j)+1;
end
end
end
for i=1:1:10000
for j=1:1:100
P3(j)=P3(j)+1;
end
end
end
for i=1:1:10000
for j=1:1:100
P4(j)=P4(j)+1;
end
end
end
for i=1:1:10000
for j=1:1:100
P5(j)=P5(j)+1;
end
end
end

P=P/10000;
P1=P1/10000;
P2=P2/10000;
P3=P3/10000;
P4=P4/10000;
P5=P5/10000;

grid on;

...全文
40 1 打赏 收藏 举报

1 条回复

loveashen 2013-05-06

• 打赏
• 举报

3400

2013-05-03 09:30