cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Highlighted
Observer
Observer
477 Views
Registered: ‎06-30-2017

Unexpected FFT Result

Jump to solution

Hi,

I am simulating a 16-bit 40 kHz signal out of the XADC at 1 Msps.  I feed that into an FIR filter, then a fifo, and then a 1024 point FFT.  The imaginary input on the xfft is all zeros.  Finally, I put the FFT output into a CORDIC in translate mode.  

I get a nice looking FFT plot in the simulator, but the peak is not where I expect.  I am seeing more power in bin 43, but I would expect the peak to be in bin 41 or maybe 42.

What I get:       (1 Msps / 1024) * (43-1) = ~41 kHz

What I expect:    (1 Msps / 1024) * (41-1) = ~39 kHz

I'm not sure what is causing the different frequency in the FFT, does anybody have an idea of what I could check?  Or is this result expected?

I've attached a plot of the simulator, clock is 200 MHz.

Thanks.

 

Tags (1)
1024_fft.png
0 Kudos
1 Solution

Accepted Solutions
Highlighted
Observer
Observer
259 Views
Registered: ‎06-30-2017

I ran the simulation text file through an FFT using python and got the same results, so I think the problem is in the simulation data generated by the xadx IP.  Thanks for the help.

I found the cause of the problem.  The ADC is not running at 1 MHz, it is running at 961.54 kHz.  Using the actual sample rate makes all the math work out as expected.

View solution in original post

sample_rate.PNG
0 Kudos
5 Replies
Highlighted
415 Views
Registered: ‎01-22-2015

@poelslager 

Try bypassing the FIR filter, or using a different FIR filter to see what effect it has on the FFT-produced spectrum.

Mark

Highlighted
Observer
Observer
391 Views
Registered: ‎06-30-2017

Thank you for the suggestion.  I removed the FIR filter.  I had to drop the least significant bit out of the ADC and add a zero for the sign bit to get a good result.  So the signal path is now: Simulated XADC -> FIFO -> FFT -> CORDIC

Unfortunately the power is still showing up in bin 43, see the attached image. 

Any other suggestions?  It seems like this should be really simple and straight-forward thing, so I'm sure I'm overlooking something simple.  I just don't know what...

I can share the project if anyone wants to look at it, but I might need some instruction in packaging it up with the FIFO IP that I made.

1024_fft_no_fir.PNG
0 Kudos
Highlighted
Observer
Observer
386 Views
Registered: ‎06-30-2017

Here's some additional info: the simulation settings for the XADC and the simulation data that it generated.

adc_sim_settings.PNG
0 Kudos
Highlighted
321 Views
Registered: ‎01-22-2015

I agree that this appears to be a “front end” problem.  That is, not only is the peak frequency bin in the wrong place, the peak also seems too broad (ie. spilling too much into other bins)

Try saving the digital outputs of the XADC to a file and then plotting them.  You should see there are exactly 25 sampling intervals for one period of the 40KHz sinewave signal.  If not, then the XADC sampling frequency is off or the analog input is not 40KHz.

If the above test does not uncover problems then use HDL to directly generate the digital samples for a 40KHz sinusoid and feed these directly into the FFT core.

The previous test may be especially useful since it will isolate the problem to either the front-end or back-end of your digital receiver.

 

Highlighted
Observer
Observer
260 Views
Registered: ‎06-30-2017

I ran the simulation text file through an FFT using python and got the same results, so I think the problem is in the simulation data generated by the xadx IP.  Thanks for the help.

I found the cause of the problem.  The ADC is not running at 1 MHz, it is running at 961.54 kHz.  Using the actual sample rate makes all the math work out as expected.

View solution in original post

sample_rate.PNG
0 Kudos