📄 mutual_mimo_deri_diag.m
字号:
function [fgrad_mean, fhess_mean, fmutual_mean] = ...
mutual_mimo_deri_diag(M, N, H0, Rt_sqrt, gamma, lambda, NSAMPLE, I)
%------------------------------------------------------------
% Function to calculate the gradient and Hessian for diagonal covariance
% matrix case.
%
% Author: Mai Vu
% Date: 12/1/2003
% Revised: 04/12/2004
%------------------------------------------------------------
%------------------------------------------------------------
% INPUTS
% M: number of receive antennas
% N: number of transmit antennas
% H0: channel mean
% Rt_sqrt: square root of transmit correlation
% gamma: SNR
% lambda: the previous transmit covariance matrix eigenvalues
% NSAMPLE: number of samples used in Monte-Carlo simulation
% I: identity matrix of size NxN
%
% THE PROBLEM
%
% The unknown covariance matrix Q is diagonalized using the optimum U,
% hence the number of unknowns is only N, which are the eigenvalues lambda
% of Q.
%
% Objective function
% f = -E[logdet(I + SQ)] = -E[logdet(I + U'SU diag(lambda))]
% where S = H'*H
% H = H0 + Hw*Rt_sqrt
% This function calculates the gradient and Hessian of f wrt lambda.
%
% OUTPUTS
% fgrad_mean: average gradient
% fhess_mean: average Hessian
% fmutual_mean: average mutual information
%
%------------------------------------------------------------
% create the variables
fgrad = zeros(N,1);
fhess = zeros(N,N);
fmutual = 0;
% generate the sample set of channels
H = (randn(M,N,NSAMPLE) + j*randn(M,N,NSAMPLE))/sqrt(2);
% calculate the gradient and the Hessian
for k=1:NSAMPLE
H_k = H0 + H(:,:,k)*Rt_sqrt;
S_k = gamma*H_k'*H_k;
P = I + S_k*diag(lambda);
fmutual = fmutual - real(log(det(P)));
Y = inv(P);
Z = Y*S_k;
fgrad = fgrad - real(diag(Z));
fhess = fhess + abs(Z).^2;
end
% take sample mean
fgrad_mean = fgrad/NSAMPLE;
fhess_mean = fhess/NSAMPLE;
fmutual_mean = fmutual/NSAMPLE;
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -