Exemplo n.º 1
0
        private static int GetDftExponent(int N, int V, int Idx, bool Even)
        {
            // take bits n-v..n-1 of idx, reverse them, shift left by n-v-1
            int x = IntUtils.URShift(IntUtils.ReverseInt(Idx) << (N - V), (31 - N));

            // if m is even, divide by two
            if (Even)
            {
                x = IntUtils.URShift(x, 1);
            }

            return(x);
        }
Exemplo n.º 2
0
        private static int GetIdftExponent(int N, int V, int Idx, bool Even)
        {
            int x = IntUtils.URShift(IntUtils.ReverseInt(Idx) << (N - V), (32 - N));

            if (Even)
            {
                x += (1 << (N - V));
            }
            else
            {
                x += (1 << (N - 1 - V));
            }

            return(x + 1);
        }