您好,欢迎访问三七文档
当前位置:首页 > 商业/管理/HR > 信息化管理 > MIMO信道容量的Matlab仿真程序
MIMOÐŵÀÈÝÁ¿µÄMatlab·ÂÕæ³ÌÐò%%SimulationofCapacityofMIMOchannel%Author:alpswy%Email:alpswy@gmail.com%ReviseHistory:%2009-08-22Created%%ParametersfornormalsimulationChanType='Rayleigh';%AWGN,Rayleigh,CorrRayleigh,RiceLOOP=10000;%numberofchanneltapsamplesconst=1/sqrt(2);%constantnumberNT=4;%numberofreceiveantennasNR=4;%numberoftransmitantennasSNRdB=10;%SNRindBSNRdec=10^(0.1*SNRdB);%SNRindecibel%%ParametersfordisplayingnumGroup=100;%variableusedtocountsamplesRange_MIN=0;%minimumvalueoffigureRange_MAX=6;%maximumvalueoffigure%%Parametersforsimulationofcorrelationofchannelrho_t=0;rho_r=0;%%ParametersforsimulationofRicechannelK=1;%RicefactorD=sqrt(K);switchChanTypecase'AWGN'H=ones(NR,NT);C=log2(det(eye(NR)+SNRdec/NT*H*H'));C_1=[C,C];plot(C_1,0:1);axis([Range_MIN,Range_MAX,0,1]);case'Rayleigh'C=zeros(1,LOOP);C_2=zeros(1,numGroup);foridx_LOOP=1:LOOPH=const*(randn(NR,NT)+1j*randn(NR,NT));C(idx_LOOP)=log2(det(eye(NR)+SNRdec/NT*H*H'));endC_min=min(C);C_max=max(C);C_1=hist(C,numGroup);C_2(1)=C_1(1);foridx=2:numGroupC_2(idx)=C_2(idx-1)+C_1(idx);endC_2=C_2/LOOP;Range_MIN=C_min;Range_MAX=C_max;X_axe=Range_MIN+[0:(numGroup-1)]/numGroup*(Range_MAX-Range_MIN);plot(X_axe,C_2);case'CorrRayleigh'C=zeros(1,LOOP);C_2=zeros(1,numGroup);R_tx=[1,rho_t;rho_t,1];%for2*2onlyR_rx=[1,rho_r;rho_r,1];foridx_LOOP=1:LOOPH=const*(randn(NR,NT)+1j*randn(NR,NT));H_Corr=R_rx*H*R_tx;C(idx_LOOP)=log2(det(eye(NR)+SNRdec/NT*H_Corr*H_Corr'));endC_min=min(C);C_max=max(C);C_1=hist(C,numGroup);C_2(1)=C_1(1);foridx=2:numGroupC_2(idx)=C_2(idx-1)+C_1(idx);endC_2=C_2/LOOP;Range_MIN=C_min;Range_MAX=C_max;X_axe=Range_MIN+[0:(numGroup-1)]/numGroup*(Range_MAX-Range_MIN);plot(X_axe,C_2);case'Rice'C=zeros(1,LOOP);C_2=zeros(1,numGroup);foridx_LOOP=1:LOOPH=const*(randn(NR,NT)+1j*randn(NR,NT))+D*ones(NR,NT);C(idx_LOOP)=log2(det(eye(NR)+SNRdec/NT*H*H'));endC_min=min(C);C_max=max(C);C_1=hist(C,numGroup);C_2(1)=C_1(1);foridx=2:numGroupC_2(idx)=C_2(idx-1)+C_1(idx);endC_2=C_2/LOOP;Range_MIN=C_min;Range_MAX=C_max;X_axe=Range_MIN+[0:(numGroup-1)]/numGroup*(Range_MAX-Range_MIN);plot(X_axe,C_2);otherwisedisp('OtherChannelTypeisstillunderconstruction.OnlyAWGNandRayleighfadingisavailable.')keyboardend
本文标题:MIMO信道容量的Matlab仿真程序
链接地址:https://www.777doc.com/doc-7194386 .html