Vector Quantizer Encoder
Index of nearest codeword based on Euclidean or weighted Euclidean distance measure
Libraries:
DSP System Toolbox /
Quantizers
Description
The Vector Quantizer Encoder block compares each input column vector to the codeword vectors in the codebook matrix. Each column of this codebook matrix is a codeword. The block finds the codeword vector nearest to the input column vector and returns its zerobased index. This block supports real floatingpoint and fixedpoint signals on all input ports.
The Vector Quantizer Encoder block accepts real floatingpoint and fixedpoint inputs. For more information, see the Ports section.
Ports
Input
Output
Parameters
Block Characteristics
Data Types 

Direct Feedthrough 

Multidimensional Signals 

VariableSize Signals 

ZeroCrossing Detection 

More About
Algorithms
The block finds the nearest codeword by calculating the distortion. The block uses two methods for calculating distortion –– Euclidean squared error (unweighted) and weighted Euclidean squared error. Consider the codebook $$CB=\left[\begin{array}{cccc}C{W}_{1}& C{W}_{2}& \mathrm{...}& C{W}_{N}\end{array}\right]$$. This codebook has N codewords and each codeword has k elements. The ith codeword is defined as a column vector, $$C{W}_{i}=\left[\begin{array}{cccc}{a}_{1i}& {a}_{2i}& \mathrm{...}& {a}_{ki}\end{array}\right]$$. The multichannel input has M columns and is defined as $$U=\left[\begin{array}{cccc}{U}_{1}& {U}_{2}& \mathrm{...}& {U}_{M}\end{array}\right]$$, where the pth input column vector is $${U}_{p}={\left[\begin{array}{cccc}{u}_{1p}& {u}_{2p}& \mathrm{...}& {u}_{kp}\end{array}\right]}^{\prime}$$.
The squared error (unweighted) is calculated using the equation
$$D={\displaystyle \sum _{j=1}^{k}{\left({a}_{ji}{u}_{jp}\right)}^{2}}$$
The weighted squared error is calculated using the equation
$$D={\displaystyle \sum _{j=1}^{k}{w}_{j}{\left({a}_{ji}{u}_{jp}\right)}^{2}}$$
where the weighting factor is defined as $$W=\left[\begin{array}{cccc}{w}_{1}& {w}_{2}& \mathrm{...}& {w}_{k}\end{array}\right]$$. The index of the codeword that is associated with the minimum distortion is assigned to the input column vector.
References
[1] Gersho, A. and R. Gray. Vector Quantization and Signal Compression. Boston: Kluwer Academic Publishers, 1992.
Extended Capabilities
Version History
Introduced before R2006a
See Also
Quantizer (Simulink)  Scalar Quantizer Decoder  Uniform Encoder  Uniform Decoder  Vector Quantizer Decoder