www.pudn.com > mimo.rar > mimo.m, change:2005-10-12,size:1704b


clear; 
close all; 
SignalEnergyMin = 2; 
SignalEnergyMax = 13; 
SignalEnergy_d = 0.5; 
BlockSize = 2^8; 
BlocksPerEnergy = 20; 
SamplingRate = 1; 
WGNPower = 1; 
RayleighParam = 1; 
Transmitters = 4; 
Receivers = 8; 
EnergiesdB = SignalEnergyMin:SignalEnergy_d:SignalEnergyMax; 
Energies = 10.^(EnergiesdB./10); 
for ee = 1:size(Energies,2) 
Eb = Energies(ee)/Transmitters; 
for bb=1:BlocksPerEnergy 
disp(['Eb = ',int2str(Energies(ee)),'; Block ',int2str(bb)]); 
RayleighMat = RayleighParam^2*randn (Receivers,Transmitters) + j*RayleighParam^2*randn(Receivers,Transmitters); 
%RayleighMat = RayleighMat*.1; 
A = randint(Transmitters,BlockSize,16); % Generate Data Stream A(rows =xmitters, cols = symbols) 
B = mod16qam (A,1,SamplingRate,Eb)'; % 16-QAM Modulation 
noise = (WGNPower).*randn(size(RayleighMat*B)) + j*(WGNPower).*randn(size(RayleighMat*B)); 
C = RayleighMat*B + noise; 
k = []; 
H = RayleighMat; 
r=C; 
for tt=1:Transmitters 
% find best signal 
G = pinv(H); 
normG = sum(abs(G).^2,2); 
normG(k) = inf; 
k(tt) = find(normG == min(normG)); 
w = G(k(tt),:) ; 
y = w*r; 
[E(k(tt),:),Eb_rec(k(tt))] = demod16qam (y,1,SamplingRate); % Demodulate 
% nulling starts here 
r = r - H(:,k(tt))*(mod16qam (E(k(tt),:),1,SamplingRate,Eb_rec(k(tt))))'; 
19 
H(:,k(tt)) = zeros(size(H(:,k(tt)))); 
end 
SER(:,bb) = 1-sum(A==E,2)/size(A,2); % Measure BER per T-R pair. 
end 
p = mean(SER,2); 
q = mean(p,1); 
NC_ESER(ee)=mean(mean(SER,2),1); 
end 
figure; 
semilogy(EnergiesdB,NC_ESER,'b-'); 
title (['\fontsize{12}\bfBLAST: \rmM=',int2str(Transmitters),', N=',int2str(Receivers),', 16-QAM']); 
xlabel ('Eb/N_0'); ylabel ('SER'); 
%% EOF %% EOF %% EOF %% EOF %% EOF %% EOF %% EOF %% EOF %% EOF %% EOF