예제 #1
0
        public override float[] FFTForward(float[] signal, int startIndex, int length)
        {
            IntPtr input   = GetInput(length);
            IntPtr output  = GetOutput(length);
            IntPtr fftPlan = GetFFTPlan(length, input, output);

            float[] applyTo = new float[length];
            Array.Copy(signal, startIndex, applyTo, 0, length);
            Marshal.Copy(applyTo, 0, input, length);
            FFTWNativeMethods.execute(fftPlan);
            float[] result = new float[length * 2];
            Marshal.Copy(output, result, 0, length);
            FreeUnmanagedMemory(input);
            FreeUnmanagedMemory(output);
            FreePlan(fftPlan);
            return(result);
        }
예제 #2
0
 public override void Execute(IntPtr fftPlan)
 {
     FFTWNativeMethods.execute(fftPlan);
 }