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

AForge FFT2 and matlab FFT2 results dont match

I tried using Aforge.Math for doing FFT2 on 2D complex matrix and tried the same on matlab On C#, for AForge: Complex[,] array2D = new Complex[,] { { (Complex)1, (Complex)2 }, { (Complex)3, (Complex)4 }, { (Complex)5, (Complex) 6 }, { …
Md Sifatul Islam
  • 846
  • 10
  • 28
2
votes
2 answers

Speed up distance calculations, sliding window

I have two time series A and B. A with length m and B with length n. m << n. Both have the dimension d. I calculate the distance between A and all subsequencies in B by sliding A over B. In python the code looks like this. def sliding_dist(A,B) …
Carl Rynegardh
  • 538
  • 1
  • 5
  • 22
2
votes
2 answers

Speeding up sparse FFT computations

I'm hoping someone can review my code below and offer hints how to speed up the section between tic and toc. The function below attempts to perform an IFFT faster than Matlab's built-in function since (1) almost all of the fft-coefficient bins are…
ggkmath
  • 4,188
  • 23
  • 72
  • 129
2
votes
0 answers

Discrete Fourier Transform using scipy.fftpack

I have a question regarding the scipy.fft package, and how I can use this to generate a Fourier transform of a pulse. I am trying to do this for an arbitrary pulse in the future, but I wanted to make it as simple as possible so I have been…
2
votes
3 answers

What kind of output should I see from getFft?

Alright, so I am working on creating an Android audio visualization app. The problem is, what I get form the method getFft() doesn't jive with what google says it should produce. I traced the source code all the way back to C++, but I am not…
ebolyen
  • 956
  • 2
  • 10
  • 25
2
votes
1 answer

Erasing noise from fft chart

Do you know how to delete so much noise from the FFT? Here is my code of FFT: import numpy as np fft1 = (Bx[51:-14]) fft2 = (By[1:-14]) # Loop for FFT data for dataset in [fft1]: dataset = np.asarray(dataset) psd =…
Hiddenguy
  • 547
  • 13
  • 33
2
votes
0 answers

fourier transform from X,Y lists

Hello I am trying to do a Fourier transform on some data using Python, but I have difficulty understanding much of the mathematics & code behind it. From my limited understanding, I know a Fourier transform is essentially another way to look at a…
2
votes
1 answer

FFT in Python 2.7 merging two codes

I have two codes for an FFT but I need to merge them, because they seems to be working well in some parts. Let me explain. First code: fft1 = (Bx[51:-14]) fft2 = (By[1:-14]) # NS antena FFT - red FFTdata = np.sqrt(fft1*fft1)**1 samples =…
Hiddenguy
  • 547
  • 13
  • 33
2
votes
1 answer

Split step Fourier propagation - Beam propagation method

Hello I'm having a difficulty using the split step Fourier method. Assuming I want to propagate a Gaussian in free space, I'm supposed to use: A(x,z) = F^-1 [exp((i*k^2*z)/(2*k_0))* F[A(x,0)]] where F is the Fourier and F^-1 is the inverse…
FlyGuy
  • 31
  • 6
2
votes
0 answers

calculate crosscorrelation using fft (JTransforms)

I'm trying to find a reference audiosignal inside an audiorecording. To do this I use crosscorrelation between the two signals (the reference signal is a linear chirp that goes from 20kHz to 21kHz in .1s so it should have pretty decent…
TropicalSpore
  • 119
  • 2
  • 9
2
votes
1 answer

How is the one-dimensional inverse discrete Fourier Transform calculated in numpy?

I have an array of complex numbers (waves), which is ordered in the same way as is returned by fft. If I call ifft on this array, it returns an approximation of the original samples. I would like to implement ifft myself in python. I've found the…
Iter Ator
  • 8,226
  • 20
  • 73
  • 164
2
votes
1 answer

Discrete Fourier Transform in Python

I need to use discrete Fourier transform (DFT) in Python (and inverse DFT) and the results I obtain are a bit weird, so I tried on a small example and I am not sure I understand the mistake (if it is math or coding). Here is my small version of the…
JohnDoe122
  • 638
  • 9
  • 23
2
votes
2 answers

Arbitrary Length FFT in C++

I am trying to run the C++ FFT code from this web page: https://www.nayuki.io/page/free-small-fft-in-multiple-languages Pretty new to C++, so don't know how to run it. Essentially, I want to pass on a REAL vector and an IMAG vector to the program…
Saif
  • 163
  • 2
  • 11
2
votes
1 answer

Parseval's Theorem does not hold for FFT of a sinusoid + noise?

Thanks in advance for any help on this subject. I've recently been trying to work out Parseval's theorem for discrete fourier transforms when noise is included. I based my code from this code. What I expected to see is that (as when no noise is…
2
votes
2 answers

Why does zero padding in Fourier domain lead to an inverse transform which is complex?

If I start off with a signal which has only real values, performing an fft and ifft returns the exact signal back with no complex entries as expected. But if I pad the fft with zeros to obtain interpolated values in the time domain, the inverse fft…
Sachu17
  • 61
  • 5