| Signal Processing Toolbox | ![]() |
Permute input into digit-reversed order
Syntax
Description
digitrevorder is useful for preordering a vector of filter coefficients for use in frequency-domain filtering algorithms, in which the fft and ifft transforms are computed without digit-reversed ordering for improved run-time efficiency.
y = digitrevorder(x,r)
returns the input data in digit-reversed order in vector or matrix y. The digit-reversal is computed using the number system base (radix base) r, which can be any integer from 2 to 36. The length of x must be an integer power of r. If x is a matrix, the digit reversal occurs on the first dimension of x with size greater than 1. y is the same size as x.
[y,i] = digitrevorder(x,r)
returns the digit-reversed vector or matrix y and the digit-reversed indices i, such that y = x(i). Recall that MATLAB uses 1-based indexing, so the first index of y will be 1, not 0.
The following table shows the numbers 0 through 15, the corresponding digits and the digit-reversed numbers using radix base-4. The corresponding radix base-2 bits and bit-reversed indices are also shown
Examples
Obtain the digit-reversed, radix base-3 ordered output of a vector containing 9 values:
See Also
| dftmtx | diric | ![]() |
© 1994-2005 The MathWorks, Inc.