Vous êtes sur la page 1sur 6

Name of the experiment: Simulation of Ergodic capacity of a channel.

Program:
% Ergodic Capacity of Nr x Nt fading MIMO Channel with
% no channel knowledge at the transmitter.
clc
clear all;
%%%%%%%%%%%%%%%%%%%%%%%% Initialization %%%%%%%
%%%%%%%%%%%%%%%%%
N=30000;
% Number of Iterations for H
No=1;
% Noise Variance
%%%%%%%%%%%%%%%%%%%%%%%% Number of antennas %%%%
%%%%%%%%%%%%%%%%%%%
nt=input('Number of transmitting antenna:');% Number of Transmit antennas
nr=input('Number of receiving antenna:'); % Number of Receive antennas
%%%%%%%%%%%%%%%%%%%%%%%% Correlation of antennas %%
%%%%%%%%%%%%%%%%%%%%%
rhot=0;
% Correlation coefficient (Transmitter)
rhor=0;
% Correlation coefficient (Receiver)
Rt=ExponencorrMrtx (nt,rhot); % Correlation Matrix Rt
Rr=ExponencorrMrtx (nr,rhot);% Correlation Matrix Rr
%%%%%%%%%%%%%%%%%%%%%%% SNR of Channel %%%%%%%
%%%%%%%%%%%%%
SNRdB=[0:1:15];
l=length (SNRdB);
SNR=zeros (1,l);

% Signal-to-Noise Ratio

%%%%%%%%%%%%%%% Creation of SNR from 1 to L %%%%%%%%%


%%%%%%%%%%%%%
fprintf(' \n Numerical Results \n')
for i=1:l
SNR (i)=10^(0.1*SNRdB (i));
% Conversion of SNR in magnitude form
P (i)=SNR (i)*No;
end
1

fprintf(' SNR(dB)

Ergodic Capacity \n')

%%%%%%%%%%%%% Calculation of Ergodic capacity %%%%%%%%%


%%%%%
Erg_Cap_unknown=zeros (1,l);
for i=1:l
% Loop of SNR
C_unknown=zeros (1,N);
%%%%%%%%%%%% Calculation of capacity %%%%%%%%%%%%%%
for j=1:N
H=CGM (nr,nt,Rr,Rt);
% Generate Rayleigh Distributed fading
C_unknown (j)=log (det (eye (nr)+(SNR (i)/nt)*(H*H')));
end
%%%%%%%%%%%%%%%%%%%% Ergodic Capacity %%%%%%%%%
%%%%%%%%%%
Erg_Cap_unknown (i)=mean (C_unknown); % Ergodic multicast capacity
with no CSIT
%%%%%%%%%%%%%%%%%%%% Printing Data %%%%%%%%%%%
%%%%%%%%
fprintf ('% e\t% e \n',SNRdB (i),Erg_Cap_unknown (i));
end
%%%% Plotting of Ergodic capacity versus SNR %%%%
plot (SNRdB,Erg_Cap_unknown,':*g')% Ergodic multicast capacity with no
CSIT
% versus SNR
hold on
xlabel ('SNR (dB)');
ylabel ('Ergodic capacity (bits/sec/Hz)');
title ('Ergodic Capacity vs SNR');
grid on

Output:
(a)
(i)Plot capacity vs SNR for Nr=4, Nt=4 with numerical results
2

(ii)Plot capacity vs SNR for Nr=4, Nt=6 with numerical results


(iii)Plot capacity vs SNR for Nr=4, Nt=8 with numerical results

Ergodic Capacity vs SNR

14

nt=4,nr=4
nt=6,nr=4
nt=8,nt=4

Ergodic capacity (bits/sec/Hz)

12

10

SNR (dB)

10

15

Description:
The main objective of this experiment is to observe the changes in capacity with
respect to SNR if the number of transmitters are increased. If the number of
receivers is kept constant and transmitter numbers are varied upward then
channel capacity will slightly increase which is advantageous to wireless
communication.

(b)
(i)Plot capacity vs SNR for Nr=4, Nt=4 with numerical results

(ii)Plot capacity vsSNR for Nr=4, Nt=3 with numerical results


(iii)Plot capacity vs SNR for Nr=4, Nt=2 with numerical results

Ergodic Capacity vs SNR

12

nt=4,nr=4
nt=3,nr=4
nt=2,nr=4

Ergodic capacity (bits/sec/Hz)

10

SNR (dB)

10

15

Description:
The main objective of this experiment is to observe the changes in capacity with
respect to SNR if the number of transmitters are decreased. If the number of
receivers is kept constant and transmitter numbers are varied downward then
channel capacity will decrease. It is disadvantageous to wireless
communication.

(c)

(i) Plot of capacity vs SNR for Nr=4, Nt=4 with numerical results
(ii)Plot of capacity vs SNR for Nr=6, Nt=4 with numerical results
(iii) Plot of capacity vs SNR for Nr=8, Nt=4 with numerical results

16

Ergodic capacity (bits/sec/Hz)

14

Ergodic Capacity vs SNR


nt=4,nr=4
nt=4,nr=6
nt=4,nr=8

12
10
8
6
4
2
0

SNR (dB)

10

15

Description:
The main objective of this experiment is to observe the changes in capacity with
respect to SNR if the number of receivers are increased. If the number of
transmitters is kept constant and receiver numbers are varied upward then
channel capacity will increase. It is very much advantageous to wireless
communication.

(d)
(i)Plot of capacity vs SNR for Nr=4, Nt=4 with numerical results
(ii)Plot of capacity vs SNR for Nr=3, Nt=4 with numerical results
5

(iii)Plot of capacity vs SNR for Nr=2, Nt=4 with numerical results

Ergodic Capacity vs SNR

12

nt=4,nr=4
nt=4,nr=3
nt=4,nr=2

Ergodic capacity (bits/sec/Hz)

10

SNR (dB)

10

15

Description:
The main objective of this experiment is to observe the changes in capacity with
respect to SNR if the number of receivers are decreased. If the number of
transmitters is kept constant and receiver numbers are varied downward then
channel capacity will decrease. It is very much disadvantageous to wireless
communication.

Vous aimerez peut-être aussi