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
2
votes
1 answer

Bad result plotting windowing FFT

im playing with python and scipy to understand windowing, i made a plot to see how windowing behave under FFT, but the result is not what i was specting. the plot is: the middle plots are pure FFT plot, here is where i get weird things. Then i…
tomzko
  • 77
  • 5
2
votes
1 answer

How to implement a Pitch Effect in Java? (FFT, IFFT, Amplitude, Phase)

I use the apache commons math library for transforming the FFt and IFFT on my audio sample buffers. The outout of the FFT gives me an array of complex numbers. The frequencies mirror in the middle. With a sample buffer size of 4096 samples I get…
thiloilg
  • 1,733
  • 2
  • 18
  • 23
2
votes
2 answers

Cropping image in matlab

I need to do the following for an image in the matlab: Load the image. compute FFT ( Fast Fourier Transform ) of the image. shift frequency components to the center. crop the image like follow ( if the image res. is 1000x1000 , the needed part of…
Minions
  • 5,104
  • 5
  • 50
  • 91
2
votes
1 answer

Adding up all the values for each frequency from FFTW

I have run a 3D Fourier Transform using FFTW (fftw_plan_dft_r2c_3d) and I would like to sum up the (log of the) values of the transform at every frequency, including the repeated frequencies that aren't actually stored in the output array (I…
cgreen
  • 351
  • 1
  • 17
2
votes
1 answer

2D Fourier Transformation in C

I implemented 2D DFT and IDFT using equation from this site http://homepages.inf.ed.ac.uk/rbf/HIPR2/fourier.htm I think these are correct and nicely explained. Implementation looks like that: for(int i=0;i
Kedriik
  • 331
  • 4
  • 12
2
votes
1 answer

How to find frequency of a square wave using FFT

In the FFT (second) plot, I am expecting a bigger peak at frequency = 1.0, compared to other frequencies, since it is a 1 Hz Square Wave signal sampled at 5Hz. I am a beginner at this, possibly missing something silly here Here's what I have…
vijiboy
  • 584
  • 11
  • 25
2
votes
1 answer

reconstruct signal from fft

Im reconstructing signal from amplitude, frequency and phase obtained fft. After I do fft, I picked some of its frequencies and reconstructed time line signal from those fft data. I know IFFT is for this but, I dont want to use IFFT. Reconstruction…
Jay Kim
  • 123
  • 1
  • 11
2
votes
1 answer

any rules of thumb how to smooth FFT spectrum to prevent artifacts when hand-tweaking?

I've got a FFT magnitude spectrum and I want to create a filter from it that selectively passes periodic noise sources (e.g. sinewave spurs) and zero's out the frequency bins associated with the random background noise. I understand sharp…
ggkmath
  • 4,188
  • 23
  • 72
  • 129
2
votes
0 answers

Linear and circular convolution in Python

I'm trying to perform linear convolutions in Python by comparing the results from FFTs and convolution functions. Python's scipy.signal.fftconvolve automatically does the necessary zero padding. If we do the calculation using only FFTs, we add a…
Medulla Oblongata
  • 3,771
  • 8
  • 36
  • 75
2
votes
1 answer

FFT using OpenCV gives two matrices?

I am using numpy FFT to compute the spectrum from the input matrix. My sample input is a 2D matrix A=[[1,2,3,4],[6,7,8,9]] My python code is FFT= np.fft.fftshift(np.fft.fft2(A)) Output Now, I am trying to use the dft2 function of Opencv. I get…
user1388142
  • 581
  • 2
  • 11
  • 26
2
votes
1 answer

android spectrum analysis of streaming input

for a school project I am trying to make an android application that, once started, will perform a spectrum analysis of live audio received from the microphone or a bluetooth headset. I know I should be using FFT, and have been looking at…
TheBeeKeeper
  • 31
  • 1
  • 4
2
votes
1 answer

FFT of 16 bit short (real) strided data

I need to compute the FFT of 2 arrays of short data stored like this (replicated millons of times): and so on. The array values are represented by yellow and blue. Every K values there is a size K space of unused data I need to skip. I've…
papanoel87
  • 131
  • 1
  • 12
2
votes
1 answer

Why we shift zero-frequency component to center of spectrum of an image?

F = round(fftshift(abs(fft2(A)))) where A is the image. I am studying contrast stretching in Digital Image Processing. I don't understand zero frequency component. I searched for it but I couldn't understand it, kindly refer some documentation…
ZAFRAN ULLAH
  • 35
  • 1
  • 4
2
votes
0 answers

matplotlib.mlab.specgram equivalent in Java

Is there any similar libraries in Java that can do what specgram function of matplotlib library does? specgram splits the data into specified length segments and calculates spectrum of each section, applies a window function to each segment. It also…
nope
  • 751
  • 2
  • 12
  • 29
2
votes
1 answer

Strange Result from FFT using Scipy

I'm trying to do an FFT of some data (a Gaussian pulse), but I'm finding a strange result. The real and imaginary components of the resultant FFT alternate in sign every index of the array. The absolute values of the arrays, however, are continuous.…
user139632
  • 21
  • 2