public FourierSeries(IEnumerable<double> samples) { _complexes = samples.Select(x => new Complex(x, 0)) .ToArray(); var dft = new MathNet.Numerics.IntegralTransforms.Algorithms.DiscreteFourierTransform(); dft.BluesteinForward(_complexes, FourierOptions.NoScaling); }
/// <summary> /// Perform a FFT using Bluestein's algorithm /// </summary> /// <param name="input">Array of complex numbers</param> /// <returns></returns> public Complex[] FFT(Complex[] input) { Complex[] output = new Complex[input.Length]; Array.Copy(input, output, input.Length); var transform = new MN.Algorithms.DiscreteFourierTransform(); transform.BluesteinForward(output, MN.FourierOptions.Matlab); return output; }