Documentation

This is machine translation

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

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

dsp.ScalarQuantizerDecoder System object

Convert each index value into quantized output value

Description

The ScalarQuantizerDecoder object converts each index value into a quantized output value. The specified codebook defines the set of all possible quantized output values or codewords. Input index values less than 0 are set to 0 and index values greater N – 1 are set to N – 1. N is the length of the codebook vector.

To convert an index value into a quantized output value:

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

  2. Call step to convert the index value according to the properties of dsp.ScalarQuantizerDecoder. 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

sqdec = dsp.ScalarQuantizerDecoder returns a scalar quantizer decoder System object, sqdec, that transforms zero-based input index values into quantized output values.

sqdec = dsp.ScalarQuantizerDecoder('PropertyName',PropertyValue,...) returns a scalar quantizer decoder object, sqdec, with each specified property set to the specified value.

Properties

CodebookSource

How to specify codebook values

Specify how to determine the codebook values as Property or Input port. The default is Property.

Codebook

Codebook

Specify the codebook as a vector of quantized output values that correspond to each index value. The default is 1:10. 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. The default is double.

 Fixed-Point Properties

Methods

stepDecode using scalar quantization
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 a codebook and index values as inputs, determine the corresponding output quantized values.

codebook = single([-2.1655 -1.3238 -0.7365 -0.2249 0.2726, ...
    0.7844 1.3610 2.1599]);
indices = uint8([1 3 5 7 6 4 2 0]);
sqdec = dsp.ScalarQuantizerDecoder;
sqdec.CodebookSource = 'Input port';
qout = sqdec(indices, codebook);

Algorithms

This object implements the algorithm, inputs, and outputs described on the Scalar 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?