예제 #1
0
        /// <summary>
        /// Transforms the specified input.
        /// </summary>
        /// <param name="input">The input.</param>
        /// <param name="type">The type.</param>
        /// <returns></returns>
        public static Complexf[] Transform([PowerOfTwoArray] Complexf[] input, FurierTransformType type)
        {
            Complexf[] result = new Complexf[input.Length];
            input.CopyTo(result, 0);

            TransformInPlace(result, type);
            return(result);
        }
예제 #2
0
        /// <summary>
        /// Transforms the specified input.
        /// </summary>
        /// <param name="input">The input.</param>
        /// <param name="type">The type.</param>
        /// <returns></returns>
        public static Complexf[] Transform([PowerOfTwoArray] float[] input, FurierTransformType type)
        {
            Complexf[] result = new Complexf[input.Length];
            for (int i = 0; i < input.Length; i++)
            {
                result[i] = new Complexf(input[i], 0.0f);
            }


            TransformInPlace(result, type);
            return(result);
        }
예제 #3
0
        /// <summary>
        /// Transforms the data in place.
        /// </summary>
        /// <param name="data">The data.</param>
        /// <param name="type">The type.</param>
        public static void TransformInPlace([PowerOfTwoArray] Complexf[] data, FurierTransformType type)
        {
            // We do a complex Furier transform.
            if (data.Rank == 1)
            {
                InternalFFT(data, type == FurierTransformType.Normal ? true : false);
            }
            else
            {
                // Multidimensional
                throw new NotSupportedException();
            }

            if (type == FurierTransformType.Inverse)
            {
                Rescale(data);
            }
            return;
        }