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

Creating an array of Audio Frequency Amplitudes with Minim

I'm working on an audio visualization project that is based off of Minim. For part of this project, I need an array of frequency amps (I'll use this array to determine heights for the monitor bars). I have never used Minim before, so I apologize for…
2
votes
1 answer

Find High Frequencies with Discrete Fourier Transform [OpenCV]

I want to determine image sharpness by the amount of high frequencies within the image. As far as I understand the dft() function from OpenCV returns two matrices with real and complex numbers. This is where I am stuck. How can I determine the…
dcfyg
  • 75
  • 9
2
votes
1 answer

Fourier transform cofficients high and low frequencies

When I apply a Fourier transform to an image, I get huge complex values. What are the corresponding coefficients' values of high frequencies, and how about low frequencies? When I use the function fft2 in MATLAB, I get N x M values, for example: two…
t.hicham
  • 45
  • 8
2
votes
2 answers

What parameters can a fourier transformation have? / How to process the shifted result?

I have a simple Python 3 TKinter Image Editor using OpenCV3 and numpy. I wanted to implement a Fourier Transform and used the first example from here with numpy: f = np.fft.fft2(img) fshift = np.fft.fftshift(f) magnitude_spectrum =…
xuiqzy
  • 179
  • 2
  • 14
2
votes
2 answers

FFT not computing fourier transform

I have a csv file that I read in (using python 3 on a Jupyter notebook but get the same results from terminal). I am computing the fft via numpy.fft.fft module and am getting the strange result that the fft of the data returns back the original data…
Orko
  • 142
  • 1
  • 7
2
votes
1 answer

blocked FFT of signal with frequency noise

I have a signal with a phase that is around 40 Hz, with small amounts of noise. I am trying to analyze it to find the frequency in 1 second blocks, I am using python to do a simulation of this. I found that the blocked FFT analysis was not accurate,…
TheStrangeQuark
  • 2,257
  • 5
  • 31
  • 58
2
votes
2 answers

How to implement/perform DFT on a segment in python?

I am trying to write a simple program in python that will calculate and display DFT output of 1 segment. My signal is 3 seconds long, I want to calculate DFT for every 10ms long segment. Sampling rate is 44100. So one segment is 441 samples…
Dusan J.
  • 303
  • 5
  • 19
2
votes
2 answers

Fitting time series with Fourier components: estimating Fourier series coefficients

Problem: I have a set of measurements (time, measurement, error) that exhibit periodic variations and I want to fit them with a Fourier series of the form where A0 is the mean value of my measurements, t is the time, t0 is a (known) reference time…
Hooloovoo
  • 865
  • 2
  • 11
  • 21
2
votes
0 answers

Convolution/FFT algorithm for a machine with slow memory and no cache?

I'm trying to write a convolution function for a GPU using OpenCL. Benchmarking shows that the GPU's data load instructions are very expensive and the run time scales linearly with the total number of LD instructions, indicating the GPU as little or…
user3528438
  • 2,737
  • 2
  • 23
  • 42
2
votes
0 answers

Numpy's real-FFT and fftshift

I have an image in Fourier space, that looks like (real part): I want to get the real space picture through numpy's irfft2: So what i show here is np.fft.irfft2 of the previous image: My intuition may be off, but through numpy's conventions for the…
user1991
  • 584
  • 1
  • 4
  • 18
2
votes
1 answer

Weird behavior when performing 2D convolution by the FFT

I am trying to construct the product of the FFT of a 2D box function and the FFT of a 2D Gaussian function. After, I find the inverse FFT and I am expecting a convolution of the two functions as a result. However, I am getting a weird one-sided…
koshy george
  • 671
  • 6
  • 24
2
votes
2 answers

Computing a power spectrum

I would like to compute a power spectrum using Python3. From another thread about this topic I got the basic ingredients. I think it should be something like: ps = np.abs(np.fft.fft(x))**2 timeres = t[1]-t[0] freqs = np.fft.fftfreq(x.size,…
user90465
  • 187
  • 2
  • 13
2
votes
1 answer

AVAudioEngine Microphone Float Data

i'm trying to get the float data of a realtime mic input with AVAudioEngine. To proceed a fft and a special algorithm after the fft. When i compile the code im becoming this output on the console:0x0000000000000000 What i doing wrong? Many thanks…
norbu
  • 301
  • 1
  • 3
  • 7
2
votes
1 answer

vDSP FFT2d Swift wrong imaginary part on the result

I'm using vDSP from Accelerate framework to perform a fft2d operation in a 2d array that comes from a mesh grid. The problem is that I get an array of 0 in the imaginary part that don't match with the same operation in python using pylab.fft2. If I…
Daniel Rogi
  • 163
  • 7
2
votes
1 answer

( p5.js ) FFT report lower frequencies "too loud" and higher frequencies "mute"?

I have been experimenting with simple FFT using p5 sound and then plotting the bands of the spectrum visually. One thing i noticed is that the lower frequencies appears very high in almost all tracks while the high frequencies seems to be mute. So…
kroe
  • 1,116
  • 3
  • 11
  • 23