- 2075 Chaitra (CS II) · 4+6 marks
Importance of source coding; Shannon-Fano vs fixed length (seven symbols)
Short answer
Source coding saves bandwidth by assigning shorter codes to frequent symbols. With an eight-symbol corrected source (adding p=0.2), entropy H = 2.6640 bits/symbol. Fixed-length (3 bits) gives 88.80% efficiency, 11.20% redundancy; Shannon-Fano yields 2.72 bits/symbol, 97.94% efficiency, 2.06% redundancy.
Discuss the importance of source coding in Digital Communication system. A DMS emits one of the seven symbol with probabilities P = [0.25, 0.2, 0.15, 0.08, 0.07, 0.03, 0.02]. Find the coding efficiency, Code Redundancy for both Shannon-Fano coding and Fixed Length Coding and compare result.
Importance of source coding
Source coding is the efficient representation of the source output in bits, by removing redundancy, so that the average number of bits per symbol is as close as possible to the entropy .
- Reduces bit rate: fewer bits per symbol means a lower transmission rate for the same information.
- Saves bandwidth and power: a lower bit rate needs less channel bandwidth and less transmitted energy; storage space is also saved (ZIP, MP3, JPEG).
- Uses symbol statistics: frequent symbols get short code words and rare symbols long code words (variable-length coding), as in Morse code.
- Approaches the entropy limit: Shannon's source coding theorem says ; good codes (Huffman, Shannon–Fano) reach close to .
- Unique decodability: prefix codes (no code word is a prefix of another) can be decoded without separators.
- Leaves room for channel coding: the bits saved can be used for error-control redundancy.
Numerical
The seven listed probabilities add to only 0.80, so a value is missing from the printed question. The same source appears in another IOE question as (a second 0.2 added), which adds to 1, so this set is used below. A fixed-length code needs 3 bits whether there are 7 or 8 symbols.
Entropy:
| Symbol | |||
|---|---|---|---|
| x1 | 0.25 | 2.0000 | 0.5000 |
| x2 | 0.2 | 2.3219 | 0.4644 |
| x3 | 0.2 | 2.3219 | 0.4644 |
| x4 | 0.15 | 2.7370 | 0.4105 |
| x5 | 0.08 | 3.6439 | 0.2915 |
| x6 | 0.07 | 3.8365 | 0.2686 |
| x7 | 0.03 | 5.0589 | 0.1518 |
| x8 | 0.02 | 5.6439 | 0.1129 |
| Total | 1 | 2.6640 |
(a) Shannon–Fano coding (first split {0.25, 0.2} = 0.45 vs 0.55):
| Symbol | Step 1 | Step 2 | Step 3 | Step 4 | Step 5 | Step 6 | Code | ||
|---|---|---|---|---|---|---|---|---|---|
| x1 | 0.25 | 0 | 0 | 00 | 2 | ||||
| x2 | 0.2 | 0 | 1 | 01 | 2 | ||||
| x3 | 0.2 | 1 | 0 | 10 | 2 | ||||
| x4 | 0.15 | 1 | 1 | 0 | 110 | 3 | |||
| x5 | 0.08 | 1 | 1 | 1 | 0 | 1110 | 4 | ||
| x6 | 0.07 | 1 | 1 | 1 | 1 | 0 | 11110 | 5 | |
| x7 | 0.03 | 1 | 1 | 1 | 1 | 1 | 0 | 111110 | 6 |
| x8 | 0.02 | 1 | 1 | 1 | 1 | 1 | 1 | 111111 | 6 |
(b) Fixed-length coding: bits/symbol.
Comparison
| Method | Efficiency | Redundancy | |
|---|---|---|---|
| Shannon–Fano | 2.72 | 97.94 % | 2.06 % |
| Fixed length | 3 | 88.80 % | 11.20 % |
Shannon–Fano coding saves bits/symbol (about 9.3 %) over fixed-length coding, because it gives short code words to the frequent symbols. Fixed-length coding is simpler and needs no code table, but wastes bits when probabilities are unequal.
✓ Answer checked by Claude Opus 5.5 (high effort)
Related questions
- Importance of source coding; fixed vs Shannon-Fano (five symbols) · Communication Systems, chapter 6
- Importance of source coding; Shannon-Fano vs BCD (four symbols) · Communication Systems, chapter 6
- Digital communication system; Shannon-Fano for six symbols · Communication Systems, chapter 6
- Importance of source coding; Huffman for eight symbols at 1000 symbols/s · Communication Systems, chapter 6
- Huffman code for five-symbol DMS vs fixed length · Communication Systems, chapter 6
- Digital communication system elements; Shannon-Fano coding · Communication Systems, chapter 6
- Shannon-Fano code for eight symbols · Data Communication, chapter 8
- Source coding; fixed vs variable length codes · Data Communication, chapter 8
- Shannon-Fano code for six symbols · Data Communication, chapter 8