udecode - Decode 2n-level quantized integer inputs to floating-point outputs

Syntax

y = udecode(u,n)
y = udecode(u,n,v)
y = udecode(u,n,v,'SaturateMode')

Description

y = udecode(u,n) inverts the operation of uencode and reconstructs quantized floating-point values from an encoded multidimensional array of integers u. The input argument n must be an integer between 2 and 32. The integer n specifies that there are 2n quantization levels for the inputs, so that entries in u must be either:

Inputs can be real or complex values of any integer data type (uint8, uint16, uint32, int8, int16, int32). Overflows (entries in u outside of the ranges specified above) are saturated to the endpoints of the range interval. The output y has the same dimensions as u. Its entries have values in the range [-1,1].

y = udecode(u,n,v) decodes u such that the output y has values in the range [-v,v], where the default value for v is 1.

y = udecode(u,n,v,'SaturateMode') decodes u and treats input overflows (entries in u outside of [-v,v]) according to the string 'saturatemode', which can be one of the following:

Examples

% Create signed 8-bit integer string
u = int8([-1 1 2 -5]);   
% Decode with 3 bits
ysat = udecode(u,3)      
ysat =
   -0.2500    0.2500    0.5000   -1.0000

Notice the last entry in u saturates to 1, the default peak input magnitude. Change the peak input magnitude:

ysatv = udecode(u,3,6)   % Set peak input magnitude to 6
ysatv =
   -1.5000    1.5000    3.0000   -6.0000

The last input entry still saturates. Try wrapping the overflows:

ywrap = udecode(u,3,6,'wrap')
ywrap =
   -1.5000    1.5000    3.0000    4.5000

Try adding more quantization levels:

yprec = udecode(u,5)
yprec =
   -0.0625    0.0625    0.1250   -0.3125

Algorithm

The algorithm adheres to the definition for uniform decoding specified in ITU-T Recommendation G.701. Integer input values are uniquely mapped (decoded) from one of 2n uniformly spaced integer values to quantized floating-point values in the range [-v,v]. The smallest integer input value allowed is mapped to -v and the largest integer input value allowed is mapped to v. Values outside of the allowable input range are either saturated or wrapped, according to specification.

The real and imaginary components of complex inputs are decoded independently.

References

[1] General Aspects of Digital Transmission Systems: Vocabulary of Digital Transmission and Multiplexing, and Pulse Code Modulation (PCM) Terms, International Telecommunication Union, ITU-T Recommendation G.701, March, 1993.

See Also

uencode

  


 © 1984-2008- The MathWorks, Inc.    -   Site Help   -   Patents   -   Trademarks   -   Privacy Policy   -   Preventing Piracy   -   RSS