private void prepareFFTTables ( ) { int n2 = ss2 ; int nu1 = nu - 1 ; int k = 0 ; int x = 0 ; for ( int l = 1 ; l <= nu ; l ++ ) { while ( k < ss ) { for ( int i = 1 ; i <= n2 ; i ++ ) { double p = ( double ) bitrev ( k >> nu1 , nu ) ; double arg = ( Math . PI * p * 2.0D ) / ( double ) ss ; fftSin [ x ] = ( long ) ( Math . sin ( arg ) * FRAC_FAC ) ; fftCos [ x ] = ( long ) ( Math . cos ( arg ) * FRAC_FAC ) ; k ++ ; x ++ ; } k += n2 ; } k = 0 ; nu1 -- ; n2 >>= 1 ; } for ( k = 0 ; k < ss ; k ++ ) fftBr [ k ] = bitrev ( k , nu ) ; }
We will here precalculate all sin and cos values and all other things we can store