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' ) )

2 Answers 2


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


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.

  • $\begingroup$ 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. $\endgroup$
    – Enzo
    Commented Oct 6, 2016 at 14:37
  • 1
    $\begingroup$ You are welcome @Enzo. Symmetric is for real matrices... $\endgroup$
    – msm
    Commented Oct 6, 2016 at 14:59
variable Q(N,N)
maximize log_det(I+H*Q*H')
subject to
  • 2
    $\begingroup$ Could you add some text/explanation to what you're posting ? $\endgroup$
    – Gilles
    Commented May 24, 2017 at 8:52

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.