Ejemplo n.º 1
0
        /// <summary>
        /// FFT:
        /// fft(wave1->wave2) = fft(wave1->0) + fft(wave2->0)
        /// fft(wave1->wave2) = fft(wave1->0) + fft(0->wave2)
        /// fft(wave1+wave2) = fft(wave1) + fft(wave2)
        /// fft(wave1->wave2) = 0.5 * fft(wave1) + 0.5 * fft(wave2) @ matlab FFT
        /// </summary>
        public ComplexD[] FftForwardD(ComplexD[] input)
        {
            if (IsUseCudafy)
            {
                var fftD = this.FftForwardJustD(input);
                if (fftD != null)
                {
                    return(fftD);
                }
            }

            var result = CtkNumConverter.ToSysComplex(input);

            MathNet.Numerics.IntegralTransforms.Fourier.Forward(result);
            return(CtkNumConverter.ToCudafy(result));
        }
Ejemplo n.º 2
0
        public Complex[] FftForward(Complex[] input)
        {
            if (IsUseCudafy)
            {
                var fftD = this.FftForwardJustD(CtkNumConverter.ToCudafy(input));
                if (fftD != null)
                {
                    return(CtkNumConverter.ToSysComplex(fftD));
                }
            }


            var result = new Complex[input.Length];

            Array.Copy(input, result, input.Length);
            MathNet.Numerics.IntegralTransforms.Fourier.Forward(result
                                                                , MathNet.Numerics.IntegralTransforms.FourierOptions.Matlab);
            return(result);
        }
Ejemplo n.º 3
0
 public ComplexD[] FftForwardD(IEnumerable <Complex> input)
 {
     return(FftForwardD(CtkNumConverter.ToCudafy(input)));
 }