• 大小: 587B
    文件类型: .rar
    金币: 1
    下载: 0 次
    发布日期: 2021-08-26
  • 语言: 其他
  • 标签: 频谱分配  

资源简介

认知无线电频谱分配仿真,并对结果进行分析和比较,得出结论

资源截图

代码片段和文件信息

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  Untitled3.m

----------- ---------  ---------- -----  ----

                 4719                    1


评论

共有 条评论