Ejemplo n.º 1
0
 public static double[] iFFT(double[] samplesReal, double[] samplesImag, int N = 1024)
 {
     FFT2 f = new FFT2();
     f.init((uint)(Math.Log(N) / Math.Log(2)));
     f.run(samplesReal, samplesImag, true);
     return samplesReal;
 }
Ejemplo n.º 2
0
 public static Complex[] FFT(this OpenSignalLib.Sources.Signal sig, int N = 1024)
 {
     Complex[] retval = new Complex[sig.Samples.Length];
     FFT2 f = new FFT2();
     f.init((uint)(Math.Log(N) / Math.Log(2)));
     double[] samRe = sig.Samples;
     double[] samIm = new double[samRe.Length];
     f.run(samRe, samIm);
     for (int i = 0 ; i < samRe.Length ; i++)
     {
         retval[i] = new Complex(samRe[i], samIm[i]);
     }
     return retval;
 }