Пример #1
0
        public static fftw_plan dft_many(eFFTType fftType, int rank, int[] n, int batch,
                                         IntPtr input, int[] inembed,
                                         int istride, int idist,
                                         IntPtr output, int[] onembed,
                                         int ostride, int odist,
                                         fftw_direction sign, fftw_flags flags)
        {
            fftw_plan p = new fftw_plan();

            if (fftType == eFFTType.Complex2Complex)
            {
                p._handle = fftw.many_dft(rank, n, batch, input, inembed, istride, idist, output, onembed, ostride, odist, sign, flags);
            }
            else if (fftType == eFFTType.Real2Complex)
            {
                p._handle = fftw.many_dft_r2c(rank, n, batch, input, inembed, istride, idist, output, onembed, ostride, odist, flags);
            }
            else if (fftType == eFFTType.Complex2Real)
            {
                p._handle = fftw.many_dft_c2r(rank, n, batch, input, inembed, istride, idist, output, onembed, ostride, odist, flags);
            }
            p.Input  = input;
            p.Output = output;
            return(p);
        }
Пример #2
0
        /// <summary>
        /// Creates plan..
        /// </summary>
        /// <param name="fftType">FFT type.</param>
        /// <param name="n">The n.</param>
        /// <param name="input">The input.</param>
        /// <param name="output">The output.</param>
        /// <param name="direction">The direction.</param>
        /// <param name="flags">The flags.</param>
        /// <returns></returns>
        public static fftw_plan dft_1d(eFFTType fftType, int n, IntPtr input, IntPtr output, fftw_direction direction, fftw_flags flags)
        {
            fftw_plan p = new fftw_plan();

            if (fftType == eFFTType.Complex2Complex)
            {
                p._handle = fftw.dft_1d(n, input, output, direction, flags);
            }
            else if (fftType == eFFTType.Real2Complex)
            {
                p._handle = fftw.dft_r2c_1d(n, input, output, flags);
            }
            else if (fftType == eFFTType.Complex2Real)
            {
                p._handle = fftw.dft_c2r_1d(n, input, output, flags);
            }
            p.Input  = input;
            p.Output = output;
            return(p);
        }
Пример #3
0
 /// <summary>
 /// DFT_3Ds the specified FFT type.
 /// </summary>
 /// <param name="fftType">Type of the FFT.</param>
 /// <param name="nx">The nx.</param>
 /// <param name="ny">The ny.</param>
 /// <param name="nz">The nz.</param>
 /// <param name="input">The input.</param>
 /// <param name="output">The output.</param>
 /// <param name="direction">The direction.</param>
 /// <param name="flags">The flags.</param>
 /// <returns></returns>
 public static fftw_plan dft_3d(eFFTType fftType, int nx, int ny, int nz, IntPtr input, IntPtr output, fftw_direction direction, fftw_flags flags)
 {
     fftw_plan p = new fftw_plan();
     // p._handle = fftwf.dft_3d(nx, ny, nz, input, output, direction, flags);
     if (fftType == eFFTType.Complex2Complex)
         p._handle = fftw.dft_3d(nx, ny, nz, input, output, direction, flags);
     else if (fftType == eFFTType.Real2Complex)
         p._handle = fftw.dft_r2c_3d(nx, ny, nz, input, output, flags);
     else if (fftType == eFFTType.Complex2Real)
         p._handle = fftw.dft_c2r_3d(nx, ny, nz, input, output, flags);
     p.Input = input;
     p.Output = output;
     return p;
 }
Пример #4
0
 public static fftw_plan dft_many(eFFTType fftType, int rank, int[] n, int batch,
                   IntPtr input, int[] inembed,
                   int istride, int idist,
                   IntPtr output, int[] onembed,
                   int ostride, int odist,
                   fftw_direction sign, fftw_flags flags)
 {
     fftw_plan p = new fftw_plan();
     if (fftType == eFFTType.Complex2Complex)
         p._handle = fftw.many_dft(rank, n, batch, input, inembed, istride, idist, output, onembed, ostride, odist, sign, flags);
     else if (fftType == eFFTType.Real2Complex)
         p._handle = fftw.many_dft_r2c(rank, n, batch, input, inembed, istride, idist, output, onembed, ostride, odist, flags);
     else if (fftType == eFFTType.Complex2Real)
         p._handle = fftw.many_dft_c2r(rank, n, batch, input, inembed, istride, idist, output, onembed, ostride, odist, flags);
     p.Input = input;
     p.Output = output;
     return p;
 }