资源简介
此代码是基于mATLAB的MISO信道容量仿真代码,通过改变发射天线的数量得出模拟信道容量
代码片段和文件信息
% SIMO_Capacity.m
clear all;clc;
Nt = 1; % 8.发射天线的数目为1
Nr = 1; % 9.接收天线的数目为1
SampleNum = 10000; % 10.蒙特卡洛仿真时的抽样数量
SNR_dB =2:2:20; % 11.信噪比(单位dB)
for nSNR = 1:length(SNR_dB)
SNR_dB(nSNR)
rho = 10^(SNR_dB(nSNR)/10); % 13-15.完成信噪比的单位转换
for nSample = 1:SampleNum
H = (randn(NrNt)+sqrt(-1)*randn(NrNt))/sqrt(2); % 18.瑞利衰落信道矩阵
Cn(nSNRnSample) = log2(real(det(min(NtNr)+rho*H‘*H/Nr)));
end
Capacity1(nSNR) = mean( Cn(nSNR:) ); % 22.求遍历信道容量
tempC1 = sort(Cn(nSNR:));
end
Nt = 1; % 26-42.接收天线的数目为3
Nr = 3;
SampleNum = 10000;
SNR_dB =2:2:20;
for nSNR = 1:length(SNR_dB)
SNR_dB(nSNR)
rho = 10^(SNR_dB(nSNR)/10);
for nSample = 1:SampleNum
H = (randn(NrNt)+sqrt(-1)*randn(NrNt))/sqrt(2);
Cn(nSNRnSample) = log2(real(det(min(NtNr)+rho*H‘*H/Nr)));
end
Capacity2(nSNR) = mean( Cn(nSNR:) );
tempC2 = sort(Cn(nSNR:));
end
Nt = 1; % 44-60.接收天线的数目为5
Nr = 5;
SampleNum = 10000;
SNR_dB =2:2:20;
for nSNR = 1:length(SNR_dB)
SNR_dB(nSNR)
rho = 10^(SNR_dB(nSNR)/10);
for nSample = 1:SampleNum
H = (randn(NrNt)+sqrt(-1)*randn(NrNt))/sqrt(2);
Cn(nSNRnSample) = log2(real(det(min(NtNr)+rho*H‘*H/Nr)));
end
Capacity3(nSNR) = mean( Cn(nSNR:) );
tempC3 = sort(Cn(nSNR:));
end
Nt = 1; % 62-78.接收天线的数
评论
共有 条评论