written 5.8 years ago by | modified 2.4 years ago by |
{x1, x2 , . . . . . . x8} with probabilities
P(x) = {0.07,0.08,0.04,0.26,0.14,0.09,0.07,0.25}. Find the code efficiiency.
written 5.8 years ago by | modified 2.4 years ago by |
{x1, x2 , . . . . . . x8} with probabilities
P(x) = {0.07,0.08,0.04,0.26,0.14,0.09,0.07,0.25}. Find the code efficiiency.
written 5.6 years ago by | • modified 5.6 years ago |
Symbol | f(x) | Codeword | length |
---|---|---|---|
$x_4$ | 0.26 | 01 | 2 |
$x_8$ | 0.25 | 10 | 2 |
$x_5$ | 0.14 | 001 | 3 |
$x_6$ | 0.09 | 001 | 3 |
$x_2$ | 0.08 | 0000 | 4 |
$x_1$ | 0.07 | 0001 | 4 |
$x_7$ | 0.07 | 1100 | 4 |
$x_3$ | 0.04 | 1101 | 4 |
$\text{Efficiency} = \frac{H(x)}{L}$
$H(x) = \sum_{x=0}^n p_x \ log_2 \frac{1}{P_x}$
$L = \sum_{x=0}^n \ P_x \times \text{(length of codeword)}$
$\begin{aligned} H(x) &= 0.26 \ log_2 \left( \frac{1}{0.26} \right) + 0.25 \ log_2 \left( \frac{1}{0.25} \right) \\ &+ 0.14 \ log_2 \left( \frac{1}{0.14} \right) + 0.09 \ log_2 \left( \frac{1}{0.09} \right) \\ &+ 0.08 \ log_2 \left( \frac{1}{0.08} \right) + 0.07 \ log_2 \left( \frac{1}{0.07} \right) \\ &+ 0.07 \ log_2 \left( \frac{1}{0.07} \right) + 0.04 \ log_2 \left( \frac{1}{0.04} \right) \\ &= 0.81 \text{ bits/message} \end{aligned}$
$\begin{aligned} L &= (0.26 \times 2) + (0.25 \times 2) + (0.14 \times 3) + (0.09 \times 3) + (0.08 \times 4) + (0.07 \times 4) + (0.07 \times 4) + (0.04 \times 4) \\ &= 0.52 + 0.50 + 0.42 + 0.27 + 0.32 + 0.28 + 0.28 + 0.16 \\ &= 2.75 \text{ bits/symbol} \end{aligned}$
$\text{Efficiency} = \frac{H(x)}{L} = \frac{0.81}{2.75} = 0.29 = 29 \%$