Quantizing Numeric Samples

Quantization maps a range of inputs to a finite set of output codes or representable values. Its step and rounding rule determine error.

Source
Anbloq
Language
English
Created
Updated
Chapters
4
Reading time
1 min
In this article4 chapters
  1. Trace three rounded values
  2. Handle ties and bounds
  3. Apply a declared rounding rule and reconstruct a level
  4. Separate finite range from spacing

Trace three rounded values

Rounding real readings to the nearest integer gives two for 1.8 and 2.2, while 2.8 gives three. Several inputs share one output. See rounding choices.

Handle ties and bounds

A half-step needs a tie rule. Values above the supported maximum may be rejected or clamped deliberately. See clamping computed values.[1][2]

Apply a declared rounding rule and reconstruct a level

With step size 0.25 and nearest-level quantization, input 0.62 maps to 0.5 because it is 0.12 away from 0.5 and 0.13 from 0.75. A value exactly halfway requires a tie rule. See absolute and relative error.

Sample .62
Nearest level .50
Absolute error .12
Midpoint .625 needs a declared tie behavior

Separate finite range from spacing

Values beyond the supported range may clip at the last level. Then the usual half-step bound no longer holds. Test a midpoint, a value near zero and one outside range.

References

  1. Claude E. Shannon, A Mathematical Theory of Communication ↩
  2. David J. C. MacKay, Information Theory, Inference, and Learning Algorithms ↩