- 2071 Chaitra · 1+1+1 marks
Source coding; fixed vs variable length codes
Short answer
Source coding removes redundancy to save bandwidth and storage. Fixed-length codes assign equal bits to all symbols, while variable-length codes give shorter codes to frequent symbols, achieving lower average length. Huffman coding builds an optimal prefix code minimizing average length for given probabilities.
Why is source coding necessary? Differentiate between fixed length codes and variable length codes. What is the purpose of Huffman's coding algorithm?
Why source coding is necessary
Raw data (text, audio, images) contains redundancy, so sending it as it is wastes bandwidth and storage. Source coding removes this redundancy and represents the data with the fewest bits (compression), approaching the source entropy.
Fixed length vs variable length codes
| Point | Fixed-length code | Variable-length code |
|---|---|---|
| Code length | Same for all symbols | Differs; frequent symbols get shorter codes |
| Average length | Higher, ⌈log₂ M⌉ bits for M symbols | Lower, close to the entropy |
| Decoding | Simple | Needs the prefix property |
| Example | ASCII (7 or 8 bits) | Huffman, Morse |
Purpose of Huffman coding
Huffman's algorithm builds the optimal prefix (variable-length) code for given symbol probabilities. It gives the shortest average code length, and so the best lossless compression for symbol-by-symbol coding.
✓ Answer checked by Claude Sonnet 5.5
Related questions
- Source coding vs channel coding · Data Communication, chapter 8
- Huffman coding principle · Data Communication, chapter 8 · asked 3×
- Huffman coding of a sentence (Khoji Rahechha) · Data Communication, chapter 8
- Huffman code for symbols A to E (0.4, 0.3, ...) · Data Communication, chapter 8
- Dataword vs codeword; error coding techniques · Data Communication, chapter 8
- Huffman code for five symbols (0.2, 0.35, ...) · Data Communication, chapter 8
- Importance of source coding; Shannon-Fano vs fixed length (seven symbols) · Communication Systems, chapter 6
- Variable length coding; entropy and fixed code efficiency · Communication Systems, chapter 6
- Huffman code for five-symbol DMS vs fixed length · Communication Systems, chapter 6
- Source vs channel coding; Huffman for five symbols · Communication Systems, chapter 6