<< udecode | FOSSEE_Signal_Processing_Toolbox | unshiftdata >>

FOSSEE_Signal_Processing_Toolbox >> FOSSEE_Signal_Processing_Toolbox > uencode

# uencode

Performs uniform quantization of the input into 2^n levels

### Syntax

    y=uencode(u,n,v,'signflag')

### Parameters

u :

  A vector, matrix or n-dimensional array

n :

  An integer between 2 and 32

v :

  A positive real scalar

'signflag' :

  A string which can take only 2 values 'signed' or 'unsigned'

### Description

Uniformly quantizes the input vector or n-dimensional array u into 2^n levels in the interval [-v,v] If v is not specified, its default value is 1 'signflag' is a string that determines the nature of the quantization If signflag='unsigned' then y contains unsigned integers in the range [0,2^n-1] corresponding to the 2^n levels If signflag='unsigned' then y contains signed integers in the range [-2^(n-1),2^(n-1)-1] corresponding to the 2^n levels The size of the integers in y in bits(8,16, or 32) depends on the value of n If the input lies beyond +/- v it is saturated

### Examples

    y=uencode(-1:0.5:1,3)

### Authors

- Ankur Mallick

### Bibliography

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

### See also

- udecode — Decodes the input uniformly quantized values
- floor

Report an issue
<< udecode | FOSSEE_Signal_Processing_Toolbox | unshiftdata >>