0

I had converted a 3gp file to bytes array, after transformed it in a complex class (add "0" in the imaginary part) and finally using the Foward Fourier function in this array. I need to descompose in waves frequencies through FFT. I used the Math.net library for C# (In Xamarin) but i don't know how use the Fourier function.

public Complex[] CalculoFFTComplejo(in string pathFile)
    {
        var bytes = File.ReadAllBytes(pathFile);
        var valoresFinales = TransformarComplejos(in bytes, bytes.Length);
        Fourier.Forward(valoresFinales, FourierOptions.Default);
        return valoresFinales;
    }
private Complex[] TransformarComplejos(in byte[] valores,in int tamanio)
    {
        var arregloComplejo = new Complex[tamanio];
        var indice = 0;
        foreach (var valor in valores)
        {
            arregloComplejo[indice] = new Complex(valor,0);
            indice++;
        }
        return arregloComplejo;
    }

and now, how do I analysis this result to separate in spectral graph?, How do I know which part of the array shows the results for the different wave frequencies?

  • I would use matlab and compile the matlab (create a dll) to do FFT (much better than c#). The call the dll from c#. – jdweng Oct 22 '19 at 15:17
  • this answer details how to parse the complex number to calculate the magnitude and phase ... you can then use this magnitude to plot your spectral graph ( freq axis and magnitude axis ) as you iterate across the array holding complex numbers each element of array is the next frequency with element 0 the frequency 0 which is your DC offset https://stackoverflow.com/questions/55698193/get-frequency-with-highest-amplitude-from-fft/55699449#55699449 – Scott Stensland Oct 22 '19 at 15:32

0 Answers0