ECE492 Application Note – Audio Input Fast Fourier Transform



Written by: Andrew Ovens and Torrin Swanson (Group 10)

This application note will allow you to perform spectrum analysis on the audio input on the DE2 board. The code performs a fast Fourier transform on the audio from the left channel of the board’s line in. It is a 1024 point FFT with a bit width of 24 (the same as the audio codec).

How to Use
1. Extract the zip file
2. Enter the scripts directory
3. Set the launch_quartus.sh file as executable
4. Run the launch_quartus.sh script
5. Open the audio_fft.qpf project file
6. Ensure the audio_fft.vhd file is the top level entity
7. Add code where indicated in the audio_fft.vhd file to analyze the FFT output as you wish
8. Compile and program the project to the board

The out_cnt variable indicates which frequency bin the current output corresponds to. There are 1024 bins, though the first 512 will be the same as the second 512, due to the fact that there is no imaginary part to the input. The 0th bin is the DC offset bin. After that, each bin is approximately 40 Hz wide, with a 20 Hz overlap on each side. For example, the 1st bin is 1 Hz to 40 Hz and the 2nd bin is 20 Hz to 60 Hz. The result48 variable contains the magnitude (squared) of the current bin.