File Exchange

image thumbnail


version (264 KB) by Peter Kabal
Routines to design/evaluate MMSE scalar quantizers, and an efficient quantizer routine.


Updated 19 Jun 2009

View License


Quantizer Design
This group of routines designs and evaluates scalar quantizers. A scalar quantizer is defined by a set of decision values and a set of output values. The Lloyd-Max algorithms are used to design minimum-mean-square error scalar quantizers based on a given probability density functions.
There are two basic design routines: QuantOpt to design general non-uniformly spaced quantizers, and QuantUnif to design uniformly spaced quantizers. For each, the quantizer can additionally be constrained to have symmetrically spaced levels. A number of different probability density functions are supported.
1. Uniform: Uniform pdf leading to a uniform quantizer
2. Gaussian: Gaussian pdf
3. Laplace: Two-sided laplace pdf
4. Sine: pdf for a sinusoid with random phase
5. Gamma: Gamma pdf (generalized gamma distribution with parameter 1/2)
6. Generalized Gamma: Generalized gamma pdf specified with an additional parameter
7. Tabulated: A pdf specified by a set of points. The points are (x,p) pairs. The pdf is assumed to be linear between the given points and zero outside the points. For sufficiently smooth pdf’s, the tabulated option can be used to design minimum mean-square error quantizers for arbitrary pdf’s by supplying samples of the pdf.

Design Strategy
The initial search for a quantizer which satisfies the necessary conditions for minimum mean-square error is done using a one-dimensional search (Lloyd algorithm). A refinement step using the Lloyd-Max iteration is then carried out.

Quantizer Evaluation
The quantizer is evaluated by calculating the resulting mean-square error (and SNR in dB), and the quantizer entropy. The evaluation routines QuantSNR can be used for any quantizer (whether designed by the design routines described above or not).

Log-PCM Quantizers
The routines QuantALawTables and QuantMuLawTables generate quantizer tables for log-PCM quantization as per ITU-T Recommendation G.711.

The routine Quant efficiently carries out quantization. Internally it uses the Matlab routine histc. This routine is more efficient than the Matlab function quantiz (Communications Toolbox). Quant has an option for having input values which lie exactly at the decision boundaries round up or round down.

Comments and Ratings (3)


Frank (view profile)


good work bro!!


Lucas (view profile)


Update BSD license - no file changes

MATLAB Release Compatibility
Created with R2009a
Compatible with any release
Platform Compatibility
Windows macOS Linux

Discover Live Editor

Create scripts with code, output, and formatted text in a single executable document.

Learn About Live Editor