Wednesday, June 15, 2011

How to do a Fast Fourier Transform (FFT) in Microsoft Excel


1. Enable the ToolPak if you have not already done so. Click the 'Office' button, and then choose 'Options.' Click 'Add-In Options,' highlight 'Analysis ToolPak,' and press 'Go.' Highlight 'Analysis ToolPak' a second time, and then press the 'OK' button.
2. Open Excel and create a new spreadsheet file. Add the title 'Time' to the A column, followed by the titles 'Data,' 'FFT Frequency,' 'FFT Complex' and 'FFT Magnitude' to columns B through E respectively.
3. Input the data from your samples into the Data column. Make a note of the number of data points and the sampling rate used.
4. Write the time at which each data point was taken in the Time column. Determine this by dividing the total time by the number of data points.
5. Open the 'Data' tab, and then select 'Data Analysis.' Select the 'Fourier Analysis' option and press the 'OK' button. Set the input range as the information in the Data column and the output as the FFT Complex column.
6. Type the equation '=IMABS (E2)' into the first cell of the FTT Magnitude column. Drag the equation downward to fill every cell of the column. This equation creates real numbers, instead of complex numbers, in the previous column.
7. Fill column F with the corresponding data, from column A, point minus one. Create a separate cell with the equation '=(S/2)/(N/2),' replacing 'S' with the sampling rate and 'N' with the number of samples.
8. Enter the equation '=F2*SG$4' in the first cell of the FTT Frequency column. This time, drag the equation only to the halfway point in the column.
9. Create a graph, using the FTT Magnitude column for the y-axis and the FTT Frequency column for the x-axis. The graph displays the dominant frequencies as peaks.

Blogger news