Filter Design Toolbox    
unitquantize

Quantize all numbers in a data set except numbers within eps of 1

Syntax

Description

unitquantize(q,...) works the same as quantize except that numbers within eps(q) of 1 are made exactly equal to 1 (see quantize for a description of the parameters).

This function is especially useful for quantizing fixed-point coefficients.

Examples

It appears that there are four elements that are exactly equal to 1. In fact, there are only three. Element m(2,3) is greater than realmax(q), but less than 1. Ordinarily, m(2,3) would be counted as an overflow and be set to realmax(q). However, the desired behavior would be to force m(2,3) to be equal to 1 without recording an overflow. This is what unitquantize does, as shown in the following example.

By forcing values between eps and 1 to be equal to 1, signal processing algorithms can avoid multiplication operations that involve these numbers, saving processing steps and time.

See Also
qfft, quantize


  twiddles unitquantizer 

Learn more about the latest releases of MathWorks products:

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