An implementation in Python3 of the standard convex optimization technique by Arimoto and Blahut.
The script is intended to approximate the channel capacity C
for a discrete memoryless channel (DMC) given a stationary transition probability distribution trans_prob_distr
as a two dimensional array, n x m
matrix.
Given a fixed transition probability distribution
Then do for iterations
- Evolve Q:
$Q_{ji}^{t} = \frac{p_i^{t-1}\omega_{ij}}{\sum_{k=1}^n p_k^{t-1} \omega_{kj}}$ - Evolve p:
$p_i^{t} = \frac{\prod_{j=1}^m (Q_{ji}^t)^{\omega_{ij}}}{\sum_{k=1}^n \prod_{j=1}^m (Q_{jk}^t){\omega_{kj}}}$
As long as the criteria for convergence are satisfied, the channel capacity can be approximated to arbitrary accuracy by the equation:
Change the transition probability distribution and increase number_of_iterations
to achieve satisfactory accuracy.