Пример #1
0
        protected void kf_bfly3(Array <kiss_fft_cpx <kiss_fft_scalar> > Fout, int fstride, int m)
        {
            int k = m;
            int m2 = 2 * m;
            Array <kiss_fft_cpx <kiss_fft_scalar> > tw1, tw2;

            kiss_fft_cpx <kiss_fft_scalar>[] scratch = new kiss_fft_cpx <kiss_fft_scalar> [5];
            kiss_fft_cpx <kiss_fft_scalar>   epi3;

            epi3 = Twiddles[fstride * m];

            tw1 = new Array <kiss_fft_cpx <kiss_fft_scalar> >(Twiddles);
            tw2 = new Array <kiss_fft_cpx <kiss_fft_scalar> >(Twiddles);

            do
            {
                Fout[0]  = A.FixDivide(Fout[0], 3);
                Fout[m]  = A.FixDivide(Fout[m], 3);
                Fout[m2] = A.FixDivide(Fout[m2], 3);

                scratch[1] = A.Multiply(Fout[m], tw1[0]);
                scratch[2] = A.Multiply(Fout[m2], tw2[0]);

                scratch[3] = A.Add(scratch[1], scratch[2]);
                scratch[0] = A.Subtract(scratch[1], scratch[2]);
                tw1       += fstride;
                tw2       += fstride * 2;

                Fout[m].r = A.Subtract(Fout[0].r, A.Half(scratch[3].r));
                Fout[m].i = A.Subtract(Fout[0].i, A.Half(scratch[3].i));

                scratch[0] = A.Multiply(scratch[0], epi3.i);

                Fout[0] = A.Add(Fout[0], scratch[3]);

                Fout[m2].r = A.Add(Fout[m].r, scratch[0].i);
                Fout[m2].i = A.Subtract(Fout[m].i, scratch[0].r);

                Fout[m].r = A.Subtract(Fout[m].r, scratch[0].i);
                Fout[m].i = A.Add(Fout[m].i, scratch[0].r);

                ++Fout;
            } while (--k != 0);
        }