tanszek:oktatas:techcomm:shanon-fano_method
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
tanszek:oktatas:techcomm:shanon-fano_method [2024/08/27 16:34] – knehez | tanszek:oktatas:techcomm:shanon-fano_method [2024/10/08 08:45] (current) – knehez | ||
---|---|---|---|
Line 26: | Line 26: | ||
$$ H = -\left(\frac{2}{4} \log \frac{1}{4} + \frac{2}{8} \log \frac{1}{8} + \frac{4}{16} \log \frac{1}{16}\right) = 2.75 \, \text{[bit].} $$ | $$ H = -\left(\frac{2}{4} \log \frac{1}{4} + \frac{2}{8} \log \frac{1}{8} + \frac{4}{16} \log \frac{1}{16}\right) = 2.75 \, \text{[bit].} $$ | ||
+ | |||
+ | What is the average word length? | ||
+ | |||
+ | We can calculate the average word length with the use of this function: \( L = \sum_{i=1}^n x_i \mu_i \) | ||
+ | |||
+ | After substituting: | ||
+ | |||
+ | $$ L = \frac{2}{4} \cdot 2 + \frac{2}{8} \cdot 3 + \frac{4}{16} \cdot 4 = 2.75 \,\text{ [bit]}$$ | ||
+ | |||
+ | The original 8 symbols (X1-X8) can be stored with 4 bits. The average length is 2.75 bits, thus the compressed messages will be \(\frac{2.75}{4} \approx 68.75\% \) shorter. | ||
tanszek/oktatas/techcomm/shanon-fano_method.1724776483.txt.gz · Last modified: 2024/08/27 16:34 by knehez