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.UniformDecoder System object

Package: dsp

Decode integer input into floating-point output

Description

The UniformDecoder object decodes integer input into floating-point output. The decoder adheres to the definition for uniform decoding specified in ITU-T Recommendation G.701.

To decode an integer input into a floating-point output:

  1. Define and set up your uniform decoder. See Construction.

  2. Call step to decode the input according to the properties of dsp.UniformDecoder. 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

H = dsp.UniformDecoder returns a uniform decoder, H, that performs the inverse operation of the UniformEncoder object, reconstructing quantized floating-point values from encoded integer input.

H = dsp.UniformDecoder('PropertyName',PropertyValue,...) returns a uniform decoder, H, with each specified property set to the specified value.

H = dsp.UniformDecoder(peakvalue,numbits,
'PropertyName',PropertyValue,...)
returns a uniform decoder, H, with the PeakValue property set to peakvalue, the NumBits property set to numbits, and other specified properties set to the specified values.

Properties

PeakValue

Largest amplitude represented in encoded input

Specify the largest amplitude represented in the encoded input as a nonnegative numeric scalar. To correctly decode values encoded with the UniformEncoder object, set the PeakValue property in both objects to the same value. For more information on setting this property, see the PeakValue property description on the dsp.UniformEncoder reference page. The default is 1.

NumBits

Number of input bits used to encode data

Specify the number of bits used to encode the input data as an integer value between 2 and 32. The value of this property can be less than the total number of bits supplied by the input data type. To correctly decode values encoded with the UniformEncoder object, set the NumBits property in both objects to the same value. For more information on setting this property, see the NumBits property description on the dsp.UniformEncoder reference page. The default is 3.

OverflowAction

Action to take when integer input is out of range

Specify the behavior of the uniform decoder when the integer input is out of range as Saturate or Wrap. The value of the NumBits property specifies the representable range of the input. The default is Saturate.

OutputDataType

Output data type as single or double

Specify the data type of the output as single or double. The default is double.

Methods

cloneCreate uniform decoder object with same property values
getNumInputsNumber of expected inputs to step method
getNumOutputsNumber of outputs of step method
isLockedLocked status for input attributes and nontunable properties
releaseAllow property value and input characteristics changes
stepDecode integer input into quantized floating-point output

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

hue = dsp.UniformEncoder;
hue.PeakValue = 2;
hue.NumBits = 4;
hue.OutputDataType = 'Signed integer';
x = (0:0.25:2)'; % Create an input sequence
hud = dsp.UniformDecoder;
hud.PeakValue = 2;
hud.NumBits = 4;
x_encoded = hue(x);

Check that the last element has been saturated.

x_decoded = hud(x_encoded);

Algorithms

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

Introduced in R2012a

Was this topic helpful?