Pre-ci test passed git-svn-id: http://svn.eurecom.fr/openair4G/trunk@4000 818b1a75-f10b-46b9-bf7c-635c3b92a50f
29 lines
726 B
Matlab
Executable File
29 lines
726 B
Matlab
Executable File
clear;
|
|
|
|
M = 2; % BS antennas
|
|
N = 1; % UE antennas
|
|
K = 2; % users
|
|
|
|
P = 10; % total transmit power = linear SNR
|
|
% (the noise variance is 1)
|
|
|
|
NFrames = 1000;
|
|
capacity = zeros(1,NFrames);
|
|
|
|
for l = 1:NFrames
|
|
%Choose channel for iteration
|
|
%UPLINK CHANNEL!!!!!!
|
|
%H(:,:,k) represents the M x N uplink channel of the kth user
|
|
H = 1/sqrt(2) * (randn(M,N,K) + 1i * randn(M,N,K));
|
|
|
|
% if Hd(:,:,k) is the N x M downlink channel of the kth user
|
|
% H(:,:,k) = Hd(:,:,k)' is the M x N uplink channel
|
|
|
|
%calculate DPC sum rate with iterative waterfilling
|
|
[capacity(l) Covar] = iterative_waterfill(H,P,50);
|
|
|
|
%compute downlink covariance matrices
|
|
%Downlink = MAC_to_BC(H, Covar)
|
|
end
|
|
|
|
cdfplot(capacity) |