资源简介
认知无线电频谱分配仿真,并对结果进行分析和比较,得出结论
代码片段和文件信息
clc
clear all
B=15;
BER=10^(-4);
K=1.5/(logm(0.2/BER));
SNR=[810];
k=log2(1+K.*SNR);
r1=10;
r2=12;
x=0;
y=1;
z=1;
% b=[00];
% c=x+y*(sum(b));
% p=r.*k.*b-b.*c;
a(1)=0.001;
for i=1:300
a(2)=0.001;
for j=1:300
eigenvalue(1)=1-10/3*(2*a(1)*k(1)-a(1)*k(2)+2*a(2)*k(2)-a(2)*k(1))+10/3*((a(1)*(k(2)-2*k(1))*a(2)*(k(1)-2*k(2))+(2*a(2)*k(2)-a(2)*k(1)-2*a(1)*k(1)+a(1)*k(2))^2)^(0.5));
eigenvalue(2)=1-10/3*(2*a(1)*k(1)-a(1)*k(2)+2*a(2)*k(2)-a(2)*k(1))-10/3*((a(1)*(k(2)-2*k(1))*a(2)*(k(1)-2*k(2))+(2*a(2)*k(2)-a(2)*k(1)-2*a(1)*k(1)+a(1)*k(2))^2)^(0.5));
if (eigenvalue(1)<1)&&(eigenvalue(1)>-1)&&(eigenvalue(2)<1)&&(eigenvalue(2)>-1)
a(2)=a(2)+0.002;
end
end
if a(2)>0
a(2)=a(2)-0.002;
else
a(2)=0;
end
f2(i)=a(2);
f1(i)=a(1);
a(1)=a(1)+0.002;
end
figure(1)
plot(f1f2‘--r‘)
axis([00.2500.25])
hold on
B=15;
BER=10^(-4);
K=1.5/(logm(0.2/BER));
SNR=[1010];
k=log2(1+K.*SNR);
r1=10;
r2=12;
x=0;
y=1;
z=1;
% b=[00];
% c=x+y*(sum(b));
% p=r.*k.*b-b.*c;
a(1)=0.001;
for i=1:300
a(2)=0.001;
for j=1:300
eigenvalue(1)=1-10/3*(2*a(1)*k(1)-a(1)*k(2)+2*a(2)*k(2)-a(2)*k(1))+10/3*((a(1)*(k(2)-2*k(1))*a(2)*(k(1)-2*k(2))+(2*a(2)*k(2)-a(2)*k(1)-2*a(1)*k(1)+a(1)*k(2))^2)^(0.5));
eigenvalue(2)=1-10/3*(2*a(1)*k(1)-a(1)*k(2)+2*a(2)*k(2)-a(2)*k(1))-10/3*((a(1)*(k(2)-2*k(1))*a(2)*(k(1)-2*k(2))+(2*a(2)*k(2)-a(2)*k(1)-2*a(1)*k(1)+a(1)*k(2))^2)^(0.5));
if (eigenvalue(1)<1)&&(eigenvalue(1)>-1)&&(eigenvalue(2)<1)&&(eigenvalue(2)>-1)
a(2)=a(2)+0.002;
end
end
if a(2)>0
a(2)=a(2)-0.002;
else
a(2)=0;
end
f2(i)=a(2);
f1(i)=a(1);
a(1)=a(1)+0.002;
end
figure(1)
plot(f1f2‘-.*b‘)
axis([00.2500.25])
B=15;
BER=10^(-4);
K=1.5/(logm(0.2/BER));
SNR=[108];
k=log2(1+K.*SNR);
r1=10;
r2=12;
x=0;
y=1;
z=1;
% b=[00];
% c=x+y*(sum(b));
% p=r.*k.*b-b.*c;
a(1)=0.001;
for i=1:300
a(2)=0.001;
for j=1:300
eigenvalue(1)=1-10/3*(2*a(1)*k(1)-a(1)*k(2)+2*a(2)*k(2)-a(2)*k(1))+10/3*((a(1)*(k(2)-2*k(1))*a(2)*(k(1)-2*k(2))+(2*a(2)*k(2)-a(2)*k(1)-2*a(1)*k(1)+a(1)*k(2))^2)^(0.5));
eigenvalue(2)=1-10/3*(2*a(1)*k(1)-a(1)*k(2)+2*a(2)*k(2)-a(2)*k(1))-10/3*((a(1)*(k(2)-2*k(1))*a(2)*(k(1)-2*k(2))+(2*a(2)*k(2)-a(2)*k(1)-2*a(1)*k(1)+a(1)*k(2))^2)^(0.5));
if (eigenvalue(1)<1)&&(eigenvalue(1)>-1)&&(eigenvalue(2)<1)&&(eigenvalue(2)>-1)
a(2)=a(2)+0.002;
end
end
if a(2)>0
a(2)=a(2)-0.002;
else
a(2)=0;
end
f2(i)=a(2);
f1(i)=a(1);
a(1)=a(1)+0.002;
end
figure(1)
plot(f1f2‘-g‘)
axis([00.2500.25])
B=15;
BER=10^(-4);
K=1.5/(logm(0.2/BER));
SNR=[77];
k=log2(1+K.*SNR);
r1=10;
r2=12;
x=0;
y=1;
z=1;
% b=[00];
% c=x+y*(sum(b));
% p=r.*k.*b-b.*c;
a(1)=0.001;
for i=1:300
a(2)=0.001;
for j=1:300
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
文件 4719 2009-04-03 13:42 Unti
----------- --------- ---------- ----- ----
4719 1
- 上一篇:编译原理课程设计--编译器
- 下一篇:雨流计数法的基本原理
评论
共有 条评论