Questions tagged [fft]

FFT is short for fast Fourier transform, any of a set of algorithms for quickly computing the discrete Fourier transform (DFT).

The FFT finds a lot of application in data analysis, particularly time-series and image data, and particularly when the data has a periodic nature, or at least a periodic component. The FFT also finds application in digital filtering. There are many FFT algorithms; they all calculate the Discrete Fourier Transform in O(n log n) operations, while the naive DFT implementation is O(n^2).

Mathematically, the Fourier Transform fits a set of sinusoids to the input data - revealing relative strengths of periodic components of the signal. The fit is optimal in a least-squared error sense. In the case of the Discrete Fourier Transform, the sinusoids are periodically related.

Related topics include DFT, signal processing, convolution, and window functions.

More information on FFT can be found in the Wikipedia article on FFT.

5308 questions
17
votes
3 answers

Plotting FFT on octave

I know that FFT changes a function in the time domain to one showed in the frequency domain. However, when I try plotting said graph in the frequency domain, I can only get it to work properly by using the time as X-axis, when it was obviously…
Gabriel Maia
  • 173
  • 1
  • 1
  • 4
17
votes
2 answers

Removing pattern and noise in an image using FFT in matlab

I am using the clown.jpg image to be able to get rid of the obvious pattern/noise it has. The first step that I did before taking FFT of the image is to rescale it a square image of powers of two (i.e. 256 x 256). Using FFT and fftshift in…
Luciano Rodriguez
  • 719
  • 4
  • 9
  • 16
17
votes
1 answer

2D FFT using 1D FFT

I am trying to implement a 2D FFT using 1D FFTs. I have a matrix of size 4x4 (row major) My algorithm is: FFT on all 16 points bit reversal transpose FFT on 16 points bit reversal transpose Is this correct?
user1459175
  • 303
  • 1
  • 3
  • 10
17
votes
3 answers

Is there an FFT that uses a logarithmic division of frequency?

Wikipedia's Wavelet article contains this text: The discrete wavelet transform is also less computationally complex, taking O(N) time as compared to O(N log N) for the fast Fourier transform. This computational advantage is not inherent to the…
endolith
  • 25,479
  • 34
  • 128
  • 192
17
votes
3 answers

neural networks can't figure out Fourier transforms?

I'm trying to understand a few things about neural networks. First, after looking around on the web, it seems that there is no way to compute a (discrete) Fourier transform through a neural network. You can hack it by hard-coding the thing to…
Brannon
  • 5,324
  • 4
  • 35
  • 83
17
votes
1 answer

Safe and fast FFT

Inspired by Herb Sutter's compelling lecture Not your father's C++, I decided to take another look at the latest version of C++ using Microsoft's Visual Studio 2010. I was particularly interested by Herb's assertion that C++ is "safe and fast"…
J D
  • 48,105
  • 13
  • 171
  • 274
16
votes
1 answer

Asymptotically optimal way to find the sum of three elements of an array closest to a given number

In his answer to this question, John Feminella says: It's possible to do this sub-quadratically if you get really fancy, by representing each integer as a bit vector and performing a fast Fourier transform, but that's beyond the scope of this…
Yktula
  • 14,179
  • 14
  • 48
  • 71
16
votes
2 answers

Understanding Overlap and Add for Filtering

I am trying to implement the overlap and add method in oder to apply a filter in a real time context. However, it seems that there is something I am doing wrong, as the resulting output has a larger error than I would expect. For comparing the…
st-h
  • 2,444
  • 6
  • 37
  • 60
16
votes
7 answers

Do I need to call fftshift before calling fft or ifft?

In the book "Computational Fourier Optics, A Matlab Tutorial" by David Voelz, it is written that a call to fftshift is needed before a call to fft or ifft, but in the MATLAB documentation of fftshift it's only written that this command rearranges…
user4861528
  • 467
  • 1
  • 5
  • 20
16
votes
1 answer

"Polynomial too big for FFT" error on NTL

I'm trying to perform a multiplication of polynomials of degree 4096 using ZZ_pEX class from NTL. However, it returns the error "Polynomial too big for FFT", and I couldn't find a way to make it works (or even something that could help on NTL's…
Pedro Alves
  • 1,667
  • 4
  • 17
  • 37
15
votes
3 answers

what is the fastest FFT library for iOS/Android ARM devices?

What is the fastest FFT library for iOS/Android ARM devices? And what library to people typically use on iOS/Android platforms? I'm guessing vDSP is the library most frequently used on iOS. EDIT: my code is at http://anthonix.com/ffts and uses the…
Anthony Blake
  • 5,328
  • 2
  • 25
  • 24
15
votes
4 answers

Doing FFT in realtime

I want to do the FFT of an audio signal in real time, meaning while the person is speaking in the microphone. I will fetch the data (I do this with portaudio, if it would be easier with wavein I would be happy to use that - if you can tell me how).…
Rave
  • 835
  • 4
  • 15
  • 28
15
votes
10 answers

fftshift/ifftshift C/C++ source code

Does anyone know if there is any free and open source library that has implemented these two functions the way they are defined in matlab? Thanks
Derek
  • 11,715
  • 32
  • 127
  • 228
15
votes
2 answers

Android 2.3 Visualizer - Trouble understanding getFft()

First time here so sorry in advance for any butchered formatting. So I am completely new to DSP so I have only a very general understanding of the Fourier Transform. I am trying to build a visualizer app for Android SDK 9, which includes a…
ebolyen
  • 956
  • 2
  • 10
  • 25
15
votes
1 answer

fft division for fast polynomial division

I'm trying to implement fast polynomial division using Fast Fourier Transform (fft). Here is what I have got so far: from numpy.fft import fft, ifft def fft_div(C1, C2): # fft expects right-most for significant coefficients C1 = C1[::-1] …
gaborous
  • 15,832
  • 10
  • 83
  • 102