Accelerating the pace of engineering and science

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

## Construction

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

H = dsp.VectorQuantizerDecoder('PropertyName',PropertyValue,...) returns a vector quantizer decoder, H, 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

 clone Create vector quantizer decoder object with same property values getNumInputs Number of expected inputs to step method getNumOutputs Number of outputs of step method isLocked Locked status for input attributes and nontunable properties release Allow property value and input characteristics changes step Perform vector quantization decoding

## Examples

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

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

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