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

Losing radial symmetry in solving Poisson equation with FFTW in C

I have a problem about using FFTW in order to solve Poisson equation. The equation I am trying to solve is the following: The problem is that I get a solution which is no longer radially symmetric, in particular symmetry is lost along the axes as…
Krist
  • 57
  • 4
2
votes
2 answers

Why is my discrete time Fourier transform incorrect?

I created a code that tries to compute the DTFT of a function. This is my code: figure n = linspace(0,2*pi,1500); %example x = cos(n); %example l = length(n); syms k w Xk = sum(x(1:l).*exp((-1i.*k.*2/l.*pi.*(0:l-1)))); Xk = matlabFunction(Xk); d =…
omersk3
  • 23
  • 4
2
votes
0 answers

Reconstruct signal from FFT using Accord.net

I am trying to filter out signal noise using Fourier Transform. Using functions from Accord.net I was able to apply FFT on an input signal and reconstruct it. However I am unable get the correct phase of the signal. After hours of Googling, I…
2
votes
1 answer

Fourier Transform in Python 2D

I want to perform numerically Fourier transform of Gaussian function using fft2. Under this transformation the function is preserved up to a constant. I create 2 grids: one for real space, the second for frequency (momentum, k, etc.). (Frequencies…
Max Borovkov
  • 23
  • 1
  • 1
  • 4
2
votes
1 answer

Python Frequency filtering with seemingly wrong frequencies

The script below filters frequencies by cutting of all frequencies larger than 6. However instead of using the seemingly correct function rfftfreq, fftfreq is being used. To my understandnig rfftfreq should be used together with rfft. Why does this…
dann
  • 23
  • 4
2
votes
1 answer

Fourier deconvolution with numpy

I am attempting to remove my probes function from a signal using Fourier deconvolution, but I can not get a correct output with test signals. t = np.zeros(30) t = np.append(t, np.arange(0, 20, 0.1)) sigma = 2 mu = 5. g = 1/np.sqrt(2*np.pi*sigma**2)…
eric hoglund
  • 59
  • 1
  • 4
2
votes
1 answer

Undefined reference, when using fft routine from cmsis library

I am trying to use fft functions in my application code for particle-photon. I have managed to link my library to the cmsis prebuilt-library for Cortex M3. However when I call the actual fft function: arm_rfft_q31( &rfftStruct, buffer, buffer); //…
Som
  • 83
  • 2
  • 9
2
votes
1 answer

Scaling problems with IFFT in Matlab

I'm studying the IFFT in Matlab by applying it to a Gaussian. According to Wikipedia tables, the Fourier transform pair would be F(w) = sqrt(pi/a) * exp(-w^2/(4a)) in frequency, and f(t) = exp(-at^2) in time. I modified the code in a previous…
Medulla Oblongata
  • 3,771
  • 8
  • 36
  • 75
2
votes
2 answers

Using FFT for 3D array representation of 2D field

I need to obtain the fourier transform of a complex field. I'm using python. My input is a 2D snapshot of the electric field in the xy-plane. I currently have a 3D array F[x][y][z] where F[x][y][0] contains the real component and F[x][y]1 contains…
zeb92
  • 73
  • 2
  • 10
2
votes
1 answer

Proving Fourier transform operation in Python

I have an expression in the time domain f = -1j*H(t) * exp(-(1j*a+b)*t) which can be Fourier transformed analytically using known properties (H is the Heaviside step function). The result of this FT operation is F =…
Medulla Oblongata
  • 3,771
  • 8
  • 36
  • 75
2
votes
0 answers

Cross-product in fourierspace, imaginary artefacts appearing

I'm working on a code to simulate turbulence in a periodic cube. To do so I start with a velocity vector field of shape [64,64,64,3] which means 64 grid points in each direction (x,y,z) and 3 velocity components at each point in this space…
2
votes
1 answer

FFTW library: verifying fourier transform derivative property

I am trying to verify this relation with the fftw library: Therefore, I chose f to be a Gaussian, computed the Fourier Transform of its derivative and compared it with the one of the Fourier Transform of the Gaussian multiplied by ik. Here is what…
Krist
  • 57
  • 4
2
votes
1 answer

Recursive FFT discards the imaginary part

I am trying to implement recursive FFT. import numpy as np from math import e, pi def rdft(a): n = a.size if n == 1: return a i = complex(0, 1) w_n = e ** (2 * i * pi / float(n)) w = 1 a_0 = np.zeros(int(math.ceil(n…
mpourreza
  • 177
  • 1
  • 1
  • 15
2
votes
1 answer

How do I display a spectrogram from a wav file in C++?

I am doing a project in which I want to embed images into a .wav file so that when one sees the spectrogram using certain parameters, they will see the hidden image. My question is, in C++, how can I use the data in a wav file to display a…
Ibrahim
  • 1,209
  • 1
  • 11
  • 16
2
votes
1 answer

FFT: why the reconstructions from different frequency-domain data produce the same result

Does the (i)fftshift operation which changes the position of an certain value have something to do with the reconstructed image? If using zero-filling, cutting the data in frequency-domain also make no sense? A MATLAB demonstration: I =…
Shannon
  • 323
  • 1
  • 11