Monday, 23 December 2013

FFT calculator

This blog post implements a Fast Fourier Transform (FFT) or an Inverse Fast Fourier Transform (IFFT) on a complex input, dependent on the checkbox setting below. You can specify the sampling frequency in arbitrary units (e.g. Hz) in the appropriately labelled text area below (a default of 100 is used).

For discrete time-domain input samples $x[n]$ for $n={0,1,2,..,N-1}$ the FFT (at bin $k$ for $k={0,1,2,..,N-1}$) is defined by equation


while for discrete frequency-domain input bins $X[k]$ for $k={0,1,2,..,N-1}$ the IFFT (at time index $n$ for $n={0,1,2,..,N-1}$) is defined by equation


where $N=2^g$ for integer $g$.

Please enter the numbers in the text areas below - one number per line, for each of the Real and Imaginary input textareas (the textareas have already been filled in with some numbers for illustration purposes). There must be no new line after the last number.

Note that if the input is real only, the imaginary input textarea can be left empty (rather than having to fill it with the same number of zeros as there are real inputs, which can be a bit more cumbersome). Conversely, if the input is imaginary only, the real input textarea can be left empty (rather than having to fill it with the same number of zeros as there are imaginary inputs).

Alternatively you can choose to load a CSV file, which must be either a single column of numbers (for a real only input) or two comma-separated columns of numbers - the first line can be a comment line, starting with the character #.

To perform the FFT/IFFT, please press the button labelled "Perform FFT/IFFT" below - the results will populate the textareas below labelled "Real Output" and "Imaginary Output", as well as a textarea at the bottom that will contain the real and imaginary output joined using a comma - this is suitable for copying and pasting the results to a CSV file.

In addition, graphical outputs of the FFT are displayed below. These include a graph of FFT magnitude (using the drop-down menu below, you can select the units of this parameter) and a graph of the phase response (units of either radian or degrees also selectable by a drop-down menu below). When a unit is altered, you would need to perform the FFT again by pressing the calculate button for the changes to take effect.

At the bottom of this blog post, the Decimation In Time (DIT) twiddle Q factors will be displayed, as defined in For an $N$ point FFT, there are $log_2(N)$ stages, and for each stage there are $N/2$ twiddle factors that do not equal the $-1$ term - these are the ones that will be printed.

If you change inputs to a smaller number of samples, please press the calculate button twice for the results to take effect. Alternatively, you can simply reload the page, then fill in the input textareas.

As the FFT operates on inputs that contain an integer power of two number of samples, the input data length will be augmented by zero padding the real and imaginary data samples to satisfy this condition were this not to hold.

You can find an FFT based Power Spectral Density (PSD) Estimator here.

Real Input                         Imaginary Input


Sampling frequency:-

FFT size...

Real Output                         Imaginary Output

Real and Imaginary output concatenated on each line:-

FFT Magnitude

Complex (Linear)


Complex (Linear)


FFT Phase Response





FFT twiddle factors...


  1. Neat and useful calculator ! Thank you !
    Please consider adding an extra field where we could input the sampling frequency and convert bin indexes to frequency. That would be totally awesome.

  2. Thank you very much for seeing 밤알바 information.
    Thank you very much for seeing 밤알바 information.

  3. I thought you'd like to know that your site is making it possible for me to continue with work on IIR filters and FFT analysis with my DSP class now that our campus has been closed for several weeks. I, and my students, thank you!


  5. Any chance you can also show the twiddle factors along side it, this is very useful tool to debug against my own implementation to check the results - currently mine gives totally different results to yours.

    1. At the bottom of this page, I have added the twiddle factors that will display in blue, after the calculate button is pressed.

  6. after the processing of input, i'm speech less, it's superb, nice work

  7. Dear Friends,
    My name is Peter Franko and I work as a data analyst skills coach at QA in the UK. When coaching my apprentices we find your online DFF tool very useful. However, I would like to ask one thing, please. When we decompose the input data, I think we should be able to obtain the result in the form:

    F(x) = Asin(bx+p) = Bcos(cx+q)

    Is it possible to calculate these coefficients A,B,b,c,p,q from your tool? In other words, is it possible to calculate the amplitudes, frequencies and phases of the individual sine and cosine waves?

    Thank you for your help.
    Best regards,

  8. 위대한 지식, 누구든지 그저 다시 언급해도 될까요? 먹튀검증

  9. Hello I want to share good information. Get good information. I will get good information. Everyone will have a hard time due to the corona, but please do your best. I hope that the corona will disappear soon. It would be hard for everyone, but I hope that the more I will endure and get good results. Thank you 토토사이트

  10. Trying to say thanks won't simply be adequate, for the fantasti c clarity in your written work. I will immediately snatch your rss channel to remain educated of any updates. 안전놀이터

  11. ❤ I favor the idea, such a good deal buy traffic

  12. ❤ I favor the idea, such a good deal 토토