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
31
votes
2 answers

Fast Fourier Transform in R

I have a dataset with the number of hourly visits an animal made during a period of 12 months. I want to use the Fast Fourier Transform to examine cyclical patterns and periodicity. In the past, I have used Statistica for this this; however, I would…
user1626688
  • 1,583
  • 4
  • 18
  • 27
30
votes
2 answers

Discrete Fourier transform

I am currently trying to write some fourier transform algorithm. I started with a simple DFT algorithm as described in the mathematical definition: public class DFT { public static Complex[] Transform(Complex[] input) { int N =…
Marcel
  • 312
  • 4
  • 8
29
votes
7 answers

Real time pitch detection

For real time pitch detection of a user's singing FFT and autocorrelation don't get a good result. I can't find C / C++ methods. Microphone input data is correct and when using a sine wave results are more or less the correct pitch. I'm visualizing…
Niall
  • 757
  • 3
  • 9
  • 17
28
votes
3 answers

Interpreting Web Audio API FFT results

The Web Audio API has an analyser node which allows you to get FFT data on the audio you're working with and has byte and float ways of getting the data. The byte version makes a bit of sense, returning what looks like a normalized (depending on min…
Newmu
  • 1,930
  • 1
  • 20
  • 25
26
votes
7 answers

How do you analyse the fundamental frequency of a PCM or WAV sample?

I have a sample held in a buffer from DirectX. It's a sample of a note played and captured from an instrument. How do I analyse the frequency of the sample (like a guitar tuner does)? I believe FFTs are involved, but I have no pointers to HOWTOs.
WaveyDavey
26
votes
6 answers

Extracting precise frequencies from FFT Bins using phase change between frames

I have been looking through this fantastic article: http://blogs.zynaptiq.com/bernsee/pitch-shifting-using-the-ft/ While being fantastic, it is extremely hard and heavy going. This material is really stretching me. I have extracted the maths from…
P i
  • 29,020
  • 36
  • 159
  • 267
26
votes
2 answers

What are the downsides of convolution by FFT compared to realspace convolution?

So I am aware that a convolution by FFT has a lower computational complexity than a convolution in real space. But what are the downsides of an FFT convolution? Does the kernel size always have to match the image size, or are there functions that…
ABDreverhaven
  • 539
  • 1
  • 5
  • 10
26
votes
4 answers

FFT for Spectrograms in Python

How would I go about using Python to read the frequency peaks from a WAV PCM file and then be able to generate an image of it, for spectogram analysis? I'm trying to make a program that allows you to read any audio file, converting it to WAV PCM,…
Eugene Bulkin
  • 1,068
  • 1
  • 13
  • 14
25
votes
2 answers

Calculate autocorrelation using FFT in Matlab

I've read some explanations of how autocorrelation can be more efficiently calculated using the fft of a signal, multiplying the real part by the complex conjugate (Fourier domain), then using the inverse fft, but I'm having trouble realizing this…
skj
  • 275
  • 1
  • 5
  • 7
24
votes
4 answers

Spectrogram C++ library

For my current project in C++ / Qt I need a library (LGPL is preferred) which can calculate a spectrogram from a signal ( basically an array of doubles ). I already use Qwt for the GUI part. Any suggestions? Thanks.
gregseth
  • 12,952
  • 15
  • 63
  • 96
24
votes
1 answer

Generating a spectrogram for a sequence of 2D movie frames

I have some data that consists of a sequence of video frames which represent changes in luminance over time relative to a moving baseline. In these videos there are two kinds of 'event' that can occur - 'localised' events, which consist of luminance…
ali_m
  • 71,714
  • 23
  • 223
  • 298
24
votes
7 answers

DFT matrix in python

What's the easiest way to get the DFT matrix for 2-d DFT in python? I could not find such function in numpy.fft. Thanks!
Uri Cohen
  • 3,488
  • 1
  • 29
  • 46
24
votes
6 answers

FFT-based 2D convolution and correlation in Python

Is there a FFT-based 2D cross-correlation or convolution function built into scipy (or another popular library)? There are functions like these: scipy.signal.correlate2d - "the direct method implemented by convolveND will be slow for large…
endolith
  • 25,479
  • 34
  • 128
  • 192
23
votes
5 answers

Pitch recognition of musical notes on a smart phone

With limited resources such as slower CPUs, code size and RAM, how best to detect the pitch of a musical note, similar to what an electronic or software tuner would do? Should I use: Kiss FFT FFTW Discrete Wavelet Transform autocorrelation zero…
mahboudz
  • 39,196
  • 16
  • 97
  • 124
22
votes
4 answers

Why do I need to apply a window function to samples when building a power spectrum of an audio signal?

I have found for several times the following guidelines for getting the power spectrum of an audio signal: collect N samples, where N is a power of 2 apply a suitable window function to the samples, e.g. Hanning pass the windowed samples to an FFT…
Nuno Santos
  • 1,476
  • 3
  • 17
  • 34