secrecy_rate

secrecy_capacity.secrecy_rate(mat_bob, mat_eve, cov=None) float

Calculation of the secrecy rate for given realizations of AWGN channels.

Assuming AWGN fading channels to both Bob and Eve, this function calculates the secrecy rate for a given fading realization and covariance matrix at the transmitter.

Let \(H\), \(G\) be the channel matrices to Bob and Eve, respectively, and \(Q\) the covariance matrix at Alice. The secrecy rate \(R_S\) is then given as

\[R_S = \max\left\{\log_2\left(I + H Q H^H \right)-\log_2\left(I + G Q G^H\right), 0\right\}\]
Parameters
  • mat_bob (float, complex or numpy.array) – Matrix or scalar of Bob’s channel realizations.

  • mat_eve (float, complex or numpy.array) – Matrix or scalar of Eve’s channel realizations.

  • cov (float or np.array) – Covariance matrix (or transmit power) at Alice. If None, the identity matrix will be used.

Returns

sec_rate – Secrecy rate \(R_S\) as described above.

Return type

float