Learn R Programming

gsignal (version 0.3-7)

digitrevorder: Permute input to digit-reversed order

Description

Reorder the elements of the input vector in digit-reversed order.

Usage

digitrevorder(x, r, index.return = FALSE)

Value

The digit-reversed input vector. If index.return = TRUE, then a list containing the digit-reversed input vector (y, and the digit-reversed indices (i).

Arguments

x

input data, specified as a vector. The length of x must be an integer power of r.

r

radix base used for the number conversion, which can be any integer from 2 to 36. The elements of x are converted to radix r and reversed.

index.return

logical indicating if the ordering index vector should be returned as well. Default FALSE.

Author

Mike Miller.
Conversion to R by Geert van Boxtel, G.J.M.vanBoxtel@gmail.com.

Details

This function is useful for pre-ordering 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.

See Also

bitrevorder, fft, ifft

Examples

Run this code

res <- digitrevorder(0:8, 3)

Run the code above in your browser using DataLab