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

FFTW in Fortran result contains only zeros

I have been trying to write a simple program to perform an fft on a 1D input array using fftw3. Here I am using a seismogram as an input. The output array is, however, coming out to contain only zeroes. I know that the input is correct as I have…
Yuki.kuroshita
  • 759
  • 9
  • 29
2
votes
1 answer

Poisson equation solver in 3-D Sine transform of r2r type using FFTW in Fortran

I have written following code in Fortran to solve Poisson's equation using r2r (real to real) type FFTW sin transform. In this code, first I have done normal FFTW i.e. r2c (real to complex) type of a mathematical function 27*sin(3x)*sin(3y)*sin(3z)…
2
votes
1 answer

Discrete Fourier Transform (Not FFT) In Java

I'm doing an assignment for a CSE class in Java and am implementing a FFT and the direct DFT (with matrix calculations). My FFT works fine, but my direct DFT is not working. My Fourier matrix is not coming out with the right values, and I want to…
LoveAndCoding
  • 7,857
  • 2
  • 31
  • 55
2
votes
2 answers

If we take STFT of a single sinusoid, and plot the value corresponding to carrier frequency in real imaginary plane, how many points should it be?

I created a sinusoid with frequency 550Hz that goes for 1 second fs=44100; Duration=1; %second Len=Duration * fs; %length of sinusoid t=(0:Len-1)/fs; x=sin(2*pi*550*t); for the purpose of exploring and learning, I have decided to take the short…
Atra Es
  • 25
  • 4
2
votes
3 answers

Calculate non-integer frequency with NumPy FFT

I would like to calculate the frequency of a periodic time series using NumPy FFT. As an example, let's say my time series y is defined as follows: import numpy as np freq = 12.3 x = np.arange(10000) y = np.cos(x * 2 * np.pi * freq / 10000) If the…
cjo
  • 21
  • 3
2
votes
1 answer

Why is every second coefficient of numpy's fft the inverse of what it should be?

This is how I tried to get the DFT of the unit pulse using numpy (the plot shows the unit pulse): %matplotlib inline import matplotlib.pyplot as plt import numpy as np def plot_complex(space, arr): plt.figure() plt.plot(space, arr.real,…
nnotm
  • 23
  • 4
2
votes
1 answer

Unexpected FFT Results with Python

I'm analyzing what is essentially a respiratory waveform, constructed in 3 different shapes (the data originates from MRI, so multiple echo times were used; see here if you'd like some quick background). Here are a couple of segments of two of the…
bearplane
  • 700
  • 1
  • 9
  • 22
2
votes
1 answer

Spectrum computed with Matlab FFT does not give a consistent result for different lengths of sample (same number of points but Fs different)?

I would like to plot profile of rugosity (from AFM measurements) but there are still this that I misunderstand regarding the FFT (especially in Matlab documentation). I want to compare two measurements, a.k.a. two rugosity profiles. They were done…
LeChat
  • 466
  • 3
  • 18
2
votes
1 answer

Frequency domain filtering with scipy.fftpack, ifft2 does not give the desired result

I am trying to simply apply a Gaussian filter on a gray-scale input lena image in frequency domain with the following code and here is the wrong output I am getting: from scipy import signal from skimage.io import imread import scipy.fftpack as…
Sandipan Dey
  • 21,482
  • 2
  • 51
  • 63
2
votes
0 answers

Derivation of FFT from DFT

Can someone please share a link or source where I can find the derivation of FFT(base-2) from the DFT. I need to put this in latex for my thesis and am finding so many different explanations that I don't know which one to use.
Dilip
  • 115
  • 1
  • 1
  • 4
2
votes
0 answers

Alternating error in FFTW correlation

// Initialize variables, ZALLOC allocates and fills with zeroes ZALLOC(z0q, numqbins, double) ; ZALLOC(z1q, numqbins, double) ; ZALLOC(z2q, numqbins, double) ; z_in = (double*)fftw_malloc(sizeof(double) * numqbins * 2) ; z_out =…
N. A.
  • 121
  • 1
2
votes
1 answer

How to detect similar objects in this picture?

I want to find patterns in image. Saying "to find patterns" I mean "to detect similar objects", thus these patterns shouldn't be some high-frequency info like noise. For example, on this image I'd like to get pattern "window" with ROI/ellipse of…
olha
  • 2,132
  • 1
  • 18
  • 39
2
votes
1 answer

Fast-fourier transform for low-frequency signals in the WebAudio API / javascript

I have a single-channel wave coming in at an 8000 Hz sampling rate. I need to analyze frequencies that are between 5 Hz and 300 Hz in real-time, with emphasis on signals from 10 to 60 Hz. My thought initially is to run the 8000 Hz sample into a…
Kevin
  • 61
  • 5
2
votes
1 answer

Why does my NAudio FFT result differ from MATLAB by a factor of 4?

The following C# NAudio code produces a different result to MATLAB by a factor of 4. Why does this occur and is one of them incorrect? Complex[] tmp = new Complex[4]; tmp[0].X = 1.0f; tmp[1].X = 0.5f; tmp[2].X = 1.0f; tmp[3].X = 0.25f; tmp[0].Y =…
AlexS
  • 510
  • 2
  • 7
  • 23
2
votes
3 answers

Signal processing: FFT overlap processing resources

Are there any good (if possible scientific) resources available (web or books) about overlap processing. I am not that interested in the effects of using overlap processing and windows when analyzing a signal, since the requirements are different.…
st-h
  • 2,444
  • 6
  • 37
  • 60