/// <summary> /// perform inverse fft /// </summary> /// <param name="data">data from perform_fft</param> /// <returns>restored data</returns> public static double[] perform_ifft(Complex[] data) { int len = (data.Length - 1) * 2; double[] temp_re = new double[data.Length]; double[] temp_im = new double[data.Length]; double[] output = new double[len]; for (int i = 0; i < data.Length; i++) { temp_re[i] = data[i].Real; temp_im[i] = data[i].Imaginary; } int res = DataHandlerLibrary.perform_ifft(temp_re, temp_im, len, output); if (res != (int)CustomExitCodes.STATUS_OK) { throw new BrainFlowException(res); } return(output); }