This is machine translation

Translated by Microsoft
Mouseover text to see original. Click the button below to return to the English version of the page.

Note: This page has been translated by MathWorks. Please click here
To view all translated materials including this page, select Japan from the country navigator on the bottom of this page.

dsp.VectorQuantizerDecoder System object

Vector quantizer codeword for given index value


The VectorQuantizerDecoder object returns the vector quantizer codeword for a given index value. Each column of the Codebook property is a codeword.

To obtain the vector quantizer codeword for a given index value:

  1. Define and set up your vector quantizer decoder. See Construction.

  2. Call step to get the vector quantizer codeword according to the properties of dsp.VectorQuantizerDecoder. The behavior of step is specific to each object in the toolbox.


Starting in R2016b, instead of using the step method to perform the operation defined by the System object™, you can call the object with arguments, as if it were a function. For example, y = step(obj,x) and y = obj(x) perform equivalent operations.


vqdec = dsp.VectorQuantizerDecoder creates a vector quantizer decoder System object, vqdec, that returns a vector quantizer codeword corresponding to a given, zero-based index value.

vqdec = dsp.VectorQuantizerDecoder('PropertyName',PropertyValue,...) returns a vector quantizer decoder, vqdec, with each specified property set to the specified value.



Source of codebook values

Specify the codebook source as Property or Input port. When you select Property, the object reads the codebook from the Codebook property. When you select Input port, the object reads the codebook from the input of the step method.

The default is Property.



Specify quantized output values as a k-by-N matrix, where k1 and N1. Each column of the codebook matrix is a codeword, and each codeword corresponds to an index value. This property applies when you set the CodebookSource property to Property. The default is:

[1.5 13.3 136.4 6.82.5 14.3 137.4 7.83.5 15.3 138.4 8.8]

This property is tunable.


Data type of codebook and quantized output

Specify the data type of the codebook and quantized output values as: Same as input, double, single or Custom. This property applies only when you set CodebookSource to Property. The default is double.

 Fixed-Point Properties


stepPerform vector quantization decoding
Common to All System Objects

Create System object with same property values


Expected number of inputs to a System object


Expected number of outputs of a System object


Check locked states of a System object (logical)


Allow System object property value changes


expand all

Note: This example runs only in R2016b or later. If you are using an earlier release, replace each call to the function with the equivalent step syntax. For example, myObject(x) becomes step(myObject,x).

Given index values as an input, determine the corresponding vector quantized codewords for a specified codebook.

vqdec = dsp.VectorQuantizerDecoder;
vqdec.Codebook = [1 10 100;2 20 200;3 30 300];
indices = uint8([1 0 2 0]);
qout = vqdec(indices)
qout = 

    10     1   100     1
    20     2   200     2
    30     3   300     3


This object implements the algorithm, inputs, and outputs described on the Vector Quantizer Decoder block reference page. The object properties correspond to the block parameters, except:

There is no object property that directly corresponds to the Action for out of range index value block parameter. The object sets any index values less than 0 to 0 and any index values greater than or equal to N to N-1.

Extended Capabilities

Introduced in R2012a

Was this topic helpful?