AdvancedTopic 83 of 101Signals, Control & Comms

Source coding

Compression using Huffman and arithmetic codes.

In depth

Source coding removes redundancy: lossless (Huffman, arithmetic, LZ77/LZW, DEFLATE) and lossy (JPEG, MP3, H.264/H.265) with rate-distortion trade-offs. Entropy H=-Σp log₂p is the lower bound for lossless compression. Transform coding concentrates energy in few coefficients.

Key points

  • Prefix codes
  • Entropy
  • Quantisation in lossy coding
Example

ZIP files use DEFLATE (LZ77 + Huffman).

Why it matters

Source coding removes redundancy from data before transmission, which saves bandwidth and storage.

Where this is used

  • Compressing a text file with Huffman coding.
  • Reducing the size of a sensor log before sending it over a slow link.
  • Using arithmetic coding in an image compressor.

Frequently asked questions

What is Source coding?

Compression using Huffman and arithmetic codes.

Why is it important to understand source coding?

Source coding removes redundancy from data before transmission, which saves bandwidth and storage.

What is entropy in source coding?

The average information per symbol, which sets the lower limit on the average code length for lossless compression.

What does Huffman coding do?

It assigns shorter codes to more frequent symbols and longer ones to rare symbols, giving near-optimal lossless compression.

How is Source coding used in practice?

Typical applications include compressing a text file with Huffman coding, reducing the size of a sensor log before sending it over a slow link and using arithmetic coding in an image compressor.

What should I learn before Source coding?

Study "Bit error rate" first (topic 82 of 101 in Signals, Control & Comms). It covers the groundwork this topic builds on.

What are the key points of Source coding?

Prefix codes. Entropy. Quantisation in lossy coding.

Can you give an example of Source coding?

ZIP files use DEFLATE (LZ77 + Huffman).

What comes after Source coding?

The next topic is "Channel coding", which builds directly on this one.

How difficult is Source coding?

It is classed as Advanced in Signals, Control & Comms (topic 83 of 101). It is an advanced topic. It assumes you are comfortable with the intermediate topics in Signals, Control & Comms.

Learning path

Want to practise? Open the interactive course for quick checks, quizzes, simulations and progress tracking.

Related topics