cadencii.fft.cfttree C# (CSharp) Method

cfttree() static private method

static private cfttree ( int n, int j, int k, double a, int nw, double w ) : int
n int
j int
k int
a double
nw int
w double
return int
        static int cfttree( int n, int j, int k, double* a, int nw, double* w ) {
            //void cftmdl1(int n, double *a, double *w);
            //void cftmdl2(int n, double *a, double *w);
            int i, isplt, m;

            if ( (k & 3) != 0 ) {
                isplt = k & 1;
                if ( isplt != 0 ) {
                    cftmdl1( n, &a[j - n], &w[nw - (n >> 1)] );
                } else {
                    cftmdl2( n, &a[j - n], &w[nw - n] );
                }
            } else {
                m = n;
                for ( i = k; (i & 3) == 0; i >>= 2 ) {
                    m <<= 2;
                }
                isplt = i & 1;
                if ( isplt != 0 ) {
                    while ( m > 128 ) {
                        cftmdl1( m, &a[j - m], &w[nw - (m >> 1)] );
                        m >>= 2;
                    }
                } else {
                    while ( m > 128 ) {
                        cftmdl2( m, &a[j - m], &w[nw - m] );
                        m >>= 2;
                    }
                }
            }
            return isplt;
        }