public static IEnumerable <Complex[]> Forward(IList <double> data, int window, int step, Action <double> progress) { var total = 0; for (int i = 0; i < data.Count - window + 1; i += step) { total++; } var count = 0; for (int i = 0; i < data.Count - window + 1; i += step) { var w = new double[window]; for (int j = 0; j < window; j++) { w[j] = data[i + j]; } var cur = Fft.Forward(w); count++; progress(100.0 * count / total); yield return(PackSpectra(cur, window)); } }
public static void BackOneWindow(double[] data, double[] mask, Complex[] sp, int window, int position) { Fill(data, mask, Fft.Back(UnpackSpectra(sp, window)), position); }