TactivergeLite

Lite / Textbooks / Signals and Systems / Chapter 4

4. Quantisation and resolution

Version 1 · Technically checked (automated checks only) · 3 source lessons · Full interactive version

Introduction

After sampling in time comes rounding in value. An ADC has a fixed number of bits, so every reading is rounded to the nearest of 2^n levels. That rounding adds a small, predictable error, quantisation noise, and every extra bit roughly halves it. Resolution is not accuracy: a 16-bit sensor that reads 2 °C high is precise and wrong. Choosing the range wisely matters as much as the bit count.

Figure 4.1. 3 bits → 8 levels (described in words)

A 3-bit quantiser over 0 to 8 V drawn as a staircase beside the ideal straight line: 8 levels, 1 V apart. The rounding noise has RMS value step/√12 = 0.289 V, and the ideal signal-to-quantisation-noise ratio is about 19.8 dB.

Explanation

Built from 3 School lessons. Each part is the lesson's own explanation.

4.1 Range, resolution and the bits behind them

A 10-bit and a 16-bit sensor both measure 0–5 V. One sees changes 64 times smaller. Does that make it 64 times more accurate?

Range: what it can see at all

The range is the span of inputs a sensor reports faithfully, for example 0–5 V or 2–400 cm. Outside it the output saturates: it sticks at the end value. A saturated reading is the most dangerous kind, because it looks like a normal number. Choose a range that covers the largest value you could meet, with some margin.

Resolution: the smallest step

A converter with n bits has 2ⁿ codes. Spread over the range, each step is range ÷ 2ⁿ wide (some datasheets divide by 2ⁿ − 1; the difference is tiny for large n). A 12-bit converter on 0–3.3 V has steps of 3.3 ÷ 4096 ≈ 0.81 mV. Every reading carries an extra uncertainty of up to one step, called quantisation error.

Resolution is not accuracy

Resolution says how finely the sensor divides the range. Accuracy says how close the reported value is to the truth. A sensor with a gain error, an offset or a bow in its response can report confidently in tiny steps and still be wrong by a lot. Extra bits help only when quantisation is the biggest error.

Reading a spec line

'Range 0–40 °C, resolution 0.01 °C, accuracy ±0.5 °C' tells you the readings move in hundredths but can be half a degree off. For a greenhouse that is fine; for a medical thermometer it is not. Always ask which number limits your task.

Common mix-ups

Open the Lite lesson: Range, resolution and the bits behind them

4.2 Rounding to the nearest step

Why does a 16-bit recording sound clean but an 8-bit one hiss, when both sample just as fast?

Steps and codes

An ideal N-bit ADC splits its input range V into 2^N equal steps of size Δ = V/2^N and outputs the code of the step the input falls in. A 12-bit ADC on a 3.3 V range has Δ = 3.3/4096 ≈ 0.81 mV. A rounding quantiser is never more than Δ/2 away from the truth.

Error behaves like noise

For a signal that wanders across many steps, the rounding error looks like random noise spread evenly between ±Δ/2, with power Δ²/12. That is why quantisation is often called quantisation noise, and why the SNR formula works. It fails for very slow or tiny signals, where the error follows the signal and shows up as distortion instead.

Use the whole range

The formula assumes a full-scale sine. A signal using a quarter of the range has 1/16 of the power but the same Δ, so it loses 20·log₁₀ 4 ≈ 12 dB: two bits' worth. Engineers add an amplifier in front of the ADC so the signal fills the range without clipping.

Derivation: Where 6.02N + 1.76 dB comes from
  1. An N-bit quantiser spanning a full range of 2A (from −A to +A) has step Δ = 2A/2^N.

  2. Rounding error e lies between −Δ/2 and +Δ/2. If it is spread evenly (true for busy signals), its mean square is σₑ² = Δ²/12.

  3. A full-scale sine of amplitude A has power P = A²/2.

  4. SNR = P/σₑ² = (A²/2) / (4A²/(12·4^N)) = 1.5 · 4^N.

  5. In decibels: 10·log₁₀(1.5) + N·10·log₁₀(4) = 1.76 + 6.02N dB.

Common mix-ups

Open the Lite lesson: Rounding to the nearest step

4.3 Range, resolution, accuracy, precision

A thermometer shows 21.37 °C. Does all that detail mean it is right?

Range and resolution

Range is the span a sensor can measure, such as −40 to 125 °C. Outside it, readings are wrong or clipped. Resolution is the smallest change it can report, such as 0.5 °C. A 0–100 °C sensor with 0.5 °C resolution can report 100 ÷ 0.5 + 1 = 201 different values.

Accuracy and precision

Accuracy is how close readings are to the true value. Precision is how close repeated readings are to each other. Picture darts: a tight cluster off-centre is precise but inaccurate; a loose spread around the bullseye is accurate on average but imprecise. Calibration fixes consistent offsets; averaging reduces scatter.

Decimal places are not truth

A display showing 21.37 °C has fine resolution, but if the datasheet says ±2 °C accuracy, the true value could be anywhere from about 19.4 to 23.4 °C. Always report a measurement with an honest uncertainty, and never trust digits beyond what the datasheet promises.

Common mix-ups

Open the Lite lesson: Range, resolution, accuracy, precision

Worked examples

Range, resolution and the bits behind them: example 1

A 10-bit ADC spans 0–3.3 V. What is one step, and what code does 1.00 V give?

Solution

Step = 3.3 ÷ 1024 ≈ 3.22 mV. Code = ⌊1.00 ÷ 0.003223⌋ = ⌊310.3⌋ = 310, which means 310 × 3.22 mV ≈ 0.999 V.

Range, resolution and the bits behind them: example 2

A load cell's amplifier outputs 0–2 V and you want 0.1 mV steps. How many bits?

Solution

2 V ÷ 0.1 mV = 20,000 steps. 2¹⁴ = 16,384 is too few; 2¹⁵ = 32,768 is enough. You need 15 bits, so in practice a 16-bit converter.

Rounding to the nearest step: example 1

An 8-bit ADC spans 0–5 V. Find Δ, the maximum error and the best-case SNR.

Solution

Δ = 5/256 = 19.5 mV. Maximum rounding error = Δ/2 ≈ 9.8 mV. SNR ≈ 6.02 × 8 + 1.76 = 49.9 dB.

Rounding to the nearest step: example 2

You need 70 dB of SNR. How many bits?

Solution

N ≥ (70 − 1.76)/6.02 = 11.3, so 12 bits.

Range, resolution, accuracy, precision: example 1

A distance sensor measures 2 cm to 400 cm with 1 cm resolution and ±3 cm accuracy. It reports 150 cm. What can you honestly say?

Solution

The object is between about 147 and 153 cm away. The sensor can report 399 different whole-centimetre values, but accuracy, not resolution, limits what you know.

Interactive figures, in words

Figure 4.2 from Range, resolution and the bits behind them

Start at 4 bits and slide the true input slowly: the reading jumps in steps. Raise the bits and watch the staircase shrink. Then push the input past the top of the range, and finally add bow. Which problems do extra bits fix, and which don't they touch?

The diagram plots the reported voltage against the true input as a staircase. With 4 bits the steps are 0.31 V tall on a 5 V range; with 12 bits they are 1.2 mV and the staircase looks like a straight line. Inputs above the top of the range all read the maximum code (saturation). Adding bow curves the staircase away from the straight line by up to bow × range ÷ 4, an error extra bits cannot remove.

Figure 4.3 from Rounding to the nearest step

Start at 3 bits and full amplitude. Note the measured SNR, then add bits one at a time. Then go back to 8 bits and turn the amplitude down to 0.25. How many dB do you lose, and how many bits is that worth?

The quantiser shows a sine wave and its staircase approximation. With 3 bits there are 8 levels and the measured SNR is about 20 dB; every extra bit adds about 6 dB, matching 6.02N + 1.76. Reducing the amplitude to 0.25 of full scale costs about 12 dB.

The interactive versions are in the full chapter.

Laboratory

These run in a browser on the full site (they need a faster connection). Simulations are simplified educational models.

Practice

Each question links to its Lite lesson, where your answer is checked on our server and a wrong answer gets a hint. Answers are never sent to your device.

  1. How many distinct codes does a 12-bit converter have?
    Answer it in “Range, resolution and the bits behind them”
  2. A sensor has a ±2% gain error. Upgrading its converter from 10 to 16 bits will…
    Answer it in “Range, resolution and the bits behind them”
  3. A sensor outputs 0–0.5 V into a 10-bit converter spanning 0–5 V. How many of the 1024 codes can it actually use?
    Answer it in “Range, resolution and the bits behind them”
  4. An ideal 10-bit ADC spans 0 to 3.3 V. What is its step Δ, in millivolts (to 2 decimal places)?
    Answer it in “Rounding to the nearest step”
  5. Adding one bit to an ideal ADC…
    Answer it in “Rounding to the nearest step”
  6. When does 'quantisation error behaves like even, random noise' break down?
    Answer it in “Rounding to the nearest step”
  7. A sensor covers 0 to 50 °C with a resolution of 0.25 °C. How many distinct values can it report?
    Answer it in “Range, resolution, accuracy, precision”
  8. A sensor with ±1.5 °C accuracy reads 18.0 °C. What is the lowest temperature the true value could be, in °C?
    Answer it in “Range, resolution, accuracy, precision”

Engineering applications

Digital audio

Each extra bit of audio adds about 6 dB of dynamic range. Sixteen bits give enough range for quiet passages to stay clear of the rounding hiss, which is why it became the standard for CDs.

Wasted range

A 0–50 V input range used to read a 0–3 V sensor throws away most of the codes. Scaling the signal to fill the ADC's range gives far finer steps from the same converter.

Watch (optional)

Streaming video uses a lot of data. Everything you need is in the text.

Summary

Glossary

ADC resolution
An n-bit analogue-to-digital converter splits its reference voltage into 2^n steps; one step, the least significant bit, is the smallest change it can detect. Field Guide
Accuracy, precision and resolution
Accuracy is how close a measurement is to the true value; precision is how close repeated measurements are to each other; resolution is the smallest change an instrument can show. Field Guide
Logarithms and decibels
A logarithm answers 'what power gives this number?'. Decibels use logarithms to express ratios: 10 log10 for power ratios and 20 log10 for amplitude ratios. Field Guide
Binary place value
In binary each digit position is worth twice the one to its right: 1, 2, 4, 8, 16 and so on. A number's value is the sum of the place values that hold a 1. Field Guide

Project: How many bits?

A load cell outputs 0 to 20 mV for 0 to 10 kg, and you need to resolve 5 g. Decide on amplifier gain, ADC range and bit count, compute the step in grams, and explain the difference between the resolution you achieve and the accuracy you can claim.

Deliverables

Write it up on paper or in your own notes. Lite never stores what you write.

References

← 3. Aliasing: when samples lie5. Smoothing filters →