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);
            // is this also neccesary?? (other lock are it seems!)
            lock (lockObject)
            {
                FFTWFNativeMethods.execute(fftPlan);
            }
            float[] result = new float[length * 2];
            Marshal.Copy(output, result, 0, length * 2);
            FreeUnmanagedMemory(input);
            FreeUnmanagedMemory(output);
            FreePlan(fftPlan);
            return(result);
        }
 public override void Execute(IntPtr fftPlan)
 {
     FFTWFNativeMethods.execute(fftPlan);
 }