Exemple #1
0
        private static byte[] ComputeFFT(double[] fftRealInput, int sampleFrequency)
        {
            double[] fftRealOutput      = new double[fftRealInput.Length];
            double[] fftImaginaryOutput = new double[fftRealInput.Length];
            double[] fftAmplitude       = new double[fftRealInput.Length];

            FourierTransform.Compute(
                1024,
                fftRealInput,
                null,
                fftRealOutput,
                fftImaginaryOutput,
                false);

            FourierTransform.Norm(1024, fftRealOutput, fftImaginaryOutput, fftAmplitude);
            return(FourierTransform.GetPeaks(fftAmplitude, null, sampleFrequency));
        }