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
22
votes
5 answers

High Pass Filter for image processing in python by using scipy/numpy

I am currently studying image processing. In SciPy, I know there is a median filter in scipy.signal. Is there a filter similar to a high pass filter?
Hold_My_Anger
  • 1,007
  • 5
  • 14
  • 34
22
votes
4 answers

FFT real/imaginary/abs parts interpretation

I'm currently learning about discret Fourier transform and I'm playing with numpy to understand it better. I tried to plot a "sin x sin x sin" signal and obtained a clean FFT with 4 non-zero points. I naively told myself : "well, if I plot a "sin +…
Cyrille
  • 13,905
  • 2
  • 22
  • 41
21
votes
3 answers

How Shazam or Sound Hound works?

I'm developing an iOS application with SDK for iOS 5.0 and XCode 4.2. I want to develop an application that recognize sounds. I see there is an application called Sound Hound that recognize music and tells artist and title. How can I do something…
VansFannel
  • 45,055
  • 107
  • 359
  • 626
21
votes
2 answers

What is the difference between numpy.fft.fft and numpy.fft.rfft?

The documentation says that np.fft.fft does this: Compute the one-dimensional discrete Fourier Transform. and np.fft.rfft does this: Compute the one-dimensional discrete Fourier Transform for real input. I also see that for my data (audio data,…
21
votes
2 answers

How to filter FFT data (for audio visualisation)?

I was looking at this Web Audio API demo, part of this nice book If you look at the demo, the fft peaks fall smoothly. I'm trying to do same with Processing in Java mode using the minim library. I've looked at how this is done with the web audio api…
George Profenza
  • 50,687
  • 19
  • 144
  • 218
20
votes
5 answers

How to find the periodicity in data?

I have a dataset (an array) and I need to find the periodicity in it. How should I proceed? Somebody said I can use FFT but I am not sure how will it give me the periodicity. Your help is appreciated!
Michael
  • 361
  • 2
  • 3
  • 9
20
votes
4 answers

DSP - Filtering in the frequency domain via FFT

I've been playing around a little with the Exocortex implementation of the FFT, but I'm having some problems. Whenever I modify the amplitudes of the frequency bins before calling the iFFT the resulting signal contains some clicks and pops,…
Trap
  • 12,050
  • 15
  • 55
  • 67
20
votes
1 answer

Discretized continuous Fourier transform with numpy

Consider a function f(t), how do I compute the continuous Fouriertransform g(w) and plot it (using numpy and matplotlib)? This or the inverse problem (g(w) given, plot of f(t) unknown) occurs if there exists no analytical solution to the Fourier…
thomasfermi
  • 1,183
  • 1
  • 10
  • 20
20
votes
1 answer

Computational complexity of an n-dimensional Fast Fourier Transform?

I'm trying to write a bit of code that will predict the time taken to perform a discrete Fourier transform on a given n-dimensional array, but I'm struggling to get my head around the computational complexity of n-dimensional FFTs. As I understand…
ali_m
  • 71,714
  • 23
  • 223
  • 298
19
votes
1 answer

Getting Fourier Transform from Phase and Magnitude - Matlab

The magnitude and phase of a fourier transform F are defined as: Mag = sqrt(Real(F)^2 + Imaginary(F)^2) and Phase = arctan(Imaginary(F)/Real(F)) Ive tried to write matlab code that takes in a grayscale image matrix, performs fft2() on the matrix…
Dave Anderson
  • 725
  • 3
  • 9
  • 17
19
votes
3 answers

Clojure/Java: Java libraries for spectrum analysis of sound?

I am looking for a library that can accept a chunk of audio data and return the average amplitude over time within a given frequency band. I've already asked this question over at comp.dsp, but it's clear to me that acquiring the know-how to build…
jkndrkn
  • 4,012
  • 4
  • 36
  • 41
18
votes
1 answer

How to extract frequency information from samples from PortAudio using FFTW in C

I want to make a program that would record audio data using PortAudio (I have this part done) and then display the frequency information of that recorded audio (for now, I'd like to display the average frequency of each of the group of samples as…
houbysoft
  • 32,532
  • 24
  • 103
  • 156
18
votes
1 answer

Parseval's theorem in Python

I'm trying to get some grip on Python's fft functionality, and one of the weird things that I've stumbled on is that Parseval's theorem doesn't seem to apply, as it gives a difference of about 50 now, while it should be 0. import numpy as np import…
Coolcrab
  • 2,655
  • 9
  • 39
  • 59
17
votes
5 answers

Is it worth offloading FFT computation to an embedded GPU?

We are considering porting an application from a dedicated digital signal processing chip to run on generic x86 hardware. The application does a lot of Fourier transforms, and from brief research, it appears that FFTs are fairly well suited to…
Ian Renton
  • 699
  • 2
  • 8
  • 21
17
votes
2 answers

How to capture audio samples in iOS with Swift?

I've found lots of examples online for working with audio in iOS, but most of them are pretty outdated and don't apply to what I'm trying to accomplish. Here's my project: I need to capture audio samples from two sources - microphone input and…
Hundley
  • 3,167
  • 3
  • 23
  • 45