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. Click here to see
To view all translated materials including this page, select Country from the country navigator on the bottom of this page.

dsp.UniformDecoder

Decode integer input into floating-point output

Description

The dsp.UniformDecoder System 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. Create the dsp.UniformDecoder object and set its properties.

  2. Call the object with arguments, as if it were a function.

To learn more about how System objects work, see What Are System Objects? (MATLAB).

Creation

Syntax

ud = dsp.UniformDecoder
ud = dsp.UniformDecoder(peakvalue,numbits)
ud = dsp.UniformDecoder(___,Name,Value)

Description

example

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

ud = dsp.UniformDecoder(peakvalue,numbits) returns a uniform decoder, ud, with the PeakValue property set to peakvalue and the NumBits property set to numbits.

ud = dsp.UniformDecoder(___,Name,Value) returns a uniform decoder, ud, with the PeakValue property set to peakvalue, NumBits property set to numbits, and other properties set to the specified values.

Properties

expand all

Unless otherwise indicated, properties are nontunable, which means you cannot change their values after calling the object. Objects lock when you call them, and the release function unlocks them.

If a property is tunable, you can change its value at any time.

For more information on changing property values, see System Design in MATLAB Using System Objects (MATLAB).

Specify the largest amplitude represented in the encoded input as a nonnegative numeric scalar. To correctly decode values encoded with the dsp.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 page.

Data Types: single | double | int8 | int16 | int32 | int64 | uint8 | uint16 | uint32 | uint64

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 dsp.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 page.

Data Types: single | double | int8 | int16 | int32 | int64 | uint8 | uint16 | uint32 | uint64

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.

Data type of the output, specified as 'single' or 'double'.

Usage

For versions earlier than R2016b, use the step function to run the System object algorithm. The arguments to step are the object you created, followed by the arguments shown in this section.

For example, y = step(obj,x) and y = obj(x) perform equivalent operations.

Syntax

Y = ud(X)

Description

example

Y = ud(X) reconstructs quantized floating-point output Y from the encoded integer input X.

Input Arguments

expand all

Encoded integer input, specified as a vector or a matrix.

Data Types: int8 | int16 | int32 | uint8 | uint16 | uint32
Complex Number Support: Yes

Output Arguments

expand all

Decoded floating-point output, returned as a vector or a matrix. The data type of the output is determined by the OutputDataType property.

Data Types: single | double
Complex Number Support: Yes

Object Functions

To use an object function, specify the System object as the first input argument. For example, to release system resources of a System object named obj, use this syntax:

release(obj)

expand all

stepRun System object algorithm
releaseRelease resources and allow changes to System object property values and input characteristics
resetReset internal states of System object

Examples

expand all

Note: If you are using R2016a or an earlier release, replace each call to the object with the equivalent step syntax. For example, obj(x) becomes step(obj,x).

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

Check that the last element has been saturated.

x_decoded = ud(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.

See Also

System Objects

Introduced in R2012a