bitrevorder
Permute data into bit-reversed order
Description
Examples
Vector in Bit-Reversed Order
Create a column vector and obtain its bit-reversed version. Verify by displaying the binary representation explicitly.
x = (0:15)'; v = bitrevorder(x); x_bin = dec2bin(x); v_bin = dec2bin(v); T = table(x,x_bin,v,v_bin)
T=16×4 table
x x_bin v v_bin
__ _____ __ _____
0 0000 0 0000
1 0001 8 1000
2 0010 4 0100
3 0011 12 1100
4 0100 2 0010
5 0101 10 1010
6 0110 6 0110
7 0111 14 1110
8 1000 1 0001
9 1001 9 1001
10 1010 5 0101
11 1011 13 1101
12 1100 3 0011
13 1101 11 1011
14 1110 7 0111
15 1111 15 1111
Input Arguments
x
— Input data
vector | matrix
Input data, specified as a vector or matrix. The length or number of rows of
x
must be an integer power of 2. If x
is a
matrix, the bit-reversal occurs on the first dimension of x
with
size greater than 1.
Data Types: single
| double
Complex Number Support: Yes
Output Arguments
y
— Bit-reversed data
vector | matrix
Bit-reversed data, returned as a vector or matrix. y
is the
same size as x
.
i
— Bit-reversed indices
vector | matrix
Bit-reversed indices, returned as a vector or matrix such that y =
x(i)
. MATLAB® matrices use 1-based indexing, so the first index of
y
is 1, not 0.
More About
Bit-Reversed Ordering
bitrevorder
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.
Bit-reversed ordering can improve run-time efficiency for external applications or for
Simulink® blockset models. Both MATLAB
fft
and ifft
functions process linear input and output.
Note
Using bitrevorder
is equivalent to using digitrevorder
with radix base 2.
This table shows the numbers 0 through 7, the corresponding bits, and the bit-reversed numbers.
Linear Index | Bits | Bit-Reversed | Bit-Reversed Index |
---|---|---|---|
0 | 000 | 000 | 0 |
1 | 001 | 100 | 4 |
2 | 010 | 010 | 2 |
3 | 011 | 110 | 6 |
4 | 100 | 001 | 1 |
5 | 101 | 101 | 5 |
6 | 110 | 011 | 3 |
7 | 111 | 111 | 7 |
Extended Capabilities
C/C++ Code Generation
Generate C and C++ code using MATLAB® Coder™.
GPU Code Generation
Generate CUDA® code for NVIDIA® GPUs using GPU Coder™.
GPU Arrays
Accelerate code by running on a graphics processing unit (GPU) using Parallel Computing Toolbox™.
This function fully supports GPU arrays. For more information, see Run MATLAB Functions on a GPU (Parallel Computing Toolbox).
Version History
Introduced before R2006a
See Also
fft
| digitrevorder
| ifft
MATLAB Command
You clicked a link that corresponds to this MATLAB command:
Run the command by entering it in the MATLAB Command Window. Web browsers do not support MATLAB commands.
Select a Web Site
Choose a web site to get translated content where available and see local events and offers. Based on your location, we recommend that you select: .
You can also select a web site from the following list
How to Get Best Site Performance
Select the China site (in Chinese or English) for best site performance. Other MathWorks country sites are not optimized for visits from your location.
Americas
- América Latina (Español)
- Canada (English)
- United States (English)
Europe
- Belgium (English)
- Denmark (English)
- Deutschland (Deutsch)
- España (Español)
- Finland (English)
- France (Français)
- Ireland (English)
- Italia (Italiano)
- Luxembourg (English)
- Netherlands (English)
- Norway (English)
- Österreich (Deutsch)
- Portugal (English)
- Sweden (English)
- Switzerland
- United Kingdom (English)
Asia Pacific
- Australia (English)
- India (English)
- New Zealand (English)
- 中国
- 日本Japanese (日本語)
- 한국Korean (한국어)