algorithm - Need help completing unfinished implementation of FFT bit reversal in Java -
i'm taking on code meant run fft algorithm on images. fft implementation incomplete , contains following segment:
public complex[] dofft(complex[] data, int size){ complex[] temp = new complex[size]; int j=0; int k; for(int i=0; i<size;i++){ temp[i] = data[j]; while((j>=k) && (k>0)){ k /=2; } j+=k; } ... }
where data
1d input array of complex numbers, size length of data
, temp
output array after of fft algorithm completed. particular block supposed 'bit reversal' step of algorithm.
i've never seen bit reversal done way. k
not initialized , have no idea author trying it. i've tried tracing k = 0
, k = size
, , k = size/2
, none seems give output i'm looking for.
can decipher author trying here or suggest better implementation?
Comments
Post a Comment