Esempio 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));
        }
Esempio 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);
        }
Esempio n. 3
0
 public ComplexD[] FftForwardD(IEnumerable <Complex> input)
 {
     return(FftForwardD(CtkNumConverter.ToCudafy(input)));
 }
Esempio n. 4
0
 public Complex[] FftForward(IEnumerable <double> input)
 {
     return(this.FftForward(CtkNumConverter.ToSysComplex(input)));
 }