Files
openairinterface5g/openair1/EMOS/MATLAB/MAC_to_BC/sample.m
T
2013-06-25 09:05:02 +00:00

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)