💥💥💞💞欢迎来到本博客❤️❤️💥💥
🏆博主优势:🌞🌞🌞博客内容尽量做到思维缜密,逻辑清晰,为了方便读者。
⛳️座右铭:行百里者,半于九十。
📋📋📋本文目录如下:🎁🎁🎁
目录
💥1 概述
这是一段用于模拟几种数据融合协作频谱感知技术在认知无线电应用中性能的 Matlab 代码,适用于均匀或非均匀噪音条件。可配置的系统参数包括主用户(PU)发射机数量、次级用户(SU)接收机数量、所有SU的平均信噪比(SNR)、蒙特卡洛事件数量、每个SU收集的样本数量、PU信号类型(高斯或QPSK)、QPSK发送符号长度、所有SU的平均噪声方差、噪声功率和接收信号变化与其均值之间的分数、根据可配置的感知信道 Rice 因子 K 的均值和标准差确定的PU-SU信道类型,以及在虚设报警概率(Pfa)条件下通过变化系统多个参数(meanK、stdK、m、s、n、SNR、rhoN、rhoP)计算检测概率(Pd)的参考虚警概率。基于上述参数,生成了几种频谱感知技术的检测统计量用于所有蒙特卡洛运行,并根据配置为变化的参数绘制了这些技术的性能(Pd与参数的关系)。实现了几种频谱感知技术,但如果需要的话,其他技术也可以轻松插入,只需按照已实现的方法进行即可。
📚2 运行结果
部分代码:
%% System parameters
s = 1; % Number of PU transmitters.
m = 5; % Number of SU receivers.
SNR = -11.5; % Average signal-to-noise ratio over all SUs, dB.
runs = 2000; % Number of events for computing the empirical CDFs.
n = 200; % Number of samples per SU.
T = n/10; % Number of samples per QPSK PU symbol (n/T must be integer).
Sigma2avg = 1; % Average noise power.
rhoP = 0.95; % Fraction of signal power variations about the mean.
meanK = 1.88; % Mean of Rice factor (dB) for variable K over the runs and SUs.
sdK = 4.13; % Standard deviation (dB) of K over the runs and SUs.
varK = 1; % If varK = 1, K is variable; if K = 0, K = meanK.
PUsignal = 0; % PU signal: "0" = iid Gaussian; "1" = niid (T>1) or iid (T=1) QPSK.
Pfa = 0.1; % Reference Pfa for threshold computation.
%% Enable only the set of parameter values to be varied:
% Parameter = [0,1,2,4,6,8,10]; % For varying meanK.
% Parameter = [2,4,6,8,10,12]; % For varying m.
% Parameter = [1,2,3,4,5,6]; % For varying s.
% Parameter = [10,50,100,200,400,600,800,1000]; % For varying n.
Parameter = [-20,-17.5,-15,-12.5,-10,-7.5,-5,-2.5,0]; % For varying SNR.
% Parameter = [0,0.2,0.4,0.6,0.8,0.95]; % For varying rhoP.
for loop = 1:length(Parameter)
% Set the variable on the left with the desired varying parameter.
SNR = Parameter(loop)
% Fraction of noise power variations about the mean (defaut: rhoN = 0.5*rhoP)
rhoN = 0.5*rhoP;
% Average received power
PRxavg = Sigma2avg*(10^(SNR/10));
%% Source powers
%(always the same and equal to PRxavg => channel power gain is unitary)
Ptx = ones(s,1)*PRxavg/s;
for i = 1:runs
%% PU signal (pxN):
if PUsignal==0 % Cplx iid Gaussian PU signal (pxN)
S = normrnd(0,1/sqrt(2),s,n) + 1j*normrnd(0,1/sqrt(2),s,n); S=(S'*diag(sqrt(Ptx)))';
else if PUsignal==1 % QPSK PU signal (pxN) with T samples per symbol
S = []; for symb = 1:n/T
S = [S (randi([0,1],s,1)*2-1)*ones(1,T)+1j*(randi([0,1],s,1)*2-1)*ones(1,T)];
end; S = (S'*diag(sqrt(Ptx/2)))';
end; end
%% Noise variances (Mx1) variable over all sensing rounds
Sigma2 = rand(m,1)*(2*rhoN)+(1-rhoN); Sigma2 = (Sigma2/mean(Sigma2))*Sigma2avg;
%% Received powers (Mx1) variable over all sensing rounds
PRx = rand(m,1)*(2*rhoP)+(1-rhoP); PRx = PRx/mean(PRx)*PRxavg;
%% Channel matrix (Mxp):
G = sqrt((PRx/PRxavg));
for row = 1:m
for col = 1:s
if varK == 1
K = 10^(randn(1,1)*sdK+meanK)/10; % Variable K
else
K = 10^(meanK/10); % Fixed K
end
H(row,col) = G(row)*(normrnd(sqrt(K/(2*(K+1))),sqrt((1-K/(K+1))/2),1,1) + 1j*normrnd(sqrt(K/(2*(K+1))),sqrt((1-K/(K+1))/2),1,1));
end
end
%% Gaussian noise matrices (MxN):
W0(m,n)=0; W1(m,n)=0;
for j = 1:m
W0(j,:) = normrnd(0,sqrt(Sigma2(j)/2),1,n) + 1j*normrnd(0,sqrt(Sigma2(j)/2),1,n);
W1(j,:) = normrnd(0,sqrt(Sigma2(j)/2),1,n) + 1j*normrnd(0,sqrt(Sigma2(j)/2),1,n);
end
🎉3 参考文献
文章中一些内容引自网络,会注明出处或引用为参考文献,难免有未尽之处,如有不妥,请随时联系删除。
[1]司春丽,杨铁军,刘娟.认知无线电中协作频谱感知技术研究[J].电子质量, 2010(12):3.DOI:10.3969/j.issn.1003-0107.2010.12.006.
[2]鲍丽娜.协作频谱感知中的若干安全问题研究[D].南京邮电大学[2024-03-20].DOI:CNKI:CDMD:2.1015.728663.
[3]薛俊晓.认知无线电中的协作频谱感知技术[D].上海师范大学[2024-03-20].DOI:10.7666/d.y1868402.
[4]刘洋.认知无线网络中频谱感知关键技术的研究[D].南京邮电大学[2024-03-20].