Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- %% C=CvsSNR_EqualPowerAllocation(SNRvec_db, H, calcType)
- % C = log_2 |I_N_r + (p/N_t)H'H'^H|
- function C=CvsSNR_EqualPowerAllocation(SNRvec_db, H, calcType)
- [m,n] = size(H); %n=t, m=r
- I_Nr = eye(m);
- C = zeros(1, length(SNRvec_db));
- %% If CalcType = 1, then we want to use 3.9
- if (calcType == 1)
- for i = 1:(length(SNRvec_db))
- C(i) = log2(det(I_Nr+(SNRvec_db(i)/n)*H*H'));
- end
- return;
- %% If CalcType = 1, then we want to use 3.11
- elseif (calcType == 2)
- [U,S,V] = svd(H);
- r = rank(H);
- lambda_i = diag(S);
- for i = 1:(length(SNRvec_db))
- for j = 1:r
- C(i) = C(i) + log2(1+(SNRvec_db(i)/n)*lambda_i(j));
- end
- end
- return;
- else
- fprintf("Unknown calcType");
- return;
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement