Questions tagged [fft]

The fast Fourier transform is an efficient algorithm to compute the discrete Fourier transform (DFT) and its inverse.

Filter by
Sorted by
Tagged with
72
votes
3answers
21k views

Why is it a bad idea to filter by zeroing out FFT bins?

It's very easy to filter a signal by performing an FFT on it, zeroing out some of the bins, and then performing an IFFT. For instance: ...
77
votes
6answers
140k views

Why should I zero-pad a signal before taking the Fourier transform?

In an answer to a previous question, it was stated that one should zero-pad the input signals (add zeros to the end so that at least half of the wave is "blank") What's the reason for this?
4
votes
4answers
3k views

About Discrete Fourier Transform vs. Discrete Fourier Series

I am new to the field of signal processing. I am wondering what is the difference between DFS(Fourier Series) vs. DFT(Fourier Transform). For common applications, usually we get a segment(length <...
58
votes
7answers
90k views

How do I implement cross-correlation to prove two audio files are similar?

I have to do cross correlation of two audio file to prove they are similar. I have taken the FFT of the two audio files and have their power spectrum values in separate arrays. How should I proceed ...
26
votes
4answers
4k views

Which time-frequency coefficients does the Wavelet transform compute?

The Fast Fourier Transform takes $\mathcal O(N \log N)$ operations, while the Fast Wavelet Transform takes $\mathcal O(N)$. But what, specifically, does the FWT compute? Although they are often ...
26
votes
5answers
7k views

Is there a technical term for this simple method of smoothing out a signal?

Firstly, I am new to DSP and have no real education in it, but I am developing an audio visualization program and I am representing an FFT array as vertical bars as in a typical frequency spectrum ...
21
votes
3answers
10k views

Tips for improving pitch detection

I'm working on a simple web app that allows the user to tune his/her guitar. I'm a real beginner in signal processing, so don't judge too hard if my question is inappropriate. So, I managed to get ...
17
votes
2answers
20k views

Why does spectral leakage arise in an FFT?

I've tried googling and wikipedia-ing it, but I haven't gotten any answers beyond 'it's because the frequency of the input signal is sitting between two bins'. I understand that this is the reason, ...
8
votes
4answers
3k views

Intuition for sidelobes in FFT

I was wondering if there's a intuitive way to understand why sidelobes appear when performing an FFT on a signal of fixed length?
10
votes
3answers
2k views

MATLAB: $\tt fft$ and $\tt ifft$ scaling

In MATLAB, the outputs of the fft and/or ifft functions often require additional processing before being considered for analysis....
0
votes
1answer
108 views

Using fourier coefficients to reconstruct data in matlab

When doing a discrete fourier transform on some data using matlab's fft function, its output is a set of fourier coefficients but I was wondering how do I go about converting these into an and bn so I ...
14
votes
3answers
17k views

Fast Cosine Transform via FFT

I want to implement the Fast Cosine Transform. I read on wikipedia, that there is a fast version of the DCT which is similarly computed to the FFT. I tried to read the cited Makhoul* paper, for the ...
21
votes
3answers
48k views

What effect does a delay in the time domain have in the frequency domain?

If I have a signal that is time limited, say a sinusoid that only lasts for $T$ seconds, and I take the FFT of that signal, I see the frequency response. In the example this would be a spike at the ...
8
votes
2answers
13k views

FFT frequency resolution

I'm having some problems understanding the FFT. Is the frequency resolution in the spectrum calculated as $\frac{\textrm{sampling rate}}{\textrm{number of FFT points}}$ or $\frac{\textrm{sampling ...
33
votes
9answers
12k views

Is there an algorithm for finding a frequency without DFT or FFT?

I was looking in the Android app store for a guitar tuner. I found a tuner app that claimed it was faster than other apps. It claimed it could find the frequency without using the DFT (I wish I still ...
22
votes
4answers
5k views

How to distinguish voice from snoring?

Background: I'm working on an iPhone application (alluded to in several other posts) that "listens to" snoring/breathing while one is asleep and determines if there are signs of sleep apnea (as a pre-...
16
votes
1answer
19k views

What is the phase and magnitude response of white noise?

I would like to create white noise in the frequency domain, and then transform it to the time domain using python. To understand the problem, I simply generated white noise in the time domain, and ...
14
votes
5answers
9k views

FFT of sine wave not coming as expected i.e single point

The cyan plot is a spectrum of 50 Hz, and the magenta one is a 50.1 Hz sine wave (having amplitude 0.7). Both are sampled at 1024 samples/s. I performed a 1024 point FFT to get this spectrum. Why is ...
12
votes
4answers
18k views

Efficiently calculating autocorrelation using FFTs

I'm trying to calculate an autocorrelation on a platform where the only accelerated primitive I have available is the (I)FFT. I'm having a problem though. I prototyped it in MATLAB. I am, however, ...
4
votes
3answers
21k views

Number of DFT (FFT) Points Required for a Specific Frequency Resolution for an Oversampled Signal

I have a bandpass signal centered at 2 MHz and bandwidth of 50 kHz (the signal frequency varies from 2 MHz - 25 kHz to 2 MHz + 25 kHz). This signal is being sampled at 10 MHz. I want a frequency ...
11
votes
2answers
21k views

Image Reconstruction:Phase vs. Magnitude

Figure 1.(c) shows the Test image reconstructed from MAGNITUDE spectrum only. We can say that the intensity values of LOW frequency pixels are comparatively more than HIGH frequency pixels. Figure 1.(...
11
votes
3answers
2k views

Why do I have frequency leakage in DFT after zero padding if frequency resolution is fine?

Let's consider this example: Fs=1000; Ns=500; t=0:1/Fs:(Ns-1)*1/Fs; f1=10; f2=400; x=5+5*sin(2*pi*f1*t)+2*sin(2*pi*f2*t); X=fft(x); In this scenario, frequency ...
11
votes
6answers
5k views

Is there an algorithm to compute the phase for a single frequecy?

If you have a function $f(t)=A \cdot \sin(\omega t+\phi)$, and reference sin wave $\sin(\omega x)$ what would be a fast algorithm to compute $\phi$? I was looking at Goertzel algorithm, but it doesn'...
17
votes
4answers
8k views

How do you calculate spectral flatness from an FFT?

Ok, the spectral flatness (also called Wiener entropy) is defined as the ratio of the geometric mean of a spectrum to its arithmetic mean. Wikipedia and other references say the power spectrum. Isn'...
1
vote
1answer
4k views

scipy.signal.spectrogram

I want to do time-frequency analysis of a signal. So i decided to use spectrogram function from scipy. This function returns, three parameters f,t,Sxx. I am using below arguements: x : my signal fs : ...
4
votes
1answer
4k views

Non Uniform FFT / DFT with FFTW?

Can FFTW perform the FFT on data which is not uniform in time? I can't seem to find a straight-forward answer to this question anywhere online.
3
votes
1answer
308 views

Filtering $ n \times n $ Images by Separable $ m \times m $ Filters. Computation Time for Filtering Using FFT, 2D Convolution and Two 1D Convolutions

Consider filtering square $n\times n$ images by square, separable $m\times m$ filters. Give general equations for the computation time for the following approaches to this: Filtering using FFT 2-D ...
22
votes
1answer
25k views

What is the difference between PSD and squared magnitude of frequency spectrum?

The power spectrum of a signal can be calculated by taking the magnitude squared of its Fourier transform. Being an audio person, the signal of interest for me would be a time series. How does this ...
28
votes
3answers
29k views

Picking the correct filter for accelerometer data

I am fairly new to DSP, and have done some research on possible filters for smoothing accelerometer data in python. An example of the type of data Ill be experiencing can be seen in the following ...
17
votes
3answers
4k views

FFT with asymmetric windowing?

Common non-rectangular window functions all seem to be symmetric. Is there ever a case when one would want to use a non-symmetric window function before an FFT? (Say if the data on one side of the ...
2
votes
2answers
4k views

What should be the correct scaling for PSD calculation using $\tt fft$

I would to calculate the PSD of a signal using FFT however the result do not match with periodogram command. What did was as follow : ...
11
votes
2answers
3k views

What statistic is used to determine presence of a signal in noise?

This is a detector problem I believe: I am being stumped by what appears to be a simple problem. Basically, I have a band of interest. If signal energies exist within this band of interest, then I ...
0
votes
2answers
6k views

FFT Pitch Detection methods: Autocorrelation or other?

I've seen many posts here that state that an FFT is almost all you need to get the fundamental frequency from an input stream. The problem is that, with sound, this doesn't work; we need to look for ...
6
votes
1answer
4k views

SPL values from FFT of microphone signal

I am trying to get a frequency response vs dB SPL plot for recorded sounds. I have a microphone with a flat response, a sensitivity of 4mV/Pa, and 1 Pa = 94dB. To get the dB SPL, I have the following ...
5
votes
3answers
22k views

FFT to spectrum in decibel

Here is a 10 seconds-long 440hz sine wave normalized at $0\textrm{ dBFS}$. When computing the STFT (with the code below) of this audio file, I noticed that ...
3
votes
2answers
2k views

FFT analysis for Vibration Signal

I am working on balancing an air-spindle. For the unbalance analysis I use an accelerometer (NI device). I have the voltage signal from the accelerometer corresponding to the vibration of spindle at a ...
2
votes
1answer
5k views

Implementing inverse FFT using forward FFT

I am trying to implement an inverse FFT using the forward FFT. For clarity: Let S[t] be a signal in time, and S[w] the transformed signal. As per this site, it seems one can reverse S[w], use the ...
9
votes
1answer
3k views

What transform can I use to “zoom” in a specific portion of a signal's spectrum?

If I recall correctly, there is a variation of the DFT that can be used to analyze a specific band of the spectrum of a signal. How is it called?
3
votes
3answers
3k views

recover image by only magnitude of image fourier transform

I have a image and I want calculate fft2 of it, after it I want recover image only by magnitude of it. how can I achieve this work? ...
2
votes
1answer
710 views

For 2D signals can it be said that the frequency response is the same as the Fourier transform?

Say I have a signal: [1, 1 , 1; 1 100 1; 1 1 1];, I wanted its frequency response, then can I take its FFT? Why does MATLAB have two functions to do the same ...
1
vote
1answer
183 views

Applying Image Filtering (Circular Convolution) in Frequency Domain

To filter an image we can: Use a 3x3, 5x5, 7x7, etc. filter, that is convolve the image and the filter in the space domain. Use a FFT on both the image and the filter, multiply them together in the ...
6
votes
2answers
39k views

Power spectral density vs. FFT bin magnitude

What's the difference between these? Both are measurements of some form of signal power, but surely there's some difference between the power they are measuring?
17
votes
3answers
7k views

Why are magnitudes normalised during synthesis (IDFT), not analysis (DFT)?

In most examples and FFT code that I've seen, the output (frequency magnitudes) of the forward DFT operation is scaled by N -- i.e. instead of giving you the magnitude of each frequency bin, it gives ...
12
votes
3answers
4k views

STFT and DWT (Wavelets)

STFT can be successfully used on sound data (with a .wav soundfile for example) in order to do some frequency-domain modifications (example : noise removal). With ...
8
votes
5answers
4k views

Piano pitch detection

I'm working on a piano tuning program and part of it requires real-time pitch detection. Here is the scheme I have so far which works to some degree but could probably use some refinement. I'm ...
7
votes
1answer
2k views

Coloring a waveform with spectral centroid or by other means

Update 8 Unhappy of having to upload tracks to the service and looking at the new release of RekordBox 3 I've decided to take another look for an offline approach and a finer resolution :D Sounds ...
12
votes
4answers
2k views

Recommendation for book - Writing DSP code in C

I am looking for some good book, that simply show how you actually write a code in C, to do all the main DSP methods . FFT. Low-pass and high-pass filters. Auto-correlation. Noise processing. And ...
11
votes
2answers
11k views

Why do we say that “zero-padding doesn't really increase frequency resolution”

Here is a sinusoid of frequency f = 236.4 Hz (it is 10 milliseconds long; it has N=441 points at sampling rate ...
7
votes
1answer
2k views

Failed to implement Goertzel algorithm in Python

After some questioning on stackoverflow, I tried to implement a Goertzel algorithm in Python. But it doesn't work : https://gist.github.com/4128537 ...
4
votes
4answers
11k views

Choosing the right overlap for a window function

On Wikipedia there is quite a list of window functions. However, when you are doing a lot of STFTs, you often have to have some overlap to get better results. Generally an overlap factor of 2 (i.e., ...