⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 fig28.m

📁 Space-Time Codes and MIMO Systems
💻 M
字号:
% the programm is designed for figure 2.8,
% fig28.m
% **************************************************************************
% This program implements equation (2.26) using the waterfilling algorithm.
% The equation has been implemented in its determinant form as it is more convenient.
% output=capacity_water(SNR,M)
% SNR is signal-to-noise ratio; 
% M -> number of antennas for a M x M system
% **************************************************************************
% Monte-Carlo runs
       clear
       M = 4;
 testnum = 2^(15);  
     SNR = 0 : 20;
    Lsnr = length(SNR);
    for nl = 1 : Lsnr;
        snr = 10^(SNR(nl)/10);
        for K=1:testnum,
            T=randn(M,M)+j*randn(M,M);
            T=T/sqrt(2);
            I=eye(M);
            eigen=eig(T*T'); % extract eigenvalues
            gamma=zeros(M,1);
            gamma = watfill(snr,T,M);
            a=I+(snr/M)*diag(gamma).*diag(eigen);% solve eqn(2.26)using the determinant form
            a=det(a);
	        y(K)=log2(a);   
        end
        a_var(nl) = sum(y)/testnum;
    end
%   save capacity.mat bvarible -ascii; 
    load capacity.mat -ascii,
    b_var = capacity;
    figure(1);
    plot(SNR,b_var,'k-p');
    hold on;
    plot(SNR,a_var,'k-o');
    xlabel('SNR(dB)');
    ylabel('Ergodic capacity(bit/s/Hz)');
    legend('channel unknown to Tx','channel known to Tx');
    hold off

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -