MCPcopy Create free account
hub / github.com/TheAlgorithms/Java / findLog2

Method findLog2

src/main/java/com/thealgorithms/maths/FFT.java:223–229  ·  view source on GitHub ↗
(int n)

Source from the content-addressed store, hash-verified

221
222 /* Find the log2(n) */
223 public static int findLog2(int n) {
224 int log2n = 0;
225 while ((1 << log2n) < n) {
226 log2n++;
227 }
228 return log2n;
229 }
230
231 /* Swap the values of the signal with bit-reversal method */
232 public static ArrayList<Complex> fftBitReversal(int n, int log2n, ArrayList<Complex> x) {

Callers 1

fftMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected