-
Notifications
You must be signed in to change notification settings - Fork 2
/
Run.m
56 lines (49 loc) · 1.72 KB
/
Run.m
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
%% channel settings
clear;
close all;
seed_start=10;
randn('state',seed_start);
N = 4;M = 4;
P = eye(N); % PowerMatrix
SNR = linspace(15,55,40);
SNR = 0;
SNRLinear = 10.^(SNR./10);
Type={'LMMSE'};
%Type: receiver type
% 'LMMSE' Linear MMSE equalizer
% 'MMSE_VBLAST' MMSE with SIC (optimal receiver)
Optimizer={'minmax','fodorPrecoding2'};
%Optimizer:
% 'none' no Power optimization
% 'wf' waterfilling and SVD precoding
% 'numericalGrad' gradient Search for sumPower constraint
% 'analyticalGrad' gradient Search for sumPower constraint
% 'sp_iwf' sumPower constraint waterfilling
% 'sp_iwf_paper' jindal's sumPower waterfilling
% 'fodor' fodor's aproach with fairness constraints
% 'fodorPrecoding' fodor's Precoding Optimization
%% run
[SINR, Phi, P] = MIMO_Transceiver(M,N,P,SNR,Type,Optimizer);
%% calculate Rate
R_ch = zeros(N,length(SNR),length(Type),length(Optimizer));
R_sum = zeros(length(SNR),length(Type),length(Optimizer));
R_ac = zeros(length(SNR),length(Type),length(Optimizer));
for j=1:length(SNR) %iterate over SNR
for i = 1:length(Type) %iterate over Type
for k = 1:length(Optimizer) %iterate over Optimizer
R_ch(:,j,i,k) = real(log2(SINR(:,j,i,k)+1));
R_sum(j,i,k) = sum(R_ch(:,j,i,k));
R_ac(j,i,k) = real(log2(det(Phi(:,:,j,i,k))));
end
end
end
%% plot
% Achievable Rate
% if exist('fRate','var'); figure(fRate); else fRate = figure; end; clf;
figure
hold on
for k=1:length(Optimizer)
plot(SNR(:),R_sum(:,1,k),'color',[(length(Optimizer)-k)/(length(Optimizer)) k/(length(Optimizer)) 0]);
end
legend(Optimizer);
hold off