Altera_Forum
Honored Contributor
17 years agoFFT v8 - not getting the desired output
Hello all,
I'm experimenting with the FFT block in Quartus and trying to build a system that will eventually record audio from a microphone and send it to the FFT block to get the frequency spectrum. At the moment, I've built a system involving the Nios II and the FFT block. The Nios II generates some test data (a sine wave with 2 frequency components at 500Hz and 127Hz), sends that to the FFT block, reads the result then sends that to the PC via the serial port. I think that I've got the interface with the FFT block sussed - I can send data to the FFT block and receive data back with no errors occurring (or so I think - I added checks in the code). However, when I open up the data in MATLAB, I find that the output spectrum (after combining real, imaginary and exp parts then using the fftshift command) only shows one peak at 0Hz and nothing else. I'm not really very well versed in FFT and I'm learning it as I go along. I'm wondering whether maybe the DC component is so large that the other components are being scaled down so much they become 0? If so, how can I remedy this? I've attached a couple of things to this post to outline what I've tried. The image shows the schematic of my system in Quartus - the FFT block has a transform length of 1024 (I'm giving it 1000 samples), 16 bit data, 16 bit twiddle, single output, 1 parallel FFT engine burst mode. The main Nios code is in the file hello_world.c in the zip archive. In it, I generate the sample data, pass it through to the FFT block and write the results out to the serial port (115200 baud). I've also included the output of my program so you can see the data that is being generated and the data received. Thanks, --Amr