# Documentation

### This is machine translation

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

# dsp.VectorQuantizerDecoder System object

Package: dsp

Vector quantizer codeword for given index value

## Description

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.

 Note:   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.

## Construction

`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.

## Properties

 `CodebookSource` 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`. `Codebook` codebook Specify quantized output values as a k-by-N matrix, where $\text{k}\ge \text{1}$ and $N\ge 1$. 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: This property is tunable. `OutputDataType` 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`.

## Methods

 step Perform vector quantization decoding
Common to All System Objects
`clone`

Create System object with same property values

`getNumInputs`

Expected number of inputs to a System object

`getNumOutputs`

Expected number of outputs of a System object

`isLocked`

Check locked states of a System object (logical)

`release`

Allow System object property value changes

## Examples

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 ```

## Algorithms

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.