# What's the difference between quantization and coding?

From what I understand quantization takes an analog signal and assigns numerical values to it as convert it to a discrete signal. However coding converts a signal into binary. It seems like coding is a part of quantization--if you're assigning a value to an analog signal, and you're using a computer, you'd necessarily need to use binary. Nonetheless I see diagrams with coders as separate blocks compared to quantizers. What's the difference between them?

• Can you paste any such diagram, then we can address your specific query better – Dsp guy sam Apr 16 at 18:16
• quantization also happens whenever a longer word length is truncated (or rounded) to a shorter word length. that is a totally digital operation done to a digital signal. – robert bristow-johnson Apr 16 at 19:48

## 1 Answer

Quantization is simply the rounding associated with going from a higher precision numbering system to a lower precision, for example analog to digital, or floating point to fixed point, or from a 16 bit system where our min to max values have $$2^{16}$$ levels to a 14 bit system where those same values now only have $$2^{14}$$ levels (so the true value will be further rounded or truncated).

Coding can refer channel encoding which is the process of introducing redundancy or memory systematically (error correcting codes) so that we can detect and correct for errors. A simple example often given is sending the same data multiple times and then voting on which answer occurred the most; this is a repetition code.

Coding can also refer to source encoding which is the process of removing redundancy to whiten the data which provides many conveniences including data compression and using the channel efficiently, but also for the ability of the receiver to work optimally for channel estimation and timing recovery.

The two processes above are often done together which is interesting in that we first source code by removing redundancy (to compress data), and then we systematically introduce redundancy (to reduce errors)!

Encryption can be considered another form of "coding".