digitrevorder: Permute input to digit-reversed order

View source: R/digitrevorder.R

digitrevorderR Documentation

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)

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.

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.

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).

Author(s)

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

See Also

bitrevorder, fft, ifft

Examples


res <- digitrevorder(0:8, 3)


gsignal documentation built on Sept. 12, 2024, 6:27 a.m.