Skip to main content

Importance of source coding; fixed vs Shannon-Fano (five symbols)

Short answer

Source coding removes redundancy, lowering bit rate, bandwidth, and power. For P={0.3,0.25,0.2,0.15,0.1}, entropy H=2.2282 bits/symbol. Fixed-length (3-bit) efficiency 74.27%; Shannon-Fano coding gives average length 2.25 bits/symbol, efficiency 99.03% and saves 0.75 bits per symbol.

Discuss the importance of source coding in Digital Communication System. A discrete memory less source emits five symbols with probabilities P = {0.3, 0.25, 0.2, 0.15, 0.1}, find coding efficiency for both fixed and Shannon-Fano coding and compare results.

Importance of source coding

Source coding converts the source output into a binary sequence using as few bits per symbol as possible, by removing redundancy. Its importance:

  1. Lower bit rate: the average code length Lˉ\bar L approaches the entropy HH, so fewer bits are sent for the same information.
  2. Bandwidth saving: a lower bit rate needs less channel bandwidth, so more users or services fit in the same band.
  3. Power and energy saving: fewer bits means less transmitted energy, important in mobile and satellite links.
  4. Storage saving: compressed files (ZIP, JPEG, MP3) need less memory.
  5. Exploits statistics: variable-length codes give short words to frequent symbols and long words to rare ones.
  6. Theoretical guarantee: Shannon's source coding theorem, H≤Lˉ<H+1H \le \bar L < H + 1, shows how close a code can come to the limit; efficiency η=H/Lˉ\eta = H/\bar L measures the code.
  7. Uniquely decodable prefix codes allow decoding without separators.
  8. Supports channel coding: removing useless redundancy leaves room to add useful redundancy for error control.

Numerical: P={0.3,0.25,0.2,0.15,0.1}P = \{0.3, 0.25, 0.2, 0.15, 0.1\}

Entropy:

Symbolpip_ilog⁡2(1/pi)\log_2(1/p_i)pilog⁡2(1/pi)p_i\log_2(1/p_i)
S00.31.73700.5211
S10.252.00000.5000
S20.22.32190.4644
S30.152.73700.4105
S40.13.32190.3322
Total12.2282
H=2.2282 bits/symbolH = 2.2282\ \text{bits/symbol}

(a) Fixed-length coding: 5 symbols need ⌈log⁡25⌉=3\lceil\log_2 5\rceil = 3 bits each (000 to 100).

ηFL=HLˉ=2.22823=74.27%\eta_{FL} = \frac{H}{\bar L} = \frac{2.2282}{3} = 74.27\%

(b) Shannon–Fano coding: first split {0.3, 0.25} = 0.55 vs {0.2, 0.15, 0.1} = 0.45; then {0.2} vs {0.15, 0.1}.

Symbolpip_iStep 1Step 2Step 3Codelil_i
S00.300002
S10.2501012
S20.210102
S30.151101103
S40.11111113
LˉSF=0.3(2)+0.25(2)+0.2(2)+0.15(3)+0.1(3)=2.25 bits/symbolηSF=2.22822.25=99.03%\begin{aligned} \bar L_{SF} &= 0.3(2)+0.25(2)+0.2(2)+0.15(3)+0.1(3) = 2.25\ \text{bits/symbol} \\ \eta_{SF} &= \frac{2.2282}{2.25} = 99.03\% \end{aligned}

Comparison

MethodLˉ\bar LEfficiencyRedundancy
Fixed length374.27 %25.73 %
Shannon–Fano2.2599.03 %0.97 %

Shannon–Fano uses 0.75 bit/symbol less (25 % fewer bits) and is almost at the entropy limit, while fixed-length coding wastes about a quarter of the bits.

✓ Answer checked by Claude Opus 5.5 (high effort)

All Communication Systems chapter 6 questions →