# MIMO channel capacity being complex?

I'm considering the following simple system model:

$$\mathbf{y}=\mathbf{Hx}+\mathbf{n}\quad\textrm{with}\quad \mathbf{n} \sim \mathcal{CN}(\mathbf{0},\mathbf{I})$$

The resulting MIMO channel capacity for known and constant $\mathbf{H}$ should be:

$$C = \log_2\det\left(\mathbf{I}+\mathbf{HQH}^H\right)$$

where $\mathbf{Q}$ denotes the covariance matrix of $\mathbf{x}$.

In my opinion the channel capacity should be real valued. But if I simulate it in MATLAB and compute the capacity I obtain a complex capacity. I generate a random complex $\mathbf{H}$ since $\mathbf{H} \in \mathbb{C}^{n \times n}$ and chose a random covariance matrix $\mathbf{Q} \in \mathbb{C}^{n \times n}$ which is symmetric and positive semi-definite.

Am I doing something wrong in MATLAB or do I violate and conditions, constraints or rules?

My Matlab code is:

%% Init
N = 2;
% Generate complex random channel H
H = sqrt(1) * (randn(N,N)+1i*randn(N,N));
% Generate complex, symmetric positive semidefinite Q
Q = [1,complex(3,-7);complex(3,-7),13];
%% Check if Q is a valid covariance matrix
% Check if Q is symmetric
sym = issymmetric(Q)
% Check if Q is positive definite
psd = all(eig(0.5*(Q+Q'))>=0)
%% Compute capacity
C = log2( det(eye(N,N) + H\*Q\*H' ) )


The way you generate the covariance matrix is not right. I would either use Matlab's gallery, or generate a random matrix as follows:

A=rand(N)+j*rand(N);
Q=A*A';


To check if a matrix Q is positive semidefinite, you can look at the eigenvalues and see they are all nonnegative. You can use eig(Q) in Matlab.

• Thank you very much, it works. I didn't know that the covariance matrix has to be hermitian ($\mathbf{Q}=\mathbf{Q}^H$) and not symmetric. – Enzo Oct 6 '16 at 14:37
• You are welcome @Enzo. Symmetric is for real matrices... – msm Oct 6 '16 at 14:59
N=4;
P=6;
H=randn(N,N);
I=eye(N);
cvx_begin
variable Q(N,N)
maximize log_det(I+H*Q*H')
subject to
trace(Q)<=P
Q==hermitian_semidefinite(N)
cvx_end

• Could you add some text/explanation to what you're posting ? – Gilles May 24 '17 at 8:52