Quantcast
Channel: Math.NET Numerics
Viewing all articles
Browse latest Browse all 971

New Post: Numerics FFT result interpretation

$
0
0
I am new to Math .net numerics and still trying to understand the FFT library. Based on the some examples, I've written following code:
            Complex[] samples = new Complex[1000];
            double[] s =  Generate.Sinusoidal(1000, 2000.0, 200.0, 10.0);
            for (int i = 0; i < 1000; i++)
                samples[i] = new Complex (s[i],0);

            for (int i = 0; i < samples.Length; i++)
            {
                chart1.Series["Series1"].Points.AddXY
                        (i,samples[i].Real);

            }
            Fourier.Forward(samples,FourierOptions.Matlab);

            for (int i = 0; i < samples.Length; i++)
            {
                chart2.Series["Series1"].Points.AddXY
                        (i, samples[i].Real);

            }
Image

based on my understanding of FFT, i should get impulse at 200Hz and frequency resolution should be fs/N.
But the peak is coming at 900th sample, which i'm not sure pointing to 200Hz. If my interpretation is correct?
Any help would be appreciated. Thanks in advance.

Viewing all articles
Browse latest Browse all 971

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>