bitrevorder | R Documentation |
Reorder the elements of the input vector in bit-reversed order.
bitrevorder(x, index.return = FALSE)
x |
input data, specified as a vector. The length of |
index.return |
logical indicating if the ordering index vector should be
returned as well. Default: |
This function is equivalent to calling digitrevorder(x, 2)
, and is
useful for prearranging filter coefficients so that bit-reversed ordering
does not have to be performed as part of an fft or ifft computation.
The bit-reversed input vector. If index.return = TRUE
, then
a list containing the bit-reversed input vector (y
), and the
digit-reversed indices (i
).
Mike Miller.
Port to to by Geert van Boxtel, G.J.M.vanBoxtel@gmail.com.
digitrevorder
, fft
, ifft
x <- 0:15
v <- bitrevorder(x)
dec2bin <- function(x, l)
substr(paste(as.integer(rev(intToBits(x))), collapse = ""),
32 - l + 1, 32)
x_bin <- sapply(x, dec2bin, 4)
v_bin <- sapply(v, dec2bin, 4)
data.frame(x, x_bin, v, v_bin)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.