udecode {gsignal}R Documentation

Uniform decoder

Description

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

Usage

udecode(u, n, v = 1, saturate = TRUE)

Arguments

u

Input, a multidimensional array of integer numbers (can be complex).

n

Number of levels used in 2^{n}-level quantization. n must be between 2 and 32

v

Limit on the range of u to the range from -v to v before saturating them. Default 1.

saturate

Logical indicating to saturate (TRUE, default) or to wrap (FALSE) overflows. See Details.

Details

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 2^{n} 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. Overflows (entries in u outside of the ranges specified above) are saturated to the endpoints of the range interval. The output has the same dimensions as the input u. Its entries have values in the range -1 to 1.

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

y <- udecode(u, n, v, saturate) decodes u and treats input overflows (entries in u outside of the range -v to v according to saturate, which can be set to one of the following:

Value

Multidimensional array of the same size as u containing floating point numbers.

Note

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

Author(s)

Georgios Ouzounis, ouzounis_georgios@hotmail.com.
Conversion to R by Geert van Boxtel, G.J.M.vanBoxtel@gmail.com.

Examples


u <- c(-1, 1, 2, -5)
ysat <- udecode(u, 3)

# Notice the last entry in u saturates to 1, the default peak input
# magnitude. Change the peak input magnitude to 6.
ysatv <- udecode(u, 3, 6)

# The last input entry still saturates. Wrap the overflows.
ywrap = udecode(u, 3, 6, FALSE)

# Add more quantization levels.
yprec <- udecode(u, 5)


[Package gsignal version 0.3-5 Index]