|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.apfloat.internal.Scramble
public class Scramble
Functions to perform bit-reverse ordering of data.
| Method Summary | |
|---|---|
static int[] |
createScrambleTable(int length)
Create a table of indexes for scrambling an array for FFT. |
static int |
permute(int n,
int length)
Permute the bits of a number to reverse order. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Method Detail |
|---|
public static int permute(int n,
int length)
For example, if n is 5 and the transform
length is 256, the permutation is (in binary)
00000101 → 10100000
n - The number whose bits to reverse.length - The FFT transform length for which the bit reversal to perform.
n reversed.public static int[] createScrambleTable(int length)
The returned table contains pairs of indexes that should be swapped
to scramble an array. For example, for transform length 8 the
returned table contains { 1, 4, 3, 6 } to indicate
that the array elements [1] and [4] should be swapped, and the elements
[3] and [6] should be swapped.
length - The FFT transform length for which the scrambling table is created.
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||