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
15
votes
6 answers

How to compute frequency of data using FFT?

I want to know the frequency of data. I had a little bit idea that it can be done using FFT, but I am not sure how to do it. Once I passed the entire data to FFT, then it is giving me 2 peaks, but how can I get the frequency? Thanks a lot in…
Michael
  • 361
  • 2
  • 3
  • 9
15
votes
2 answers

How to get the FFT of a numpy array to work?

I'm reading a specific column of a csv file as a numpy array. When I try to do the fft of this array I get an array of NaNs. How do I get the fft to work? Here's what I have so far: #!/usr/bin/env python from __future__ import division import numpy…
Jessica Flores
  • 161
  • 1
  • 1
  • 3
15
votes
5 answers

How exactly do you compute the Fast Fourier Transform?

I've been reading a lot about Fast Fourier Transform and am trying to understand the low-level aspect of it. Unfortunately, Google and Wikipedia are not helping much at all.. and I have like 5 different algorithm books open that aren't helping much…
Parth
  • 235
  • 2
  • 4
  • 7
15
votes
1 answer

Can't find the right energy using scipy.signal.welch

For a given discret time signal x(t) with spacing dt (which is equal to 1/fs, fs being the sample rate), the energy is: E[x(t)] = sum(abs(x)**2.0)/fs Then I do a DFT of x(t): x_tf = np.fft.fftshift( np.fft.fft( x ) ) / ( fs * ( 2.0 * np.pi ) ** 0.5…
gravedigger
  • 359
  • 1
  • 3
  • 13
15
votes
1 answer

What is a spectrogram and how do I set its parameters?

I am trying to plot the spectrogram of my time domain signal given: N=5000; phi = (rand(1,N)-0.5)*pi; a = tan((0.5.*phi)); i = 2.*a./(1-a.^2); plot(i); spectrogram(i,100,1,100,1e3); The problem is I don't understand the parameters and what values…
benzene
  • 165
  • 1
  • 1
  • 6
15
votes
4 answers

why DCT transform is preferred over other transforms in video/image compression

I went through how DCT (discrete cosine transform) is used in image and video compression standards. But why DCT only is preferred over other transforms like dft or dst?
mrsatish
  • 429
  • 2
  • 7
  • 15
15
votes
3 answers

Explain the FFT to me

I want to take audio PCM data and find peaks in it. Specifically, I want to return the frequency and time at which a peak occurs. My understanding of this is that I have to take the PCM data and dump it into an array, setting it as the real values…
user143879
  • 257
  • 3
  • 8
14
votes
1 answer

Recent FFTW wrapper in Java

I'm seeking a minimal Java wrapper for a recent version of FFTW. The wrappers listed on the FFTW website are either out of date (jfftw-1.2.zip) or contain too much extra stuff (Shared Scientific Toolbox). A Google search suggests JFFTW3, which looks…
Kipton Barros
  • 21,002
  • 4
  • 67
  • 80
14
votes
3 answers

Power Spectral Density from jTransforms DoubleFFT_1D

I'm using Jtransforms java library to perform analysis on a given dataset. An example of the data is as follows: 980,988,1160,1080,928,1068,1156,1152,1176,1264 I'm using the DoubleFFT_1D function in jTransforms. The data output is as follows:…
Damon
  • 718
  • 2
  • 8
  • 22
14
votes
1 answer

Swift FFT - Complex split issue

I am trying to perform FFT on an audio file to find frequency using the Accelerate framework. I have adapted code (probably wrong) from this question: Spectrogram from AVAudioPCMBuffer using Accelerate framework in Swift Although, the magnitudes…
user98874
  • 189
  • 1
  • 10
14
votes
3 answers

numpy.fft() what is the return value amplitude + phase shift OR angle?

The np.fft.fft() returns a complex array .... what is the meaning of the complex number ? I suppose the real part is the amplitude ! The imaginary part is phase-shift ? phase-angle ? Or something else ! I figured out the position in the array…
sten
  • 7,028
  • 9
  • 41
  • 63
14
votes
2 answers

fft bandpass filter in python

What I try is to filter my data with fft. I have a noisy signal recorded with 500Hz as a 1d- array. My high-frequency should cut off with 20Hz and my low-frequency with 10Hz. What I have tried is: fft=scipy.fft(signal) bp=fft[:] for i in…
men in black
  • 193
  • 1
  • 1
  • 9
14
votes
2 answers

How to convolve an image with different gabor filters adjusted according to the local orientation and density using FFT?

I'm currently working on a library to generate synthetic fingerprints using the SFinGe method (by Maltoni, Maio and Cappelli) link :http://biolab.csr.unibo.it/research.asp?organize=Activities&select=&selObj=12&pathSubj=111%7C%7C12& One of the steps…
AngelCastillo
  • 2,385
  • 2
  • 18
  • 26
14
votes
1 answer

FFT and IFFT in C++

I'm using C++/C to perform forwards and reverse FFT on some data which is supposed to be the pulsed output of a laser. The idea is to take the output, use a forward FFT to convert to the frequency domain, apply a linear best fit to the phase ( first…
KRS-fun
  • 696
  • 3
  • 9
  • 20
14
votes
2 answers

Get Hz frequency from audio stream on iPhone

What would be the best way to get Hz frequency value from audio stream(music) on iOS? What are the best and easiest frameworks provided by Apple to do that. Thanks in advance.
Olga Dalton
  • 829
  • 3
  • 15
  • 25