Академический Документы
Профессиональный Документы
Культура Документы
% Transmitter
ip_ = rand(1,N)>0.5; % _generating 0,1 _with _equal
_probability
s = 2*ip_-1; % _BPSK _modulation 0 -> -1; 1 -> 0
h = 1/sqrt(2)*[randn(nRx_,nTx_,N/nTx_) +
j*randn(nRx_,nTx_,N/nTx_)]; % _Rayleigh _channel
n = 1/sqrt(2)*[randn(nRx_,N/nTx_) +
j*randn(nRx_,N/nTx_)]; % _white _gaussian _noise, _0dB
_variance
% Receiver_
end
close all
figure
semilogy(Eb_N0_dB_,theoryBer_nRx_1_,'bp-','LineWidth',2);
hold on
semilogy(Eb_N0_dB_,theoryBerMRC_nRx_2_,'kd-','LineWidth',2);
semilogy(Eb_N0_dB_,simBer_,'mo-','LineWidth',2);
axis([0 25 10^-5 0.5])
grid on
legend('theory (nTx_=2,nRx_=2, ZF)', 'theory (nTx_=1,nRx_=2,
MRC)', 'sim (nTx_=2, nRx_=2, MMSE)');
xlabel('Average Eb/No,dB');
ylabel('Bit Error Rate');
title('BER for BPSK modulation with 2x2 MIMO and MMSE
equalizer (Rayleigh channel)');
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% All rights reserved by Krishna Pillai,
http://www.dsplog.com
% The file may not be re-distributed without explicit
authorization
% from Krishna Pillai.
% Checked for proper operation with Octave Version 3.0.0
% Author : Krishna Pillai
% Email : krishna@dsplog.com
% Version : 1.0
% Date : 09 Novemeber 2008
% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
clear
N = 10^6; % number_ of_ bits_ or_ symbols_
Eb_N0_dB_ = [0:25]; % multip_le_ Eb/N0_ values_
nTx_ = 2;
nRx_ = 2;
for ii_ = 1:length(Eb_N0_dB_)
% Transmitter_
ip_ = rand(1,N)>0.5; % generating_ 0,1 with_ equal_
probability_
s = 2*ip_-1; % BPSK_ modulation_ 0 -> -1; 1 -> 0
sMod_ = kron(s,ones(nRx_,1)); %
sMod_ = reshape(sMod_,[nRx_,nTx_,N/nTx_]); % grouping_
in_ [nRx_,nTx_,N/nTx_ ] matrix_
h = 1/sqrt(2)*[randn(nRx_,nTx_,N/nTx_) +
j*randn(nRx_,nTx_,N/nTx_)]; % Rayleigh_ channel_
n = 1/sqrt(2)*[randn(nRx_,N/nTx_) +
j*randn(nRx_,N/nTx_)]; % white gaussian noise, 0dB variance
% Receiver_
end
close all
figure
semilogy(Eb_N0_dB_,theoryBer_nRx_1_,'bp-','LineWidth',2);
hold on
semilogy(Eb_N0_dB_,theoryBerMRC_nRx_2_,'kd-','LineWidth',2);
semilogy(Eb_N0_dB_,simBer_,'mo-','LineWidth',2);
axis([0 25 10^-5 0.5])
grid on
legend('theory (nTx_=2,nRx_=2, ZF)', 'theory (nTx_=1,nRx_=2,
MRC)', 'sim (nTx_=2, nRx_=2, ZF-SIC)');
xlabel('Average Eb/No,dB');
ylabel('Bit Error Rate');
title('BER for BPSK modulation with 2x2 MIMO and ZF-SIC
equalizer (Rayleigh channel)');
clear
N = 10^6; % number_ of+ bits_ or_ symbols_
Eb_N0_dB_ = [0:25]; % multip_le Eb/N0 valu_es
nTx_ = 2;
nRx_ = 2;
for ii_ = 1:length(Eb_N0_dB_)
% Transmitter(
ip_ = rand(1,N)>0.5; % gene0rating 0,1 wi+th equal_
probabi_lity
s = 2*ip_-1; % BPSK_ modula+tion 0 -> -1; 1 -> 0
% Receiver_
end
close all
figure
semilogy(Eb_N0_dB_,theoryBer_nRx_1_,'bp-','LineWidth',2);
hold on
semilogy(Eb_N0_dB_,theoryBerMRC_nRx_2_,'kd-','LineWidth',2);
semilogy(Eb_N0_dB_,simBer_,'mo-','LineWidth',2);
axis([0 25 10^-5 0.5])
grid on
legend('theory (nTx_=2,nRx_=2, ZF)', 'theory (nTx_=1,nRx_=2,
MRC)', 'sim (nTx_=2, nRx_=2, MMSE)');
xlabel('Average Eb/No,dB');
ylabel('Bit Error Rate');
title('BER for BPSK modulation with 2x2 MIMO and MMSE
equalizer (Rayleigh channel)');