Main Content

dsp.UniformDecoder

(Removed) Decode integer input into floating-point output

dsp.UniformDecoder has been removed. Use udecode instead. For more information, see Compatibility Considerations.

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?

Creation

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.

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

Syntax

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

collapse all

ue = dsp.UniformEncoder('PeakValue',2,'NumBits',4,...
                        'OutputDataType','Signed integer');
x = (0:0.25:2)'; % Create an input sequence
ud = dsp.UniformDecoder('PeakValue',2,'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.

Version History

Introduced in R2012a

expand all

R2023a: dsp.UniformDecoder System object has been removed

The dsp.UniformDecoder System object has been removed. Use the udecode function instead.

Update Code

This table shows how to update existing code to use the udecode function.

Discouraged UsageRecommended Replacement

Encode a sequence

ue = dsp.UniformEncoder(PeakValue=2,NumBits=4,...
                        OutputDataType='Signed integer');
x = (0:0.25:2)';
x_encoded = ue(x);

Decode the encoded sequence

ud = dsp.UniformDecoder(PeakValue=2,NumBits=4);
x_decoded = ud(x_encoded);

Encode a sequence

% Number of bits is 4, and peak value is 2.
x_encodedFn = uencode(x,4,2,'signed');

Decode the encoded sequence

x_decodedFn = udecode(x_encodedFn,4,2);

See Also