📄 cuaveragevsntx.m
字号:
%% This file will plot the average Capacity of MIMO Channels.
%% The plots will be Capacity vs SNR, Capacity VS MRx Capacity vs. NTx,
%% Capacity comparisons with othe channels
%close all;
clear all;
type=['o' '+' 's' '*' 'k' 'r' 'b' ':'];
colour=['k' 'r' 'b' ':'];
disp('3- Capacity vs NTx input parameters');
SNRdB=input('Input the SNR in dB >> ');
SNR=10.^(SNRdB/10);
NTx=input('Input the Range of number of Transmit antennas >> ');
MRx=input('Input the vector of number of Receive antennas up to 4 values >> ');
%it=3;
NumberOfRelizations=input('Input the number of Relizations >> ');
Cmimo1st=zeros(1,length(NTx));
AR=zeros(length(MRx),length(NTx));
%AR3=zeros(1,length(SNRArray));
subplot(2,2,4);hold on;
for ii=1:length(MRx)
%AR(ii,:)=zeros(1,length(SNRArray));
%NTx(ii)=input(sprintf('Input the number of Transmit antennas for the %2.0f Arrangment >> ',ii));
%MRx(ii)=input(sprintf('Input the number of Recieve antennas for the %2.0f Arrangment >> ',ii));
M=MRx(ii);
clear H;
for jj=1:NumberOfRelizations
for nTx=1:length(NTx)
H=sqrt(0.5)*randn(M,NTx(nTx))+i*sqrt(0.5)*randn(M,NTx(nTx));
Cmimo1st(nTx)=log2(det(eye(M)+(SNR/NTx(nTx))*H*H'));
end
AR(ii,:)=AR(ii,:)+Cmimo1st;
end
AR(ii,:)=AR(ii,:)/NumberOfRelizations;
%plot(SNRArraydB,AR(ii,:),colour(ii),SNRArraydB,AR(ii,:),type(ii));
plot(NTx,AR(ii,:),type(ii));
title(sprintf('Mean Capacity vs. N^{Tx} at SNR=%2.0fdB',SNRdB));
xlabel('M^{Rx} Antennas');
ylabel('Mean Capacity bps/Hz');
end
legend(sprintf(' M^{Rx}=%2.0f',MRx(1)),sprintf('M^{Rx}=%2.0f',MRx(2)),sprintf('M^{Rx}=%2.0f',MRx(3)),sprintf('M^{Rx}=%2.0f',MRx(4)));
hold off;
CapacityUncorrelatedAverage;
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -