PIC32 FFT accuracy

Discussion in 'Embedded Systems and Microcontrollers' started by kasula4, Apr 20, 2010.

  1. kasula4

    Thread Starter New Member

    Apr 9, 2010
    4
    0
    Hello,
    I am implementing 4096 point FFT using mips_16fft function in the DSP library. I am sampling at 10 KHz. When I send 3KHz I read the FFT value as 2.987KHz. Does any body have idea about the accuracy of the FFT function in the DSP library.

    Thanks
     
  2. t06afre

    AAC Fanatic!

    May 11, 2009
    5,939
    1,222
    Then you do a FFT you split the signal into frequency bins. Each bin will have a width equal to Fsample/N (N=number of samples). So in your case the first bin will go from DC and up to(but not included) 2.44140625 Hz. And so on. Then I simulated your setup. I ended up with the peak in bin number 1229, or approx 3000.448 Hz. Here is some more info http://zone.ni.com/devzone/cda/tut/p/id/4278 also take a look at the topic Spectral Leakage
     
    Last edited: Apr 21, 2010
  3. kasula4

    Thread Starter New Member

    Apr 9, 2010
    4
    0
    Thanks for the reply. I do not see any spectral leakage in the signal because I see only one peak value and all adjacent bins are really low.
     
  4. t06afre

    AAC Fanatic!

    May 11, 2009
    5,939
    1,222
    In order for you to have none spectral leakage. In your case, the frequency you are measuring must be in an exact multiple order of 10000/4096. I think you are not using dB scale on the magnitude axis. You should always scale your magnitude axises in dB then working with spectrum analysis
     
Loading...