Past exam question: 2071 Chaitra, Q11(a)
Open in the Padhaiko appQuestion
Why is source coding necessary? Differentiate between fixed length codes and variable length codes.
Solution
Necessity of Source Coding: Source coding (data compression) is necessary to:
- Remove Inherent Redundancy: Natural data (text, audio, images) contains statistical redundancies. Source coding removes this redundancy to represent information with the minimum number of binary digits.
- Conserve Bandwidth and Storage: Minimizes the channel bit rate required for real-time transmission and reduces persistent storage space, approaching the Shannon source entropy bound .
Fixed Length vs Variable Length Codes:
| Parameter | Fixed Length Codes | Variable Length Codes |
|---|---|---|
| Codeword Length | Every symbol is assigned a codeword of identical bit length (e.g., standard 7-bit ASCII). | Symbols are assigned varying codeword lengths based on their probability of occurrence. |
| Efficiency | Inefficient when symbol probabilities are unequal. | Highly efficient; approaches source entropy (e.g., Huffman coding). |
| Complexity & Framing | Extremely simple decoding; boundaries occur at fixed multiples of bits. | Requires prefix-free condition to guarantee unambiguous instantaneous decoding. |
Answer:
Source coding removes statistical redundancy to compress data closer to entropy . Fixed-length codes assign identical bit lengths to all symbols (simple framing, suboptimal rate), whereas variable-length codes assign shorter codewords to frequent symbols and longer ones to rare symbols (higher efficiency, requires prefix-free decoding).