Transform() public method

Computes the Fourier transform of the given series.
public Transform ( IList values ) : ScalarValue[]
values IList The series to transform.
return ScalarValue[]
コード例 #1
0
        public BluesteinTransformlet(int R, int N, ScalarValue[] u)
            : base(R, N, u)
        {
            // figure out the right Bluestein length and create a transformer for it
            Nb = SetBluesteinLength(2 * R - 1);
            ft = new Fourier(Nb);

            // compute the Bluestein coeffcients and compute the FT of the filter based on them
            b = ComputeBluesteinCoefficients(R);
            var c = new ScalarValue[Nb];

            c[0] = ScalarValue.One;

            for (int i = 1; i < R; i++)
            {
                c[i]      = b[i].Conjugate();
                c[Nb - i] = c[i];
            }

            for (int i = R; i <= Nb - R; i++)
            {
                c[i] = ScalarValue.Zero;
            }

            bt = ft.Transform(c);
        }
コード例 #2
0
        public override void FftKernel(ScalarValue[] x, ScalarValue[] y, int y0, int dy, int sign)
        {
            // create c = b x and transform it into Fourier space
            var c = new ScalarValue[Nb];

            if (sign > 0)
            {
                for (int i = 0; i < R; i++)
                {
                    c[i] = b[i] * x[i];
                }
            }
            else
            {
                for (int i = 0; i < R; i++)
                {
                    c[i] = b[i] * x[i].Conjugate();
                }
            }

            for (int i = R; i < c.Length; i++)
            {
                c[i] = ScalarValue.Zero;
            }

            var ct = ft.Transform(c);

            // multiply b-star and c = b x in Fourier space, and inverse transform the product back into configuration space
            for (int i = 0; i < Nb; i++)
            {
                ct[i] = ct[i] * bt[i];
            }

            c = ft.InverseTransform(ct);

            // read off the result
            if (sign > 0)
            {
                for (int i = 0; i < R; i++)
                {
                    y[y0 + i * dy] = b[i] * c[i];
                }
            }
            else
            {
                for (int i = 0; i < R; i++)
                {
                    y[y0 + i * dy] = b[i].Conjugate() * c[i].Conjugate();
                }
            }
        }
コード例 #3
0
        public BluesteinTransformlet(int R, int N, ScalarValue[] u)
            : base(R, N, u)
        {
            // figure out the right Bluestein length and create a transformer for it
            Nb = SetBluesteinLength(2 * R - 1);
            ft = new Fourier(Nb);

            // compute the Bluestein coeffcients and compute the FT of the filter based on them
            b = ComputeBluesteinCoefficients(R);
            var c = new ScalarValue[Nb];
            c[0] = ScalarValue.One;

            for (int i = 1; i < R; i++)
            {
                c[i] = b[i].Conjugate();
                c[Nb - i] = c[i];
            }

            for (int i = R; i <= Nb - R; i++)
                c[i] = ScalarValue.Zero;

            bt = ft.Transform(c);
        }
コード例 #4
0
ファイル: FFTFunction.cs プロジェクト: FlorianRappl/YAMP
        public MatrixValue Function(MatrixValue M)
        {
            var transpose = false;

            if (M.DimensionX > M.DimensionY)
            {
                transpose = true;
                M = M.Transpose();
            }

            var fft = new Fourier(M.DimensionY);

            for (var i = 1; i <= M.DimensionX; i++)
            {
                var values = new ScalarValue[M.DimensionY];

                for (var j = 1; j <= M.DimensionY; j++)
                {
                    values[j - 1] = M[j, i];
                }

                values = fft.Transform(values);

                for (var j = 1; j <= M.DimensionY; j++)
                {
                    M[j, i] = values[j - 1];
                }
            }

            if (transpose)
            {
                return M.Transpose();
            }

            return M;
        }