예제 #1
0
 private static void ValidateSign(FftwSign sign)
 {
     if (sign != FftwSign.FFTW_FORWARD && sign != FftwSign.FFTW_BACKWARD)
     {
         throw new ArgumentException($"Sign is not one of FFTW_FORWARD, FFTW_BACKWARD", nameof(sign));
     }
 }
예제 #2
0
        public static FftwPlan Dft(int[] n, out FftwArray inArray, out FftwArray outArray,
                                   FftwSign sign = FftwSign.FFTW_FORWARD, FftwFlags flags = FftwFlags.FFTW_MEASURE)
        {
            int length = DftLength(n);

            inArray  = new FftwArray(length);
            outArray = new FftwArray(length);
            return(Dft(n, inArray, outArray, sign, flags));
        }
예제 #3
0
        public static FftwPlan Dft(int[] n, FftwArray inArray, FftwArray outArray,
                                   FftwSign sign = FftwSign.FFTW_FORWARD, FftwFlags flags = FftwFlags.FFTW_MEASURE)
        {
            int length = DftLength(n);

            ValidateSign(sign);
            ValidateArray(inArray, length, nameof(inArray));
            ValidateArray(outArray, length, nameof(outArray));
            return(new FftwPlan(flags,
                                fftw_plan_dft(n.Length, n,
                                              inArray.Pointer, outArray.Pointer,
                                              (int_t)sign, (uint_t)flags),
                                inArray, outArray));
        }
예제 #4
0
 public static FftwPlan Dft(int[] n, out FftwArray ioArray,
                            FftwSign sign = FftwSign.FFTW_FORWARD, FftwFlags flags = FftwFlags.FFTW_MEASURE)
 {
     ioArray = new FftwArray(DftLength(n));
     return(Dft(n, ioArray, ioArray, sign, flags));
 }
예제 #5
0
 public static FftwPlan Dft3D(int n0, int n1, int n2, out FftwArray ioArray,
                              FftwSign sign = FftwSign.FFTW_FORWARD, FftwFlags flags = FftwFlags.FFTW_MEASURE)
 {
     ioArray = new FftwArray(DftLength(n0, n1, n2));
     return(Dft3D(n0, n1, n2, ioArray, ioArray, sign, flags));
 }