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
50
votes
4 answers

Understanding Matlab FFT example

I am new to matlab and FFT and want to understand the Matlab FFT example. For now I have two main questions: 1) Why does the x-axis (frequency) end at 500? How do I know that there aren't more frequencies or are they just ignored? 2) How do I know…
stefan.at.kotlin
  • 15,347
  • 38
  • 147
  • 270
42
votes
2 answers

Python Scipy FFT wav files

I have a handful of wav files. I'd like to use SciPy FFT to plot the frequency spectrum of these wav files. How would I go about doing this?
user1802143
  • 14,662
  • 17
  • 46
  • 55
42
votes
2 answers

How to plot a 2D FFT in Matlab?

I am using fft2 to compute the Fourier Transform of a grayscale image in MATLAB. What is the common way to plot the magnitude of the result?
Yoav
  • 5,962
  • 5
  • 39
  • 61
41
votes
4 answers

FFT in a single C-file

I was looking for a FFT implementation in C. However, I am not looking for a huge library (like FFTW) but for a easy to use single C-file implementation. Unfortunately I haven't been able to find anything like this. Can someone recommend a simple…
mijc
  • 1,189
  • 3
  • 9
  • 16
39
votes
1 answer

Android audio FFT to retrieve specific frequency magnitude using audiorecord

I am currently trying to implement some code using Android to detect when a number of specific audio frequency ranges are played through the phone's microphone. I have set up the class using the AudioRecord class: int channel_config =…
user723060
  • 393
  • 1
  • 4
  • 4
39
votes
5 answers

How to calculate a Fourier series in Numpy?

I have a periodic function of period T and would like to know how to obtain the list of the Fourier coefficients. I tried using fft module from numpy but it seems more dedicated to Fourier transforms than series. Maybe it a lack of mathematical…
Mermoz
  • 14,898
  • 17
  • 60
  • 85
39
votes
4 answers

Python frequency detection

Ok what im trying to do is a kind of audio processing software that can detect a prevalent frequency an if the frequency is played for long enough (few ms) i know i got a positive match. i know i would need to use FFT or something simiral but in…
MatijaG
  • 818
  • 1
  • 9
  • 12
38
votes
7 answers

FFT library in android Sdk

I am working with android project.I need FFT algorithm to process the android accelerometer data.Is there FFT library available in android sdk?
stefy abraham
  • 461
  • 1
  • 5
  • 8
36
votes
3 answers

Graphing the pitch (frequency) of a sound

I want to plot the pitch of a sound into a graph. Currently I can plot the amplitude. The graph below is created by the data returned by getUnscaledAmplitude(): AudioInputStream audioInputStream = AudioSystem.getAudioInputStream(new…
Amy B
  • 17,874
  • 12
  • 64
  • 83
36
votes
3 answers

What does the FFT data in the Web Audio API correspond to?

I've used the FFT data from the Analyser node using the getByteFrequencyData method in the Web Audio API to create a spectrum visualizer as shown below: In this instance I have 256 bins of data. What exactly do the numbers in this correspond to? Is…
RobotEyes
  • 4,929
  • 6
  • 42
  • 57
33
votes
1 answer

How to generate the audio spectrum using fft in C++?

I want to generate an audio spectrum (as seen in this video) of a mp3 audio file. Basically this problem requires calculating the fft of the audio signal. How do I program this in C/C++? I've looked at a couple of open source libraries such as FFTW…
MRashid
  • 472
  • 1
  • 5
  • 13
32
votes
1 answer

How to get frequency from fft result?

I have recorded an array[1024] of data from my mic on my Android phone, passed it through a 1D forward DFT of the real data (setting a further 1024 bits to 0). I saved the array to a text file, and repeated this 8 times. I got back 16384 results. I…
Ben Taliadoros
  • 7,003
  • 15
  • 60
  • 97
32
votes
5 answers

Cepstral Analysis for pitch detection

I'm looking to extract pitches from a sound signal. Someone on IRC just explained to me how taking a double FFT achieves this. Specifically: take FFT take log of square of absolute value (can be done with lookup table) take another FFT take…
P i
  • 29,020
  • 36
  • 159
  • 267
31
votes
6 answers

Improving FFT performance in Python

What is the fastest FFT implementation in Python? It seems numpy.fft and scipy.fftpack both are based on fftpack, and not FFTW. Is fftpack as fast as FFTW? What about using multithreaded FFT, or using distributed (MPI) FFT?
Charles Brunet
  • 21,797
  • 24
  • 83
  • 124
31
votes
3 answers

Underlying technique of Android's FaceDetector

I'm implementing a face tracker on Android, and as a literature study, would like to identify the underlying technique of Android's FaceDetector. Simply put: I want to understand how the android.media.FaceDetector classifier works. A brief Google…
Paul Lammertsma
  • 37,593
  • 16
  • 136
  • 187