06.06.2022 Views

B. P. Lathi, Zhi Ding - Modern Digital and Analog Communication Systems-Oxford University Press (2009)

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

13.9 MATLAB Exercises 795

% Matlab Program <mimocap .m>

% This program calculates the capacity of random MIMO (mxn ) channels

% and plots the cumulative distribution (CDF ) of the resulting

% capacity;

% Number of random channels :

% Signal to noise ratio :

clear

hold off

elf

K=200;

SNRdb=3 ;

SNR=l 0 ( SNRdb/ 10) ;

K=200

SNRdb=3dB

m=l ; n=l ; % lxl channels

for kk=l:K

H=randn ( [m n] ) ; %Random MIMO Channel

capll (kk) =log (det (eye (n,n )+SNR*H'*H) )/(2*log(2) );

end

[Nll ,Cll]=hist ( capll,K/ 10) ; %CDF of MIMO capacity

m=2 ;n=2 ; % 2x2 channels

for kk=l:K

H=randn ([m n] ); %Random MIMO Channel

cap22 (kk) =log (det (eye ( n,n) +SNR*H'*H) )/(2*log (2) );

end

[N22 ,C22] =hist ( cap22,K/ 10) ; %CDF of MIMO capacity

m=4 ;n=2 ; % 4x2 channels

for kk=l :K

H=randn ([m n] ); %Random MIMO Channel

cap42 (kk) =log (det (eye (n,n)+SNR*H'*H ))/(2*log(2) );

end

[N42 ,C42] =hist (cap42,K/ 10) ; %CDF of MIMO capacity

m=2 ;n=4; % 4x2 channels

for kk=l:K

H=randn ([m n] ); %Random MIMO Channel

cap24 {kk) =log (det (eye { n,n)+SNR*H'*H) )/{2*log ( 2));

end

[N24,C24]=hist ( cap24,K/ 10) ; %CDF of MIMO capacity

m=4 ;n=4 ; % 4x2 channels

for kk=l:K

H=randn ([m n] ); %Random MIMO Channel

cap44 (kk) =log (det (eye (n,n)+SNR*H '*H) ) / (2*log(2) );

end

[N44,C44] =hist ( cap44,K/ 10) ; %CDF of MIMO capacity

m=8 ;n=4 ; % 4x2 channels

for kk=l :K

H=randn ([m n] ); %Random MIMO Channel

cap84 (kk) =log (det (eye { n ,n) +SNR*H '*H) )/(2*log(2) );

end

[N84 ,C84] =hist ( cap84,K/10) ; %CDF of MIMO capacity

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!