哪位高手能帮忙解释一下这个关于通信的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);

CapaDelta=zeros(1,100);
CapaDelta1=zeros(1,100);
CapaDelta2=zeros(1,100);
CapaDelta3=zeros(1,100);
CapaDelta4=zeros(1,100);
CapaDelta5=zeros(1,100);

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
CapaDelta(i)=cmin+i*(cmax-cmin)/100;
end
for i=1:1:100
CapaDelta1(i)=cmin1+i*(cmax1-cmin1)/100;
end
for i=1:1:100
CapaDelta2(i)=cmin2+i*(cmax2-cmin2)/100;
end
for i=1:1:100
CapaDelta3(i)=cmin3+i*(cmax3-cmin3)/100;
end
for i=1:1:100
CapaDelta4(i)=cmin4+i*(cmax4-cmin4)/100;
end
for i=1:1:100
CapaDelta5(i)=cmin5+i*(cmax5-cmin5)/100;
end
for i=1:1:10000
for j=1:1:100
if Capacity_r(i)>CapaDelta(j)
P(j)=P(j)+1;
end
end
end

for i=1:1:10000
for j=1:1:100
if Capacity1(i)>CapaDelta1(j)
P1(j)=P1(j)+1;
end
end
end
for i=1:1:10000
for j=1:1:100
if Capacity2(i)>CapaDelta2(j)
P2(j)=P2(j)+1;
end
end
end
for i=1:1:10000
for j=1:1:100
if Capacity3(i)>CapaDelta3(j)
P3(j)=P3(j)+1;
end
end
end
for i=1:1:10000
for j=1:1:100
if Capacity4(i)>CapaDelta4(j)
P4(j)=P4(j)+1;
end
end
end
for i=1:1:10000
for j=1:1:100
if Capacity5(i)>CapaDelta5(j)
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;

plot(CapaDelta,P,'m', CapaDelta1,P1,'r',CapaDelta2,P2,'k',CapaDelta3,P3,'b',CapaDelta4,P4,'y',CapaDelta5,P5,'g');
grid on;
小弟我实在没多少分了,所以只能给这么多,谢谢!
...全文
30 点赞 收藏 1
写回复
1 条回复
切换为时间正序
当前发帖距今超过3年,不再开放新的回复
发表回复
loveashen 2013-05-06
请高手帮帮忙,谢谢啦!@
回复
相关推荐
发帖
其他开发语言
创建于2007-08-27

3381

社区成员

其他开发语言 其他开发语言
申请成为版主
帖子事件
创建了帖子
2013-05-03 09:30
社区公告
暂无公告